brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 2d1533f Raw
51 lines · plain
1## Test the contents of a custom section dumped from a binary.2# RUN: yaml2obj %s -o %t3# RUN: llvm-objcopy --dump-section=producers=%t.sec %t4# RUN: od -t x1 %t.sec | FileCheck %s5 6# RUN: not llvm-objcopy --dump-section=nonexistent=%t.sec %t 2>&1 | FileCheck --check-prefix=NONEXISTENT %s7# RUN: not llvm-objcopy --dump-section=producers=%t.dir/bar %t 2>&1 | FileCheck -DMSG=%errc_ENOENT --check-prefix=DIROUT %s8 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 0511# CHECK: 0000020 63 6c 61 6e 67 05 39 2e 30 2e 3012 13# NONEXISTENT: section 'nonexistent' not found14# DIROUT: error: {{.*}}/bar': [[MSG]]15 16## Test dumping the type section (a known section).17# RUN: llvm-objcopy --dump-section=TYPE=%t.sec %t18# RUN: od -t x1 %t.sec | FileCheck %s --check-prefix=TYPESEC19 20## Raw contents of the type section.21# TYPESEC: 000000 01 60 01 7f 01 7d22# TYPESEC: 00000623 24## Check that dumping and removing a section works in the same invocation25# RUN: llvm-objcopy --dump-section=producers=%t.sec --remove-section=producers %t %t226# RUN: od -t x1 %t.sec | FileCheck %s27# RUN: obj2yaml %t2 | FileCheck --check-prefix=REMOVED %s28 29# REMOVED-NOT: producers30 31# RUN: not llvm-objcopy --dump-section producers=not_exists/text-section %t 2>&1 \32# RUN:   | FileCheck -DMSG=%errc_ENOENT %s -DINPUT=%t --check-prefix=NO-SUCH-PATH33# NO-SUCH-PATH: error: 'not_exists/text-section': [[MSG]]34 35--- !WASM36FileHeader:37  Version: 0x0000000138Sections:39  - Type: TYPE40    Signatures:41      - Index: 042        ParamTypes:43          - I3244        ReturnTypes:45          - F3246  - Type: CUSTOM47    Name: producers48    Tools:49      - Name:   clang50        Version: 9.0.051