Skip to content

Commit b10f112

Browse files
committed
[llvm-symbolizer][test] Extract tests from llvm-symbolizer.test and simplify (#1)
This is the second of a series of patches simplifying llvm-symbolizer tests. See r352752 for the first. This one splits out 5 distinct test cases from llvm-symbolizer.test into separate tests, and simplifies them slightly by using --obj/positional arguments for the input file and addresses instead of stdin. See https://bugs.llvm.org/show_bug.cgi?id=40070#c1 for the motivation. Reviewed by: dblaikie Differential Revision: https://reviews.llvm.org/D57443 llvm-svn: 352753
1 parent ca8f3cb commit b10f112

6 files changed

+31
-33
lines changed
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
RUN: llvm-symbolizer --no-demangle --obj=%p/Inputs/arange-overlap.elf-x86_64 0x714 | FileCheck %s
2+
3+
CHECK: _ZN1S3bazEv
4+
CHECK-NEXT: {{.*}}arange-overlap.cc:6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
RUN: llvm-symbolizer --obj=%p/Inputs/cross-cu-inlining.x86_64-macho.o 0x17 | FileCheck %s
2+
3+
; func has been inlined into main by LTO. Check that the symbolizer is able
4+
; to resolve the cross-cu reference and retrieve func's name
5+
CHECK: func
6+
CHECK-NEXT: /tmp{{[/\\]}}cross-cu-inlining.c:16:3
7+
CHECK-NEXT: main
8+
CHECK-NEXT: /tmp{{[/\\]}}cross-cu-inlining.c:11:0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
RUN: llvm-symbolizer --no-demangle --obj=%p/Inputs/llvm-symbolizer-local-mem-func-gcc.elf-x86-64 0x61a | FileCheck %s
2+
3+
CHECK-NOT: local_mem_func
4+
CHECK: _ZZ2f1vEN3foo14local_mem_funcEv
5+
CHECK-NEXT: {{.*}}local-mem-func.cpp:3:0
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
RUN: llvm-symbolizer --inlining --obj=%p/Inputs/dwarfdump-inl-test.high_pc.elf-x86-64 0x568 | FileCheck %s
2+
3+
CHECK: inlined_h
4+
CHECK-NEXT: dwarfdump-inl-test.h:3
5+
CHECK-NEXT: inlined_g
6+
CHECK-NEXT: dwarfdump-inl-test.h:7
7+
CHECK-NEXT: inlined_f
8+
CHECK-NEXT: dwarfdump-inl-test.cc:3
9+
CHECK-NEXT: main
10+
CHECK-NEXT: dwarfdump-inl-test.cc:8

llvm/test/DebugInfo/llvm-symbolizer.test

-33
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,13 @@ RUN: echo "%p/Inputs/dwarfdump-test4.elf-x86-64 0x62c" >> %t.input
1111
RUN: echo "%p/Inputs/dwarfdump-inl-test.elf-x86-64 0x8dc" >> %t.input
1212
RUN: echo "%p/Inputs/dwarfdump-inl-test.elf-x86-64 0xa05" >> %t.input
1313
RUN: echo "%p/Inputs/dwarfdump-inl-test.elf-x86-64 0x987" >> %t.input
14-
RUN: echo "%p/Inputs/dwarfdump-inl-test.high_pc.elf-x86-64 0x568" >> %t.input
1514
RUN: cp "%p/Inputs/dwarfdump-test3.elf-x86-64-space" "%t/dwarfdump-test3.elf-x86-64 space"
1615
RUN: echo "\"%t/dwarfdump-test3.elf-x86-64 space\" 0x640" >> %t.input
1716
RUN: echo "\"%t/dwarfdump-test3.elf-x86-64 space\" 0x633" >> %t.input
1817
RUN: echo "\"%t/dwarfdump-test3.elf-x86-64 space\" 0x62d" >> %t.input
1918
RUN: echo "%p/Inputs/macho-universal 0x1f84" >> %t.input
2019
RUN: echo "%p/Inputs/macho-universal:i386 0x1f67" >> %t.input
2120
RUN: echo "%p/Inputs/macho-universal:x86_64 0x100000f05" >> %t.input
22-
RUN: echo "%p/Inputs/llvm-symbolizer-local-mem-func-gcc.elf-x86-64 0x61a" >> %t.input
23-
RUN: echo "%p/Inputs/arange-overlap.elf-x86_64 0x714" >> %t.input
24-
RUN: echo "%p/Inputs/cross-cu-inlining.x86_64-macho.o 0x17" >> %t.input
2521

2622
RUN: cd %t
2723
RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \
@@ -71,15 +67,6 @@ CHECK-NEXT: dwarfdump-inl-test.cc:3
7167
CHECK-NEXT: main
7268
CHECK-NEXT: dwarfdump-inl-test.cc:8
7369

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-
8370
CHECK: C
8471
CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test3.cc:3
8572

@@ -93,20 +80,6 @@ CHECK: main
9380
CHECK: _Z3inci
9481
CHECK: _Z3inci
9582

96-
CHECK-NOT: local_mem_func
97-
CHECK: _ZZ2f1vEN3foo14local_mem_funcEv
98-
CHECK-NEXT: {{.*}}local-mem-func.cpp:3:0
99-
100-
CHECK: _ZN1S3bazEv
101-
CHECK-NEXT: {{.*}}arange-overlap.cc:6
102-
103-
; func has been inlined into main by LTO. Check that the symbolizer is able
104-
; to resolve the cross-cu reference and retrieve func's name
105-
CHECK: func
106-
CHECK-NEXT: /tmp{{[/\\]}}cross-cu-inlining.c:16:3
107-
CHECK-NEXT: main
108-
CHECK-NEXT: /tmp{{[/\\]}}cross-cu-inlining.c:11:0
109-
11083
RUN: echo "unexisting-file 0x1234" > %t.input2
11184
RUN: llvm-symbolizer < %t.input2 2>&1 | FileCheck %s --check-prefix=MISSING-FILE
11285

@@ -139,12 +112,6 @@ BINARY_C-NEXT: /tmp/dbginfo{{[/\\]}}llvm-symbolizer-test.c:10
139112
BINARY_C: _start
140113
BINARY_C: {{g$}}
141114

142-
RUN: echo "0x1f1" > %t.input6
143-
RUN: llvm-symbolizer --obj %p/Inputs/shared-object-stripped.elf-i386 < %t.input6 \
144-
RUN: | FileCheck %s --check-prefix=STRIPPED
145-
146-
STRIPPED: global_func
147-
148115
; Check that the last of --demangle and --no-demangle wins.
149116
RUN: echo "%p/Inputs/dwarfdump-test4.elf-x86-64 0x62c" > %t.input7
150117
RUN: llvm-symbolizer --demangle < %t.input7 \
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
RUN: llvm-symbolizer 0x1f1 --obj %p/Inputs/shared-object-stripped.elf-i386 \
2+
RUN: | FileCheck %s
3+
4+
CHECK: global_func

0 commit comments

Comments
 (0)