6d51fe96c48e53f7bb7807d7b2805614b2750abc
[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-test4.elf-x86-64 0x62c" >> %t.input
5 RUN: echo "%p/Inputs/dwarfdump-inl-test.elf-x86-64 0x710" >> %t.input
6 RUN: echo "%p/Inputs/dwarfdump-inl-test.high_pc.elf-x86-64 0x568" >> %t.input
7 RUN: echo "\"%p/Inputs/dwarfdump-test3.elf-x86-64 space\" 0x633" >> %t.input
8 RUN: echo "%p/Inputs/macho-universal 0x1f84" >> %t.input
9 RUN: echo "%p/Inputs/macho-universal:i386 0x1f67" >> %t.input
10 RUN: echo "%p/Inputs/macho-universal:x86_64 0x100000f05" >> %t.input
11 RUN: echo "%p/Inputs/llvm-symbolizer-dwo-test 0x400514" >> %t.input
12
13 RUN: llvm-symbolizer --functions --inlining --demangle=false \
14 RUN:    --default-arch=i386 < %t.input | FileCheck %s
15
16 CHECK:       main
17 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
18
19 CHECK:       main
20 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
21
22 CHECK:      _start
23
24 CHECK:      _Z1cv
25 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test4-part1.cc:2
26
27 CHECK:      inlined_h
28 CHECK-NEXT: dwarfdump-inl-test.h:2
29 CHECK-NEXT: inlined_g
30 CHECK-NEXT: dwarfdump-inl-test.h:7
31 CHECK-NEXT: inlined_f
32 CHECK-NEXT: dwarfdump-inl-test.cc:3
33 CHECK-NEXT: main
34 CHECK-NEXT: dwarfdump-inl-test.cc:
35
36 CHECK:      inlined_h
37 CHECK-NEXT: dwarfdump-inl-test.h:3
38 CHECK-NEXT: inlined_g
39 CHECK-NEXT: dwarfdump-inl-test.h:7
40 CHECK-NEXT: inlined_f
41 CHECK-NEXT: dwarfdump-inl-test.cc:3
42 CHECK-NEXT: main
43 CHECK-NEXT: dwarfdump-inl-test.cc:
44
45 CHECK:       _Z3do1v
46 CHECK-NEXT: dwarfdump-test3-decl.h:7
47
48 CHECK:      main
49 CHECK:      _Z3inci
50 CHECK:      _Z3inci
51
52 CHECK: main
53 CHECK-NEXT: llvm-symbolizer-dwo-test.cc:11
54
55 RUN: echo "unexisting-file 0x1234" > %t.input2
56 RUN: llvm-symbolizer < %t.input2
57
58 RUN: echo "%p/Inputs/macho-universal 0x1f84" > %t.input3
59 RUN: llvm-symbolizer < %t.input3 | FileCheck %s --check-prefix=UNKNOWN-ARCH
60
61 UNKNOWN-ARCH-NOT: main
62 UNKNOWN-ARCH: ??
63 UNKNOWN-ARCH-NOT: main
64
65 RUN: echo "0x400559" > %t.input4
66 RUN: echo "0x400436" >> %t.input4
67 RUN: llvm-symbolizer --obj %p/Inputs/dwarfdump-test.elf-x86-64 < %t.input4 \
68 RUN:   | FileCheck %s --check-prefix=BINARY
69
70 BINARY:       main
71 BINARY-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
72 BINARY:      _start
73
74 RUN: echo "0x400720" > %t.input5
75 RUN: echo "0x4004a0" >> %t.input5
76 RUN: echo "0x4006f0" >> %t.input5
77 RUN: llvm-symbolizer --obj %p/Inputs/llvm-symbolizer-test.elf-x86-64 < %t.input5 \
78 RUN:   | FileCheck %s --check-prefix=BINARY_C
79
80 BINARY_C:       main
81 BINARY_C-NEXT: /tmp/dbginfo{{[/\\]}}llvm-symbolizer-test.c:10
82 BINARY_C:      _start
83 BINARY_C:      {{g$}}
84
85 RUN: echo "0x1f1" > %t.input6
86 RUN: llvm-symbolizer --obj %p/Inputs/shared-object-stripped.elf-i386 < %t.input6 \
87 RUN:   | FileCheck %s --check-prefix=STRIPPED
88
89 STRIPPED:  global_func