1 ## Test that only debug sections are kept with --only-keep-debug.
2 # RUN: yaml2obj %s -o %t
3 # RUN: llvm-strip --only-keep-debug %t
4 # RUN: obj2yaml %t | FileCheck %s
6 ## Test that keep-section overrides only-keep-debug.
7 # RUN: yaml2obj %s -o %t
8 # RUN: llvm-strip --only-keep-debug --keep-section=foo %t
9 # RUN: obj2yaml %t | FileCheck --implicit-check-not=Name --check-prefix=CHECK --check-prefix=KEEP %s
11 ## Test that keep-section overrides only-keep-debug, even for known sections.
12 # RUN: yaml2obj %s -o %t
13 # RUN: llvm-strip --only-keep-debug --keep-section=TYPE %t
14 # RUN: obj2yaml %t | FileCheck --implicit-check-not=Name --check-prefix=CHECK --check-prefix=KEEPTYPE %s
17 # KEEPTYPE: - Type: TYPE
18 # CHECK-NOT: - Type: TYPE
19 # CHECK: - Type: CUSTOM
20 # CHECK-NEXT: Name: .debug_info
21 # CHECK: - Type: CUSTOM
22 # CHECK-NEXT: Name: .debug_line
25 ## Test that remove-section overrides only-keep-debug.
26 # RUN: yaml2obj %s -o %t
27 # RUN: llvm-strip --only-keep-debug --remove-section=.debug_info %t
28 # RUN: obj2yaml %t | FileCheck %s --check-prefix=NOINFO --implicit-check-not=.debug_info
30 # NOINFO: Name: .debug_line