46 lines · plain
1## Test --only-section.2# RUN: yaml2obj %s -o %t3# RUN: llvm-objcopy --only-section=foo %t %t24# RUN: obj2yaml %t2 | FileCheck --implicit-check-not TYPE --implicit-check-not producers %s5 6## Test that it's the same with only-section + keep-section (for the same section).7# RUN: llvm-objcopy --only-section=foo --keep-section=foo %t %t28# RUN: obj2yaml %t2 | FileCheck --implicit-check-not TYPE --implicit-check-not producers %s9 10## Also test that only-section overrides remove-section.11# RUN: llvm-objcopy --only-section=foo --remove-section=foo %t %t212# RUN: obj2yaml %t2 | FileCheck --implicit-check-not producers %s13 14## This file has both known and custom sections. Check that only the foo section is left.15# CHECK: Sections:16# CHECK-NEXT: - Type: CUSTOM17# CHECK-NEXT: Name: foo18# CHECK-NEXT: Payload: DEADBEEF19# CHECK-NEXT: ...20 21## Test that only-section + keep-section keeps both sections.22# RUN: llvm-objcopy --only-section=foo --keep-section=producers %t %t223# RUN: obj2yaml %t2 | FileCheck --implicit-check-not=TYPE --check-prefix=KEEP %s24# KEEP: Name: foo25# KEEP: Name: producers26 27--- !WASM28FileHeader:29 Version: 0x0000000130Sections:31 - Type: CUSTOM32 Name: foo33 Payload: DEADBEEF34 - Type: TYPE35 Signatures:36 - Index: 037 ParamTypes:38 - I3239 ReturnTypes:40 - F3241 - Type: CUSTOM42 Name: producers43 Tools:44 - Name: clang45 Version: 9.0.046