1 RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x400559" > %t.input
2 RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64.debuglink 0x400559" >> %t.input
3 RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x400436" >> %t.input
4 RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x400528" >> %t.input
5 RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x400586" >> %t.input
6 RUN: echo "%p/Inputs/dwarfdump-test2.elf-x86-64 0x4004e8" >> %t.input
7 RUN: echo "%p/Inputs/dwarfdump-test2.elf-x86-64 0x4004f4" >> %t.input
8 RUN: echo "%p/Inputs/dwarfdump-test4.elf-x86-64 0x62c" >> %t.input
9 RUN: echo "%p/Inputs/dwarfdump-inl-test.elf-x86-64 0x8dc" >> %t.input
10 RUN: echo "%p/Inputs/dwarfdump-inl-test.elf-x86-64 0xa05" >> %t.input
11 RUN: echo "%p/Inputs/dwarfdump-inl-test.elf-x86-64 0x987" >> %t.input
12 RUN: echo "%p/Inputs/dwarfdump-inl-test.high_pc.elf-x86-64 0x568" >> %t.input
13 RUN: cp "%p/Inputs/dwarfdump-test3.elf-x86-64-space" "%T/dwarfdump-test3.elf-x86-64 space"
14 RUN: echo "\"%T/dwarfdump-test3.elf-x86-64 space\" 0x640" >> %t.input
15 RUN: echo "\"%T/dwarfdump-test3.elf-x86-64 space\" 0x633" >> %t.input
16 RUN: echo "\"%T/dwarfdump-test3.elf-x86-64 space\" 0x62d" >> %t.input
17 RUN: echo "%p/Inputs/macho-universal 0x1f84" >> %t.input
18 RUN: echo "%p/Inputs/macho-universal:i386 0x1f67" >> %t.input
19 RUN: echo "%p/Inputs/macho-universal:x86_64 0x100000f05" >> %t.input
20 RUN: echo "%p/Inputs/llvm-symbolizer-dwo-test 0x400514" >> %t.input
21 RUN: echo "%p/Inputs/fission-ranges.elf-x86_64 0x720" >> %t.input
22 RUN: echo "%p/Inputs/arange-overlap.elf-x86_64 0x714" >> %t.input
23 RUN: cp %p/Inputs/split-dwarf-test.dwo %T
24 RUN: echo "%p/Inputs/split-dwarf-test 0x4005d4" >> %t.input
25 RUN: echo "%p/Inputs/split-dwarf-test 0x4005c4" >> %t.input
26 RUN: echo "%p/Inputs/cross-cu-inlining.x86_64-macho.o 0x17" >> %t.input
27 RUN: cp %p/Inputs/split-dwarf-multiple-cu.dwo %T
28 RUN: echo "%p/Inputs/split-dwarf-multiple-cu.o 0x4" >> %t.input
29 RUN: cp %p/Inputs/split-dwarf-addr-object-relocation.dwo %T
30 RUN: echo "%p/Inputs/split-dwarf-addr-object-relocation.o 0x14" >> %t.input
31 RUN: cp %p/Inputs/split-dwarf-dwp.o %T
32 RUN: cp %p/Inputs/split-dwarf-dwp.o.dwp %T
33 RUN: echo "%T/split-dwarf-dwp.o 0x4" >> %t.input
35 RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \
36 RUN: --default-arch=i386 < %t.input | FileCheck --check-prefix=CHECK --check-prefix=SPLIT --check-prefix=DWO %s
38 Ensure we get the same results in the absence of gmlt-like data in the executable but the presence of a .dwo file
40 RUN: echo "%p/Inputs/split-dwarf-test-nogmlt 0x4005d4" >> %t.input
41 RUN: echo "%p/Inputs/split-dwarf-test-nogmlt 0x4005c4" >> %t.input
42 RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \
43 RUN: --default-arch=i386 < %t.input | FileCheck --check-prefix=SPLIT --check-prefix=DWO %s
45 Ensure we get gmlt like results in the absence of a .dwo file but the presence of gmlt-like data in the executable
47 RUN: rm %T/split-dwarf-test.dwo
48 RUN: echo "%p/Inputs/split-dwarf-test 0x4005d4" >> %t.input
49 RUN: echo "%p/Inputs/split-dwarf-test 0x4005c4" >> %t.input
50 RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \
51 RUN: --default-arch=i386 < %t.input | FileCheck --check-prefix=SPLIT --check-prefix=NODWO %s
53 RUN: cp %p/Inputs/split-dwarf-dwp.o %T/split-dwarf-dwp-different-name.o
54 RUN: echo "%T/split-dwarf-dwp-different-name.o 0x4" > %t.input
55 RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \
56 RUN: --default-arch=i386 --dwp=%p/Inputs/split-dwarf-dwp.o.dwp < %t.input | FileCheck --check-prefix=DWP %s
59 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
62 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
67 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:11
70 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:4
73 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test2-helper.cc:2
76 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test2-main.cc:4
79 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test4-part1.cc:2
82 CHECK-NEXT: dwarfdump-inl-test.h:2
84 CHECK-NEXT: dwarfdump-inl-test.h:7
86 CHECK-NEXT: dwarfdump-inl-test.cc:3
88 CHECK-NEXT: dwarfdump-inl-test.cc:8
91 CHECK-NEXT: dwarfdump-inl-test.h:7
93 CHECK-NEXT: dwarfdump-inl-test.cc:3
95 CHECK-NEXT: dwarfdump-inl-test.cc:8
98 CHECK-NEXT: dwarfdump-inl-test.cc:3
100 CHECK-NEXT: dwarfdump-inl-test.cc:8
103 CHECK-NEXT: dwarfdump-inl-test.h:3
104 CHECK-NEXT: inlined_g
105 CHECK-NEXT: dwarfdump-inl-test.h:7
106 CHECK-NEXT: inlined_f
107 CHECK-NEXT: dwarfdump-inl-test.cc:3
109 CHECK-NEXT: dwarfdump-inl-test.cc:8
112 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test3.cc:3
115 CHECK-NEXT: /tmp/include{{[/\\]}}dwarfdump-test3-decl.h:7
118 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}include{{[/\\]}}dwarfdump-test3-decl2.h:1
125 CHECK-NEXT: llvm-symbolizer-dwo-test.cc:11
128 CHECK-NEXT: {{.*}}fission-ranges.cc:6
131 CHECK-NEXT: {{.*}}arange-overlap.cc:6
135 SPLIT-NEXT: {{.*}}split-dwarf-test.cc
137 SPLIT-NEXT: {{.*}}split-dwarf-test.cc
140 SPLIT-NEXT: {{.*}}split-dwarf-test.cc
142 ; func has been inlined into main by LTO. Check that the symbolizer is able
143 ; to resolve the cross-cu reference and retrieve func's name
145 CHECK-NEXT: /tmp{{[/\\]}}cross-cu-inlining.c:16:3
147 CHECK-NEXT: /tmp{{[/\\]}}cross-cu-inlining.c:11:0
150 CHECK-NEXT: b.cpp:3:3
152 CHECK-NEXT: b.cpp:6:0
155 CHECK-NEXT: split-dwarf-addr-object-relocation.cpp:3:3
157 CHECK-NEXT: split-dwarf-addr-object-relocation.cpp:6:0
160 DWP-NEXT: split-dwarf-dwp.cpp:3:3
162 DWP-NEXT: split-dwarf-dwp.cpp:6:0
164 RUN: echo "unexisting-file 0x1234" > %t.input2
165 RUN: llvm-symbolizer < %t.input2 2>&1 | FileCheck %s --check-prefix=MISSING-FILE
167 MISSING-FILE: LLVMSymbolizer: error reading file: {{[Nn]}}o such file or directory
169 RUN: echo "%p/Inputs/macho-universal 0x1f84" > %t.input3
170 RUN: llvm-symbolizer < %t.input3 | FileCheck %s --check-prefix=UNKNOWN-ARCH
172 UNKNOWN-ARCH-NOT: main
174 UNKNOWN-ARCH-NOT: main
176 RUN: echo "0x400559" > %t.input4
177 RUN: echo "0x400436" >> %t.input4
178 RUN: llvm-symbolizer --obj %p/Inputs/dwarfdump-test.elf-x86-64 < %t.input4 \
179 RUN: | FileCheck %s --check-prefix=BINARY
182 BINARY-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
185 RUN: echo "0x400720" > %t.input5
186 RUN: echo "0x4004a0" >> %t.input5
187 RUN: echo "0x4006f0" >> %t.input5
188 RUN: llvm-symbolizer --obj %p/Inputs/llvm-symbolizer-test.elf-x86-64 < %t.input5 \
189 RUN: | FileCheck %s --check-prefix=BINARY_C
192 BINARY_C-NEXT: /tmp/dbginfo{{[/\\]}}llvm-symbolizer-test.c:10
196 RUN: echo "0x1f1" > %t.input6
197 RUN: llvm-symbolizer --obj %p/Inputs/shared-object-stripped.elf-i386 < %t.input6 \
198 RUN: | FileCheck %s --check-prefix=STRIPPED
200 STRIPPED: global_func
202 RUN: echo "%p/Inputs/dwarfdump-test4.elf-x86-64 0x62c" > %t.input7
203 RUN: llvm-symbolizer --functions=short --demangle=false < %t.input7 \
204 RUN: | FileCheck %s --check-prefix=SHORT_FUNCTION_NAME
206 SHORT_FUNCTION_NAME-NOT: _Z1cv