[WinEH] Avoid infinite loop in BranchFolding for multiple single block funclets
[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 CHECK:       main
31 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
32
33 CHECK:       main
34 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
35
36 CHECK:      _start
37
38 CHECK: _Z1fii
39 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:11
40
41 CHECK: DummyClass
42 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:4
43
44 CHECK: a
45 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test2-helper.cc:2
46
47 CHECK: main
48 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test2-main.cc:4
49
50 CHECK:      _Z1cv
51 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test4-part1.cc:2
52
53 CHECK:      inlined_h
54 CHECK-NEXT: dwarfdump-inl-test.h:2
55 CHECK-NEXT: inlined_g
56 CHECK-NEXT: dwarfdump-inl-test.h:7
57 CHECK-NEXT: inlined_f
58 CHECK-NEXT: dwarfdump-inl-test.cc:3
59 CHECK-NEXT: main
60 CHECK-NEXT: dwarfdump-inl-test.cc:8
61
62 CHECK:      inlined_g
63 CHECK-NEXT: dwarfdump-inl-test.h:7
64 CHECK-NEXT: inlined_f
65 CHECK-NEXT: dwarfdump-inl-test.cc:3
66 CHECK-NEXT: main
67 CHECK-NEXT: dwarfdump-inl-test.cc:8
68
69 CHECK:      inlined_f
70 CHECK-NEXT: dwarfdump-inl-test.cc:3
71 CHECK-NEXT: main
72 CHECK-NEXT: dwarfdump-inl-test.cc:8
73
74 CHECK:      inlined_h
75 CHECK-NEXT: dwarfdump-inl-test.h:3
76 CHECK-NEXT: inlined_g
77 CHECK-NEXT: dwarfdump-inl-test.h:7
78 CHECK-NEXT: inlined_f
79 CHECK-NEXT: dwarfdump-inl-test.cc:3
80 CHECK-NEXT: main
81 CHECK-NEXT: dwarfdump-inl-test.cc:8
82
83 CHECK: C
84 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test3.cc:3
85
86 CHECK: _Z3do1v
87 CHECK-NEXT: /tmp/include{{[/\\]}}dwarfdump-test3-decl.h:7
88
89 CHECK: _Z3do2v
90 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}include{{[/\\]}}dwarfdump-test3-decl2.h:1
91
92 CHECK:      main
93 CHECK:      _Z3inci
94 CHECK:      _Z3inci
95
96 CHECK: main
97 CHECK-NEXT: llvm-symbolizer-dwo-test.cc:11
98
99 CHECK: main
100 CHECK-NEXT: {{.*}}fission-ranges.cc:6
101
102 CHECK: _ZN1S3bazEv
103 CHECK-NEXT: {{.*}}arange-overlap.cc:6
104
105 CHECK: _Z3fooi
106 CHECK-NEXT: {{.*}}split-dwarf-test.cc
107 CHECK-NEXT: main
108 CHECK-NEXT: {{.*}}split-dwarf-test.cc
109
110 CHECK: _Z3fooi
111 CHECK-NEXT: {{.*}}split-dwarf-test.cc
112
113 ; func has been inlined into main by LTO. Check that the symbolizer is able
114 ; to resolve the cross-cu reference and retrieve func's name
115 CHECK: func
116 CHECK-NEXT: /tmp{{[/\\]}}cross-cu-inlining.c:16:3
117 CHECK-NEXT: main
118 CHECK-NEXT: /tmp{{[/\\]}}cross-cu-inlining.c:11:0
119
120 RUN: echo "unexisting-file 0x1234" > %t.input2
121 RUN: llvm-symbolizer < %t.input2 2>&1 | FileCheck %s --check-prefix=MISSING-FILE
122
123 MISSING-FILE: LLVMSymbolizer: error reading file: {{[Nn]}}o such file or directory
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 --demangle=false < %t.input7 \
160 RUN:    | FileCheck %s --check-prefix=SHORT_FUNCTION_NAME
161
162 SHORT_FUNCTION_NAME-NOT: _Z1cv