• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1## Test the contents of a custom section dumped from a binary.
2# RUN: yaml2obj %s -o %t
3# RUN: llvm-objcopy --dump-section=producers=%t.sec %t
4# RUN: od -t x1 %t.sec | FileCheck %s
5
6# RUN: not llvm-objcopy --dump-section=nonexistent=%t.sec %t 2>&1 | FileCheck --check-prefix=NONEXISTENT %s
7# RUN: not llvm-objcopy --dump-section=producers=%t.dir/bar %t 2>&1 | FileCheck --check-prefix=DIROUT %s
8
9## Raw contents of the producers section.
10# CHECK: 0000000 01 0c 70 72 6f 63 65 73 73 65 64 2d 62 79 01 05
11# CHECK: 0000020 63 6c 61 6e 67 05 39 2e 30 2e 30
12
13# NONEXISTENT: section 'nonexistent' not found
14# DIROUT: error: {{.*}}/bar': {{[nN]}}o such file or directory
15
16## Check that dumping and removing a section works in the same invocation
17# RUN: llvm-objcopy --dump-section=producers=%t.sec --remove-section=producers %t %t2
18# RUN: od -t x1 %t.sec | FileCheck %s
19# RUN: obj2yaml %t2 | FileCheck --check-prefix=REMOVED %s
20
21# REMOVED-NOT: producers
22
23--- !WASM
24FileHeader:
25  Version: 0x00000001
26Sections:
27  - Type: TYPE
28    Signatures:
29      - Index: 0
30        ParamTypes:
31          - I32
32        ReturnTypes:
33          - F32
34  - Type: CUSTOM
35    Name: producers
36    Tools:
37      - Name:   clang
38        Version: 9.0.0
39