Fix a small typo in the test comment
[oota-llvm.git] / test / DebugInfo / llvm-symbolizer.test
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: echo "\"%p/Inputs/dwarfdump-test3.elf-x86-64 space\" 0x640" >> %t.input
14 RUN: echo "\"%p/Inputs/dwarfdump-test3.elf-x86-64 space\" 0x633" >> %t.input
15 RUN: echo "\"%p/Inputs/dwarfdump-test3.elf-x86-64 space\" 0x62d" >> %t.input
16 RUN: echo "%p/Inputs/macho-universal 0x1f84" >> %t.input
17 RUN: echo "%p/Inputs/macho-universal:i386 0x1f67" >> %t.input
18 RUN: echo "%p/Inputs/macho-universal:x86_64 0x100000f05" >> %t.input
19 RUN: echo "%p/Inputs/llvm-symbolizer-dwo-test 0x400514" >> %t.input
20 RUN: echo "%p/Inputs/fission-ranges.elf-x86_64 0x720" >> %t.input
21 RUN: echo "%p/Inputs/arange-overlap.elf-x86_64 0x714" >> %t.input
22 RUN: cp %p/Inputs/split-dwarf-test.dwo %T
23 RUN: echo "%p/Inputs/split-dwarf-test 0x4004d0" >> %t.input
24 RUN: echo "%p/Inputs/split-dwarf-test 0x4004c0" >> %t.input
25 RUN: echo "%p/Inputs/cross-cu-inlining.x86_64-macho.o 0x17" >> %t.input
26
27 RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \
28 RUN:    --default-arch=i386 < %t.input | FileCheck %s
29
30 REQUIRES: shell
31
32 CHECK:       main
33 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
34
35 CHECK:       main
36 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
37
38 CHECK:      _start
39
40 CHECK: _Z1fii
41 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:11
42
43 CHECK: DummyClass
44 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:4
45
46 CHECK: a
47 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test2-helper.cc:2
48
49 CHECK: main
50 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test2-main.cc:4
51
52 CHECK:      _Z1cv
53 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test4-part1.cc:2
54
55 CHECK:      inlined_h
56 CHECK-NEXT: dwarfdump-inl-test.h:2
57 CHECK-NEXT: inlined_g
58 CHECK-NEXT: dwarfdump-inl-test.h:7
59 CHECK-NEXT: inlined_f
60 CHECK-NEXT: dwarfdump-inl-test.cc:3
61 CHECK-NEXT: main
62 CHECK-NEXT: dwarfdump-inl-test.cc:8
63
64 CHECK:      inlined_g
65 CHECK-NEXT: dwarfdump-inl-test.h:7
66 CHECK-NEXT: inlined_f
67 CHECK-NEXT: dwarfdump-inl-test.cc:3
68 CHECK-NEXT: main
69 CHECK-NEXT: dwarfdump-inl-test.cc:8
70
71 CHECK:      inlined_f
72 CHECK-NEXT: dwarfdump-inl-test.cc:3
73 CHECK-NEXT: main
74 CHECK-NEXT: dwarfdump-inl-test.cc:8
75
76 CHECK:      inlined_h
77 CHECK-NEXT: dwarfdump-inl-test.h:3
78 CHECK-NEXT: inlined_g
79 CHECK-NEXT: dwarfdump-inl-test.h:7
80 CHECK-NEXT: inlined_f
81 CHECK-NEXT: dwarfdump-inl-test.cc:3
82 CHECK-NEXT: main
83 CHECK-NEXT: dwarfdump-inl-test.cc:8
84
85 CHECK: C
86 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test3.cc:3
87
88 CHECK: _Z3do1v
89 CHECK-NEXT: /tmp/include{{[/\\]}}dwarfdump-test3-decl.h:7
90
91 CHECK: _Z3do2v
92 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}include{{[/\\]}}dwarfdump-test3-decl2.h:1
93
94 CHECK:      main
95 CHECK:      _Z3inci
96 CHECK:      _Z3inci
97
98 CHECK: main
99 CHECK-NEXT: llvm-symbolizer-dwo-test.cc:11
100
101 CHECK: main
102 CHECK-NEXT: {{.*}}fission-ranges.cc:6
103
104 CHECK: _ZN1S3bazEv
105 CHECK-NEXT: {{.*}}arange-overlap.cc:6
106
107 CHECK: _Z3fooi
108 CHECK-NEXT: {{.*}}split-dwarf-test.cc
109 CHECK-NEXT: main
110 CHECK-NEXT: {{.*}}split-dwarf-test.cc
111
112 CHECK: _Z3fooi
113 CHECK-NEXT: {{.*}}split-dwarf-test.cc
114
115 ; func has been inlined into main by LTO. Check that the symbolizer is able
116 ; to resolve the cross-cu reference and retrieve func's name
117 CHECK: func
118 CHECK-NEXT: /tmp{{[/\\]}}cross-cu-inlining.c:16:3
119 CHECK-NEXT: main
120 CHECK-NEXT: /tmp{{[/\\]}}cross-cu-inlining.c:11:0
121
122 RUN: echo "unexisting-file 0x1234" > %t.input2
123 RUN: llvm-symbolizer < %t.input2
124
125 RUN: echo "%p/Inputs/macho-universal 0x1f84" > %t.input3
126 RUN: llvm-symbolizer < %t.input3 | FileCheck %s --check-prefix=UNKNOWN-ARCH
127
128 UNKNOWN-ARCH-NOT: main
129 UNKNOWN-ARCH: ??
130 UNKNOWN-ARCH-NOT: main
131
132 RUN: echo "0x400559" > %t.input4
133 RUN: echo "0x400436" >> %t.input4
134 RUN: llvm-symbolizer --obj %p/Inputs/dwarfdump-test.elf-x86-64 < %t.input4 \
135 RUN:   | FileCheck %s --check-prefix=BINARY
136
137 BINARY:       main
138 BINARY-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
139 BINARY:      _start
140
141 RUN: echo "0x400720" > %t.input5
142 RUN: echo "0x4004a0" >> %t.input5
143 RUN: echo "0x4006f0" >> %t.input5
144 RUN: llvm-symbolizer --obj %p/Inputs/llvm-symbolizer-test.elf-x86-64 < %t.input5 \
145 RUN:   | FileCheck %s --check-prefix=BINARY_C
146
147 BINARY_C:       main
148 BINARY_C-NEXT: /tmp/dbginfo{{[/\\]}}llvm-symbolizer-test.c:10
149 BINARY_C:      _start
150 BINARY_C:      {{g$}}
151
152 RUN: echo "0x1f1" > %t.input6
153 RUN: llvm-symbolizer --obj %p/Inputs/shared-object-stripped.elf-i386 < %t.input6 \
154 RUN:   | FileCheck %s --check-prefix=STRIPPED
155
156 STRIPPED:  global_func
157
158 RUN: echo "%p/Inputs/dwarfdump-test4.elf-x86-64 0x62c" > %t.input7
159 RUN: llvm-symbolizer --functions=short --use-symbol-table=false --demangle=false < %t.input7 \
160 RUN:    | FileCheck %s --check-prefix=SHORT_FUNCTION_NAME
161
162 SHORT_FUNCTION_NAME-NOT: _Z1cv