DebugInfo: Do not use DW_FORM_GNU_addr_index in skeleton CUs, GDB 7.8 errors on this.
[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 0x710" >> %t.input
10 RUN: echo "%p/Inputs/dwarfdump-inl-test.elf-x86-64 0x7d1" >> %t.input
11 RUN: echo "%p/Inputs/dwarfdump-inl-test.elf-x86-64 0x785" >> %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
26 RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \
27 RUN:    --default-arch=i386 < %t.input | FileCheck %s
28
29 REQUIRES: shell
30
31 CHECK:       main
32 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
33
34 CHECK:       main
35 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
36
37 CHECK:      _start
38
39 CHECK: _Z1fii
40 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:11
41
42 CHECK: DummyClass
43 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:4
44
45 CHECK: a
46 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test2-helper.cc:2
47
48 CHECK: main
49 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test2-main.cc:4
50
51 CHECK:      _Z1cv
52 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test4-part1.cc:2
53
54 CHECK:      inlined_h
55 CHECK-NEXT: dwarfdump-inl-test.h:2
56 CHECK-NEXT: inlined_g
57 CHECK-NEXT: dwarfdump-inl-test.h:7
58 CHECK-NEXT: inlined_f
59 CHECK-NEXT: dwarfdump-inl-test.cc:3
60 CHECK-NEXT: main
61 CHECK-NEXT: dwarfdump-inl-test.cc:8
62
63 CHECK:      inlined_g
64 CHECK-NEXT: dwarfdump-inl-test.h:7
65 CHECK-NEXT: inlined_f
66 CHECK-NEXT: dwarfdump-inl-test.cc:3
67 CHECK-NEXT: main
68 CHECK-NEXT: dwarfdump-inl-test.cc:8
69
70 CHECK:      inlined_f
71 CHECK-NEXT: dwarfdump-inl-test.cc:3
72 CHECK-NEXT: main
73 CHECK-NEXT: dwarfdump-inl-test.cc:8
74
75 CHECK:      inlined_h
76 CHECK-NEXT: dwarfdump-inl-test.h:3
77 CHECK-NEXT: inlined_g
78 CHECK-NEXT: dwarfdump-inl-test.h:7
79 CHECK-NEXT: inlined_f
80 CHECK-NEXT: dwarfdump-inl-test.cc:3
81 CHECK-NEXT: main
82 CHECK-NEXT: dwarfdump-inl-test.cc:8
83
84 CHECK: C
85 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test3.cc:3
86
87 CHECK: _Z3do1v
88 CHECK-NEXT: /tmp/include{{[/\\]}}dwarfdump-test3-decl.h:7
89
90 CHECK: _Z3do2v
91 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}include{{[/\\]}}dwarfdump-test3-decl2.h:1
92
93 CHECK:      main
94 CHECK:      _Z3inci
95 CHECK:      _Z3inci
96
97 CHECK: main
98 CHECK-NEXT: llvm-symbolizer-dwo-test.cc:11
99
100 CHECK: main
101 CHECK-NEXT: {{.*}}fission-ranges.cc:6
102
103 CHECK: _ZN1S3bazEv
104 CHECK-NEXT: {{.*}}arange-overlap.cc:6
105
106 CHECK: _Z3fooi
107 CHECK-NEXT: {{.*}}split-dwarf-test.cc
108 CHECK-NEXT: main
109 CHECK-NEXT: {{.*}}split-dwarf-test.cc
110
111 CHECK: _Z3fooi
112 CHECK-NEXT: {{.*}}split-dwarf-test.cc
113
114 RUN: echo "unexisting-file 0x1234" > %t.input2
115 RUN: llvm-symbolizer < %t.input2
116
117 RUN: echo "%p/Inputs/macho-universal 0x1f84" > %t.input3
118 RUN: llvm-symbolizer < %t.input3 | FileCheck %s --check-prefix=UNKNOWN-ARCH
119
120 UNKNOWN-ARCH-NOT: main
121 UNKNOWN-ARCH: ??
122 UNKNOWN-ARCH-NOT: main
123
124 RUN: echo "0x400559" > %t.input4
125 RUN: echo "0x400436" >> %t.input4
126 RUN: llvm-symbolizer --obj %p/Inputs/dwarfdump-test.elf-x86-64 < %t.input4 \
127 RUN:   | FileCheck %s --check-prefix=BINARY
128
129 BINARY:       main
130 BINARY-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
131 BINARY:      _start
132
133 RUN: echo "0x400720" > %t.input5
134 RUN: echo "0x4004a0" >> %t.input5
135 RUN: echo "0x4006f0" >> %t.input5
136 RUN: llvm-symbolizer --obj %p/Inputs/llvm-symbolizer-test.elf-x86-64 < %t.input5 \
137 RUN:   | FileCheck %s --check-prefix=BINARY_C
138
139 BINARY_C:       main
140 BINARY_C-NEXT: /tmp/dbginfo{{[/\\]}}llvm-symbolizer-test.c:10
141 BINARY_C:      _start
142 BINARY_C:      {{g$}}
143
144 RUN: echo "0x1f1" > %t.input6
145 RUN: llvm-symbolizer --obj %p/Inputs/shared-object-stripped.elf-i386 < %t.input6 \
146 RUN:   | FileCheck %s --check-prefix=STRIPPED
147
148 STRIPPED:  global_func
149
150 RUN: echo "%p/Inputs/dwarfdump-test4.elf-x86-64 0x62c" > %t.input7
151 RUN: llvm-symbolizer --functions=short --use-symbol-table=false --demangle=false < %t.input7 \
152 RUN:    | FileCheck %s --check-prefix=SHORT_FUNCTION_NAME
153
154 SHORT_FUNCTION_NAME-NOT: _Z1cv