diff options
Diffstat (limited to 'llvm/test/tools/llvm-objcopy/wasm/strip-debug.test')
-rw-r--r-- | llvm/test/tools/llvm-objcopy/wasm/strip-debug.test | 71 |
1 files changed, 65 insertions, 6 deletions
diff --git a/llvm/test/tools/llvm-objcopy/wasm/strip-debug.test b/llvm/test/tools/llvm-objcopy/wasm/strip-debug.test index 2747c3b..53e8153 100644 --- a/llvm/test/tools/llvm-objcopy/wasm/strip-debug.test +++ b/llvm/test/tools/llvm-objcopy/wasm/strip-debug.test @@ -1,14 +1,65 @@ -## Test that debug sections (but not linking or names) are stripped with --strip-debug # RUN: yaml2obj %s -o %t -# RUN: llvm-strip --strip-debug %t -# RUN: obj2yaml %t | FileCheck --implicit-check-not=.debug %s +# RUN: cp %t %t3 +# RUN: llvm-objcopy --strip-debug %t %t2 +## Test that debug sections (but not linking or names) are stripped with --strip-debug +# RUN: obj2yaml %t2 | FileCheck --implicit-check-not=.debug %s +# +# RUN: llvm-objcopy -g %t %t2g +# Verify that --strip-debug and -g produce the same output +# RUN: cmp %t2 %t2g + +# RUN: llvm-strip --strip-debug %t3 +# RUN: cmp %t2 %t3 + +# RUN: cp %t %t4 +# RUN: llvm-strip -d %t4 +# RUN: cmp %t2 %t4 + +# RUN: cp %t %t5 +# RUN: llvm-strip -g %t5 +# RUN: cmp %t2 %t5 + +# RUN: cp %t %t6 +# RUN: llvm-strip -S %t6 +# RUN: cmp %t2 %t6 + +# Verify that an archive with multiple object files is handled correctly. +# RUN: cp %t %t.duplicate +# RUN: cp %t2 %t.duplicate.stripped +# RUN: rm -f %t.multiple-stripped-obj.a +# RUN: llvm-ar crs %t.multiple-stripped-obj.a %t2 %t.duplicate.stripped +# RUN: rm -f %t.multiple-obj.a +# RUN: llvm-ar crs %t.multiple-obj.a %t %t.duplicate +# RUN: llvm-objcopy --strip-debug %t.multiple-obj.a %t.multiple-obj.stripped.a +# RUN: llvm-ar p %t.multiple-stripped-obj.a > %t.multiple-stripped-obj.a.dump +# RUN: llvm-ar p %t.multiple-obj.stripped.a > %t.multiple-obj.stripped.a.dump +# RUN: cmp %t.multiple-stripped-obj.a.dump %t.multiple-obj.stripped.a.dump # CHECK: Sections: # CHECK-NEXT: - Type: TYPE -# CHECK: Name: linking +# CHECK: - Type: CUSTOM +## We expect the linking section to be preceeded by the removed `.debug_info` +## section. +# CHECK-NEXT: Name: .objcopy.removed +# CHECK-NEXT: Payload: '' +# CHECK-NEXT: - Type: CUSTOM +# CHECK-NEXT: Name: linking # CHECK: Name: name # CHECK-NEXT: FunctionNames: # CHECK: Name: producers +## Following the producers section we expect to find three removed sections. +## The `.debug_line` section that two reloction section corresponding to the +## two debug sections. +# CHECK: - Type: CUSTOM +# CHECK-NEXT: Name: .objcopy.removed +# CHECK-NEXT: Payload: '' +# CHECK-NEXT: - Type: CUSTOM +# CHECK-NEXT: Name: .objcopy.removed +# CHECK-NEXT: Payload: '' +# CHECK-NEXT: - Type: CUSTOM +# CHECK-NEXT: Name: .objcopy.removed +# CHECK-NEXT: Payload: '' + --- !WASM FileHeader: @@ -28,7 +79,11 @@ Sections: Body: 0B - Type: CUSTOM Name: .debug_info - Payload: CAFE1234 + Payload: 'CAFE123456' + Relocations: + - Type: R_WASM_FUNCTION_INDEX_LEB + Index: 0 + Offset: 0x0000000 - Type: CUSTOM Name: linking Version: 2 @@ -50,4 +105,8 @@ Sections: Version: 9.0.0 - Type: CUSTOM Name: .debug_line - Payload: DEADBEEF + Payload: 'DEADBEEF01' + Relocations: + - Type: R_WASM_FUNCTION_INDEX_LEB + Index: 0 + Offset: 0x0000000 |