1 ## Test that only debug sections are kept with --only-keep-debug.
2 # RUN: yaml2obj %s -o %t.wasm
3 # RUN: llvm-strip --only-keep-debug %t.wasm -o %t2.wasm
4 # RUN: obj2yaml %t2.wasm | FileCheck %s -check-prefixes=CHECK,STRIPTYPE,STRIPFOO
6 ## Test that keep-section overrides only-keep-debug.
7 # RUN: llvm-strip --only-keep-debug --keep-section=foo %t.wasm -o %t3.wasm
8 # RUN: obj2yaml %t3.wasm | FileCheck --implicit-check-not=Name --check-prefixes=CHECK,STRIPTYPE,KEEPFOO %s
10 ## Test that keep-section overrides only-keep-debug, even for known sections.
11 # RUN: llvm-strip --only-keep-debug --keep-section=TYPE %t.wasm -o %t4.wasm
12 # RUN: obj2yaml %t4.wasm | FileCheck --implicit-check-not=Name --check-prefixes=CHECK,KEEPTYPE,STRIPFOO %s
15 # KEEPTYPE: - Type: TYPE
16 # STRIPTYPE-NOT: - Type: TYPE
17 # STRIPTYPE: - Type: CUSTOM
18 # STRIPTYPE-NEXT: Name: .objcopy.removed
19 # CHECK: - Type: CUSTOM
20 # CHECK-NEXT: Name: .debug_info
21 # CHECK: - Type: CUSTOM
22 # CHECK-NEXT: Name: .objcopy.removed
23 # CHECK: - Type: CUSTOM
24 # CHECK-NEXT: Name: .objcopy.removed
25 # CHECK: - Type: CUSTOM
26 # CHECK-NEXT: Name: .debug_line
27 # CHECK: - Type: CUSTOM
28 # KEEPFOO-NEXT: Name: foo
29 # STRIPFOO-NEXT: Name: .objcopy.removed
31 ## Test that remove-section overrides only-keep-debug.
32 # RUN: yaml2obj %s -o %t
33 # RUN: llvm-strip --only-keep-debug --remove-section=.debug_info %t
34 # RUN: obj2yaml %t | FileCheck %s --check-prefix=NOINFO --implicit-check-not=.debug_info
36 # NOINFO: Name: .debug_line