1 # RUN: yaml2obj %s -o %t
3 # RUN: llvm-objcopy --strip-debug %t %t2
4 ## Test that debug sections (but not linking or names) are stripped with --strip-debug
5 # RUN: obj2yaml %t2 | FileCheck --implicit-check-not=.debug %s
7 # RUN: llvm-objcopy -g %t %t2g
8 # Verify that --strip-debug and -g produce the same output
11 # RUN: llvm-strip --strip-debug %t3
15 # RUN: llvm-strip -d %t4
19 # RUN: llvm-strip -g %t5
23 # RUN: llvm-strip -S %t6
26 # Verify that an archive with multiple object files is handled correctly.
27 # RUN: cp %t %t.duplicate
28 # RUN: cp %t2 %t.duplicate.stripped
29 # RUN: rm -f %t.multiple-stripped-obj.a
30 # RUN: llvm-ar crs %t.multiple-stripped-obj.a %t2 %t.duplicate.stripped
31 # RUN: rm -f %t.multiple-obj.a
32 # RUN: llvm-ar crs %t.multiple-obj.a %t %t.duplicate
33 # RUN: llvm-objcopy --strip-debug %t.multiple-obj.a %t.multiple-obj.stripped.a
34 # RUN: llvm-ar p %t.multiple-stripped-obj.a > %t.multiple-stripped-obj.a.dump
35 # RUN: llvm-ar p %t.multiple-obj.stripped.a > %t.multiple-obj.stripped.a.dump
36 # RUN: cmp %t.multiple-stripped-obj.a.dump %t.multiple-obj.stripped.a.dump
39 # CHECK-NEXT: - Type: TYPE
40 # CHECK: - Type: CUSTOM
41 ## We expect the linking section to be preceeded by the removed `.debug_info`
43 # CHECK-NEXT: Name: .objcopy.removed
44 # CHECK-NEXT: Payload: ''
45 # CHECK-NEXT: - Type: CUSTOM
46 # CHECK-NEXT: Name: linking
48 # CHECK-NEXT: FunctionNames:
49 # CHECK: Name: producers
50 ## Following the producers section we expect to find three removed sections.
51 ## The `.debug_line` section that two reloction section corresponding to the
52 ## two debug sections.
53 # CHECK: - Type: CUSTOM
54 # CHECK-NEXT: Name: .objcopy.removed
55 # CHECK-NEXT: Payload: ''
56 # CHECK-NEXT: - Type: CUSTOM
57 # CHECK-NEXT: Name: .objcopy.removed
58 # CHECK-NEXT: Payload: ''
59 # CHECK-NEXT: - Type: CUSTOM
60 # CHECK-NEXT: Name: .objcopy.removed
61 # CHECK-NEXT: Payload: ''
84 - Type: R_WASM_FUNCTION_INDEX_LEB
94 Flags: [ BINDING_LOCAL ]
108 Payload: 'DEADBEEF01'
110 - Type: R_WASM_FUNCTION_INDEX_LEB