1 ## Test --only-section.
2 # RUN: yaml2obj %s -o %t
3 # RUN: llvm-objcopy --only-section=foo %t %t2
4 # RUN: obj2yaml %t2 | FileCheck --implicit-check-not TYPE --implicit-check-not producers %s
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 %t2
8 # RUN: obj2yaml %t2 | FileCheck --implicit-check-not TYPE --implicit-check-not producers %s
10 ## Also test that only-section overrides remove-section.
11 # RUN: llvm-objcopy --only-section=foo --remove-section=foo %t %t2
12 # RUN: obj2yaml %t2 | FileCheck --implicit-check-not producers %s
14 ## This file has both known and custom sections. Check that only the foo section is left.
16 # CHECK-NEXT: - Type: CUSTOM
17 # CHECK-NEXT: Name: foo
18 # CHECK-NEXT: Payload: DEADBEEF
21 ## Test that only-section + keep-section keeps both sections.
22 # RUN: llvm-objcopy --only-section=foo --keep-section=producers %t %t2
23 # RUN: obj2yaml %t2 | FileCheck --implicit-check-not=TYPE --check-prefix=KEEP %s
25 # KEEP: Name: producers