xref: /aosp_15_r20/external/llvm/test/DebugInfo/llvm-symbolizer.test (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard WorkerRUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x400559" > %t.input
2*9880d681SAndroid Build Coastguard WorkerRUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64.debuglink 0x400559" >> %t.input
3*9880d681SAndroid Build Coastguard WorkerRUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x400436" >> %t.input
4*9880d681SAndroid Build Coastguard WorkerRUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x400528" >> %t.input
5*9880d681SAndroid Build Coastguard WorkerRUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x400586" >> %t.input
6*9880d681SAndroid Build Coastguard WorkerRUN: echo "%p/Inputs/dwarfdump-test2.elf-x86-64 0x4004e8" >> %t.input
7*9880d681SAndroid Build Coastguard WorkerRUN: echo "%p/Inputs/dwarfdump-test2.elf-x86-64 0x4004f4" >> %t.input
8*9880d681SAndroid Build Coastguard WorkerRUN: echo "%p/Inputs/dwarfdump-test4.elf-x86-64 0x62c" >> %t.input
9*9880d681SAndroid Build Coastguard WorkerRUN: echo "%p/Inputs/dwarfdump-inl-test.elf-x86-64 0x8dc" >> %t.input
10*9880d681SAndroid Build Coastguard WorkerRUN: echo "%p/Inputs/dwarfdump-inl-test.elf-x86-64 0xa05" >> %t.input
11*9880d681SAndroid Build Coastguard WorkerRUN: echo "%p/Inputs/dwarfdump-inl-test.elf-x86-64 0x987" >> %t.input
12*9880d681SAndroid Build Coastguard WorkerRUN: echo "%p/Inputs/dwarfdump-inl-test.high_pc.elf-x86-64 0x568" >> %t.input
13*9880d681SAndroid Build Coastguard WorkerRUN: echo "\"%p/Inputs/dwarfdump-test3.elf-x86-64 space\" 0x640" >> %t.input
14*9880d681SAndroid Build Coastguard WorkerRUN: echo "\"%p/Inputs/dwarfdump-test3.elf-x86-64 space\" 0x633" >> %t.input
15*9880d681SAndroid Build Coastguard WorkerRUN: echo "\"%p/Inputs/dwarfdump-test3.elf-x86-64 space\" 0x62d" >> %t.input
16*9880d681SAndroid Build Coastguard WorkerRUN: echo "%p/Inputs/macho-universal 0x1f84" >> %t.input
17*9880d681SAndroid Build Coastguard WorkerRUN: echo "%p/Inputs/macho-universal:i386 0x1f67" >> %t.input
18*9880d681SAndroid Build Coastguard WorkerRUN: echo "%p/Inputs/macho-universal:x86_64 0x100000f05" >> %t.input
19*9880d681SAndroid Build Coastguard WorkerRUN: echo "%p/Inputs/llvm-symbolizer-dwo-test 0x400514" >> %t.input
20*9880d681SAndroid Build Coastguard WorkerRUN: echo "%p/Inputs/fission-ranges.elf-x86_64 0x720" >> %t.input
21*9880d681SAndroid Build Coastguard WorkerRUN: echo "%p/Inputs/arange-overlap.elf-x86_64 0x714" >> %t.input
22*9880d681SAndroid Build Coastguard WorkerRUN: cp %p/Inputs/split-dwarf-test.dwo %T
23*9880d681SAndroid Build Coastguard WorkerRUN: echo "%p/Inputs/split-dwarf-test 0x4005d4" >> %t.input
24*9880d681SAndroid Build Coastguard WorkerRUN: echo "%p/Inputs/split-dwarf-test 0x4005c4" >> %t.input
25*9880d681SAndroid Build Coastguard WorkerRUN: echo "%p/Inputs/cross-cu-inlining.x86_64-macho.o 0x17" >> %t.input
26*9880d681SAndroid Build Coastguard Worker
27*9880d681SAndroid Build Coastguard WorkerRUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \
28*9880d681SAndroid Build Coastguard WorkerRUN:    --default-arch=i386 < %t.input | FileCheck --check-prefix=CHECK --check-prefix=SPLIT --check-prefix=DWO %s
29*9880d681SAndroid Build Coastguard Worker
30*9880d681SAndroid Build Coastguard WorkerEnsure we get the same results in the absence of gmlt-like data in the executable but the presence of a .dwo file
31*9880d681SAndroid Build Coastguard Worker
32*9880d681SAndroid Build Coastguard WorkerRUN: echo "%p/Inputs/split-dwarf-test-nogmlt 0x4005d4" >> %t.input
33*9880d681SAndroid Build Coastguard WorkerRUN: echo "%p/Inputs/split-dwarf-test-nogmlt 0x4005c4" >> %t.input
34*9880d681SAndroid Build Coastguard WorkerRUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \
35*9880d681SAndroid Build Coastguard WorkerRUN:    --default-arch=i386 < %t.input | FileCheck --check-prefix=SPLIT --check-prefix=DWO %s
36*9880d681SAndroid Build Coastguard Worker
37*9880d681SAndroid Build Coastguard WorkerEnsure we get gmlt like results in the absence of a .dwo file but the presence of gmlt-like data in the executable
38*9880d681SAndroid Build Coastguard Worker
39*9880d681SAndroid Build Coastguard WorkerRUN: rm %T/split-dwarf-test.dwo
40*9880d681SAndroid Build Coastguard WorkerRUN: echo "%p/Inputs/split-dwarf-test 0x4005d4" >> %t.input
41*9880d681SAndroid Build Coastguard WorkerRUN: echo "%p/Inputs/split-dwarf-test 0x4005c4" >> %t.input
42*9880d681SAndroid Build Coastguard WorkerRUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \
43*9880d681SAndroid Build Coastguard WorkerRUN:    --default-arch=i386 < %t.input | FileCheck --check-prefix=SPLIT --check-prefix=NODWO %s
44*9880d681SAndroid Build Coastguard Worker
45*9880d681SAndroid Build Coastguard WorkerCHECK:       main
46*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
47*9880d681SAndroid Build Coastguard Worker
48*9880d681SAndroid Build Coastguard WorkerCHECK:       main
49*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
50*9880d681SAndroid Build Coastguard Worker
51*9880d681SAndroid Build Coastguard WorkerCHECK:      _start
52*9880d681SAndroid Build Coastguard Worker
53*9880d681SAndroid Build Coastguard WorkerCHECK: _Z1fii
54*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:11
55*9880d681SAndroid Build Coastguard Worker
56*9880d681SAndroid Build Coastguard WorkerCHECK: DummyClass
57*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:4
58*9880d681SAndroid Build Coastguard Worker
59*9880d681SAndroid Build Coastguard WorkerCHECK: a
60*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test2-helper.cc:2
61*9880d681SAndroid Build Coastguard Worker
62*9880d681SAndroid Build Coastguard WorkerCHECK: main
63*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test2-main.cc:4
64*9880d681SAndroid Build Coastguard Worker
65*9880d681SAndroid Build Coastguard WorkerCHECK:      _Z1cv
66*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test4-part1.cc:2
67*9880d681SAndroid Build Coastguard Worker
68*9880d681SAndroid Build Coastguard WorkerCHECK:      inlined_h
69*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: dwarfdump-inl-test.h:2
70*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: inlined_g
71*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: dwarfdump-inl-test.h:7
72*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: inlined_f
73*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: dwarfdump-inl-test.cc:3
74*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: main
75*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: dwarfdump-inl-test.cc:8
76*9880d681SAndroid Build Coastguard Worker
77*9880d681SAndroid Build Coastguard WorkerCHECK:      inlined_g
78*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: dwarfdump-inl-test.h:7
79*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: inlined_f
80*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: dwarfdump-inl-test.cc:3
81*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: main
82*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: dwarfdump-inl-test.cc:8
83*9880d681SAndroid Build Coastguard Worker
84*9880d681SAndroid Build Coastguard WorkerCHECK:      inlined_f
85*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: dwarfdump-inl-test.cc:3
86*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: main
87*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: dwarfdump-inl-test.cc:8
88*9880d681SAndroid Build Coastguard Worker
89*9880d681SAndroid Build Coastguard WorkerCHECK:      inlined_h
90*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: dwarfdump-inl-test.h:3
91*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: inlined_g
92*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: dwarfdump-inl-test.h:7
93*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: inlined_f
94*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: dwarfdump-inl-test.cc:3
95*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: main
96*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: dwarfdump-inl-test.cc:8
97*9880d681SAndroid Build Coastguard Worker
98*9880d681SAndroid Build Coastguard WorkerCHECK: C
99*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test3.cc:3
100*9880d681SAndroid Build Coastguard Worker
101*9880d681SAndroid Build Coastguard WorkerCHECK: _Z3do1v
102*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: /tmp/include{{[/\\]}}dwarfdump-test3-decl.h:7
103*9880d681SAndroid Build Coastguard Worker
104*9880d681SAndroid Build Coastguard WorkerCHECK: _Z3do2v
105*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: /tmp/dbginfo{{[/\\]}}include{{[/\\]}}dwarfdump-test3-decl2.h:1
106*9880d681SAndroid Build Coastguard Worker
107*9880d681SAndroid Build Coastguard WorkerCHECK:      main
108*9880d681SAndroid Build Coastguard WorkerCHECK:      _Z3inci
109*9880d681SAndroid Build Coastguard WorkerCHECK:      _Z3inci
110*9880d681SAndroid Build Coastguard Worker
111*9880d681SAndroid Build Coastguard WorkerCHECK: main
112*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: llvm-symbolizer-dwo-test.cc:11
113*9880d681SAndroid Build Coastguard Worker
114*9880d681SAndroid Build Coastguard WorkerCHECK: main
115*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: {{.*}}fission-ranges.cc:6
116*9880d681SAndroid Build Coastguard Worker
117*9880d681SAndroid Build Coastguard WorkerCHECK: _ZN1S3bazEv
118*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: {{.*}}arange-overlap.cc:6
119*9880d681SAndroid Build Coastguard Worker
120*9880d681SAndroid Build Coastguard WorkerDWO: _Z2f2v
121*9880d681SAndroid Build Coastguard WorkerNODWO: {{^f2$}}
122*9880d681SAndroid Build Coastguard WorkerSPLIT-NEXT: {{.*}}split-dwarf-test.cc
123*9880d681SAndroid Build Coastguard WorkerSPLIT-NEXT: main
124*9880d681SAndroid Build Coastguard WorkerSPLIT-NEXT: {{.*}}split-dwarf-test.cc
125*9880d681SAndroid Build Coastguard Worker
126*9880d681SAndroid Build Coastguard WorkerSPLIT: _Z2f1v
127*9880d681SAndroid Build Coastguard WorkerSPLIT-NEXT: {{.*}}split-dwarf-test.cc
128*9880d681SAndroid Build Coastguard Worker
129*9880d681SAndroid Build Coastguard Worker; func has been inlined into main by LTO. Check that the symbolizer is able
130*9880d681SAndroid Build Coastguard Worker; to resolve the cross-cu reference and retrieve func's name
131*9880d681SAndroid Build Coastguard WorkerCHECK: func
132*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: /tmp{{[/\\]}}cross-cu-inlining.c:16:3
133*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: main
134*9880d681SAndroid Build Coastguard WorkerCHECK-NEXT: /tmp{{[/\\]}}cross-cu-inlining.c:11:0
135*9880d681SAndroid Build Coastguard Worker
136*9880d681SAndroid Build Coastguard WorkerRUN: echo "unexisting-file 0x1234" > %t.input2
137*9880d681SAndroid Build Coastguard WorkerRUN: llvm-symbolizer < %t.input2 2>&1 | FileCheck %s --check-prefix=MISSING-FILE
138*9880d681SAndroid Build Coastguard Worker
139*9880d681SAndroid Build Coastguard WorkerMISSING-FILE: LLVMSymbolizer: error reading file: {{[Nn]}}o such file or directory
140*9880d681SAndroid Build Coastguard Worker
141*9880d681SAndroid Build Coastguard WorkerRUN: echo "%p/Inputs/macho-universal 0x1f84" > %t.input3
142*9880d681SAndroid Build Coastguard WorkerRUN: llvm-symbolizer < %t.input3 | FileCheck %s --check-prefix=UNKNOWN-ARCH
143*9880d681SAndroid Build Coastguard Worker
144*9880d681SAndroid Build Coastguard WorkerUNKNOWN-ARCH-NOT: main
145*9880d681SAndroid Build Coastguard WorkerUNKNOWN-ARCH: ??
146*9880d681SAndroid Build Coastguard WorkerUNKNOWN-ARCH-NOT: main
147*9880d681SAndroid Build Coastguard Worker
148*9880d681SAndroid Build Coastguard WorkerRUN: echo "0x400559" > %t.input4
149*9880d681SAndroid Build Coastguard WorkerRUN: echo "0x400436" >> %t.input4
150*9880d681SAndroid Build Coastguard WorkerRUN: llvm-symbolizer --obj %p/Inputs/dwarfdump-test.elf-x86-64 < %t.input4 \
151*9880d681SAndroid Build Coastguard WorkerRUN:   | FileCheck %s --check-prefix=BINARY
152*9880d681SAndroid Build Coastguard Worker
153*9880d681SAndroid Build Coastguard WorkerBINARY:       main
154*9880d681SAndroid Build Coastguard WorkerBINARY-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
155*9880d681SAndroid Build Coastguard WorkerBINARY:      _start
156*9880d681SAndroid Build Coastguard Worker
157*9880d681SAndroid Build Coastguard WorkerRUN: echo "0x400720" > %t.input5
158*9880d681SAndroid Build Coastguard WorkerRUN: echo "0x4004a0" >> %t.input5
159*9880d681SAndroid Build Coastguard WorkerRUN: echo "0x4006f0" >> %t.input5
160*9880d681SAndroid Build Coastguard WorkerRUN: llvm-symbolizer --obj %p/Inputs/llvm-symbolizer-test.elf-x86-64 < %t.input5 \
161*9880d681SAndroid Build Coastguard WorkerRUN:   | FileCheck %s --check-prefix=BINARY_C
162*9880d681SAndroid Build Coastguard Worker
163*9880d681SAndroid Build Coastguard WorkerBINARY_C:       main
164*9880d681SAndroid Build Coastguard WorkerBINARY_C-NEXT: /tmp/dbginfo{{[/\\]}}llvm-symbolizer-test.c:10
165*9880d681SAndroid Build Coastguard WorkerBINARY_C:      _start
166*9880d681SAndroid Build Coastguard WorkerBINARY_C:      {{g$}}
167*9880d681SAndroid Build Coastguard Worker
168*9880d681SAndroid Build Coastguard WorkerRUN: echo "0x1f1" > %t.input6
169*9880d681SAndroid Build Coastguard WorkerRUN: llvm-symbolizer --obj %p/Inputs/shared-object-stripped.elf-i386 < %t.input6 \
170*9880d681SAndroid Build Coastguard WorkerRUN:   | FileCheck %s --check-prefix=STRIPPED
171*9880d681SAndroid Build Coastguard Worker
172*9880d681SAndroid Build Coastguard WorkerSTRIPPED:  global_func
173*9880d681SAndroid Build Coastguard Worker
174*9880d681SAndroid Build Coastguard WorkerRUN: echo "%p/Inputs/dwarfdump-test4.elf-x86-64 0x62c" > %t.input7
175*9880d681SAndroid Build Coastguard WorkerRUN: llvm-symbolizer --functions=short --demangle=false < %t.input7 \
176*9880d681SAndroid Build Coastguard WorkerRUN:    | FileCheck %s --check-prefix=SHORT_FUNCTION_NAME
177*9880d681SAndroid Build Coastguard Worker
178*9880d681SAndroid Build Coastguard WorkerSHORT_FUNCTION_NAME-NOT: _Z1cv
179