1 ## Test --only-section.
2 # RUN: yaml2obj %s -o %t
3 # RUN: llvm-objcopy --only-section=producers %t %t2
4 # RUN: obj2yaml %t2 | FileCheck --implicit-check-not TYPE --implicit-check-not linking %s
6 ## Test that it's the same with only-section + keep-section (for the same section).
7 # RUN: llvm-objcopy --only-section=producers --keep-section=producers %t %t2
8 # RUN: obj2yaml %t2 | FileCheck --implicit-check-not TYPE --implicit-check-not linking %s
10 ## Also test that only-section overrides remove-section.
11 # RUN: llvm-objcopy --only-section=producers --remove-section=producers %t %t2
12 # RUN: obj2yaml %t2 | FileCheck --implicit-check-not linking %s
14 ## This file has both known and custom sections. Check that only the producers section is left.
16 # CHECK-NEXT: - Type: CUSTOM
17 # CHECK-NEXT: Name: producers
20 ## Test that only-section + keep-section keeps both sections.
21 # RUN: llvm-objcopy --only-section=producers --keep-section=linking %t %t2
22 # RUN: obj2yaml %t2 | FileCheck --implicit-check-not=TYPE --check-prefix=KEEP %s
24 # KEEP: Name: producers