1 # RUN: yaml2obj %s -o %t
2 # Establish baseline objects for further checks. --discard-locals only discards
3 # compiler-generated local symbols (starting with .L), --discard-all discards
4 # all regular local symbols.
5 # RUN: llvm-objcopy %t %t-discard-none
6 # RUN: llvm-readobj --symbols %t-discard-none | FileCheck %s --check-prefixes=CHECK,LOCAL,COMPILER-LOCAL
7 # RUN: llvm-objcopy --discard-all %t %t-discard-all
8 # RUN: llvm-readobj --symbols %t-discard-all | FileCheck %s
9 # RUN: llvm-objcopy --discard-locals %t %t-discard-locals
10 # RUN: llvm-readobj --symbols %t-discard-locals | FileCheck %s --check-prefixes=CHECK,LOCAL
12 # When mixing --discard-all and --discard-locals, the last one wins.
13 # RUN: llvm-objcopy --discard-all --discard-locals %t %t.1.o
14 # RUN: cmp %t.1.o %t-discard-locals
15 # RUN: llvm-objcopy --discard-locals --discard-all %t %t.2.o
16 # RUN: cmp %t.2.o %t-discard-all
17 # RUN: llvm-objcopy -x -X %t %t.3.o
18 # RUN: cmp %t.3.o %t-discard-locals
19 # RUN: llvm-objcopy -X -x %t %t.4.o
20 # RUN: cmp %t.4.o %t-discard-all
21 # RUN: llvm-objcopy -x -X -x -X %t %t.5.o
22 # RUN: cmp %t.5.o %t-discard-locals
23 # RUN: llvm-objcopy -X -x -X -x %t %t.6.o
24 # RUN: cmp %t.6.o %t-discard-all
25 # RUN: llvm-objcopy -X -x -X -x --discard-locals %t %t.7.o
26 # RUN: cmp %t.7.o %t-discard-locals
27 # RUN: llvm-objcopy -X -x -X -x --discard-all %t %t.8.o
28 # RUN: cmp %t.8.o %t-discard-all
30 # llvm-strip works in the same way.
31 # RUN: llvm-strip --discard-all --discard-locals %t -o %t.9.o
32 # RUN: cmp %t.9.o %t-discard-locals
33 # RUN: llvm-strip --discard-locals --discard-all %t -o %t.10.o
34 # RUN: cmp %t.10.o %t-discard-all
35 # RUN: llvm-strip -x -X %t -o %t.11.o
36 # RUN: cmp %t.11.o %t-discard-locals
37 # RUN: llvm-strip -X -x %t -o %t.12.o
38 # RUN: cmp %t.12.o %t-discard-all
39 # RUN: llvm-strip -x -X -x -X %t -o %t.13.o
40 # RUN: cmp %t.13.o %t-discard-locals
41 # RUN: llvm-strip -X -x -X -x %t -o %t.14.o
42 # RUN: cmp %t.14.o %t-discard-all
43 # RUN: llvm-strip -X -x -X -x --discard-locals %t -o %t.15.o
44 # RUN: cmp %t.15.o %t-discard-locals
45 # RUN: llvm-strip -X -x -X -x --discard-all %t -o %t.16.o
46 # RUN: cmp %t.16.o %t-discard-all
70 # CHECK-NEXT: Symbol {
72 # CHECK-NEXT: Value: 0x0
74 # CHECK-NEXT: Binding: Local
75 # CHECK-NEXT: Type: None
76 # CHECK-NEXT: Other: 0
77 # CHECK-NEXT: Section: Undefined
79 # LOCAL-NEXT: Symbol {
80 # LOCAL-NEXT: Name: Local
83 # LOCAL-NEXT: Binding: Local
84 # LOCAL-NEXT: Type: Function
86 # LOCAL-NEXT: Section: .text
88 # COMPILER-LOCAL-NEXT: Symbol {
89 # COMPILER-LOCAL-NEXT: Name: .L.str
90 # COMPILER-LOCAL-NEXT: Value:
91 # COMPILER-LOCAL-NEXT: Size:
92 # COMPILER-LOCAL-NEXT: Binding: Local
93 # COMPILER-LOCAL-NEXT: Type: Object
94 # COMPILER-LOCAL-NEXT: Other:
95 # COMPILER-LOCAL-NEXT: Section: .text
96 # COMPILER-LOCAL-NEXT: }
97 # CHECK-NEXT: Symbol {
98 # CHECK-NEXT: Name: Global
101 # CHECK-NEXT: Binding: Global
102 # CHECK-NEXT: Type: Function
104 # CHECK-NEXT: Section: .text