File: dump-section.test

package info (click to toggle)
llvm-toolchain-11 1%3A11.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 995,808 kB
  • sloc: cpp: 4,767,656; ansic: 760,916; asm: 477,436; python: 170,940; objc: 69,804; lisp: 29,914; sh: 23,855; f90: 18,173; pascal: 7,551; perl: 7,471; ml: 5,603; awk: 3,489; makefile: 2,573; xml: 915; cs: 573; fortran: 503; javascript: 452
file content (38 lines) | stat: -rw-r--r-- 1,216 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
## Test the contents of a custom section dumped from a binary.
# RUN: yaml2obj %s -o %t
# RUN: llvm-objcopy --dump-section=producers=%t.sec %t
# RUN: od -t x1 %t.sec | FileCheck %s

# RUN: not llvm-objcopy --dump-section=nonexistent=%t.sec %t 2>&1 | FileCheck --check-prefix=NONEXISTENT %s
# RUN: not llvm-objcopy --dump-section=producers=%t.dir/bar %t 2>&1 | FileCheck --check-prefix=DIROUT %s

## Raw contents of the producers section.
# CHECK: 0000000 01 0c 70 72 6f 63 65 73 73 65 64 2d 62 79 01 05
# CHECK: 0000020 63 6c 61 6e 67 05 39 2e 30 2e 30

# NONEXISTENT: section 'nonexistent' not found
# DIROUT: error: {{.*}}/bar': {{[nN]}}o such file or directory

## Check that dumping and removing a section works in the same invocation
# RUN: llvm-objcopy --dump-section=producers=%t.sec --remove-section=producers %t %t2
# RUN: od -t x1 %t.sec | FileCheck %s
# RUN: obj2yaml %t2 | FileCheck --check-prefix=REMOVED %s

# REMOVED-NOT: producers

--- !WASM
FileHeader:
  Version: 0x00000001
Sections:
  - Type: TYPE
    Signatures:
      - Index: 0
        ParamTypes:
          - I32
        ReturnTypes:
          - F32
  - Type: CUSTOM
    Name: producers
    Tools:
      - Name:   clang
        Version: 9.0.0