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 5 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 10 11# CHECK: Sections: 12# CHECK: - Type: CUSTOM 13# CHECK-NEXT: Name: .debug_info 14# CHECK: - Type: CUSTOM 15# CHECK-NEXT: Name: .debug_line 16# KEEP: Name: foo 17 18## Test that remove-section overrides only-keep-debug. 19# RUN: yaml2obj %s -o %t 20# RUN: llvm-strip --only-keep-debug --remove-section=.debug_info %t 21# RUN: obj2yaml %t | FileCheck %s --check-prefix=NOINFO --implicit-check-not=.debug_info 22 23# NOINFO: Name: .debug_line 24 25--- !WASM 26FileHeader: 27 Version: 0x00000001 28Sections: 29 - Type: TYPE 30 Signatures: 31 - Index: 0 32 ParamTypes: 33 - I32 34 ReturnTypes: 35 - F32 36 - Type: CUSTOM 37 Name: .debug_info 38 Payload: CAFE1234 39 - Type: CUSTOM 40 Name: linking 41 Version: 2 42 - Type: CUSTOM 43 Name: producers 44 Tools: 45 - Name: clang 46 Version: 9.0.0 47 - Type: CUSTOM 48 Name: .debug_line 49 Payload: DEADBEEF 50 - Type: CUSTOM 51 Name: foo 52 Payload: CAFE 53