summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorJames Henderson <jh7370@my.bristol.ac.uk>2019-01-31 14:22:50 +0000
committerJames Henderson <jh7370@my.bristol.ac.uk>2019-01-31 14:22:50 +0000
commit5282c872c020373fee306ccabf99ed6a130beb88 (patch)
tree19a07ad9076f6139d0c1f5b62a6db01f34d67639 /llvm/test
parenta22c72ca8ff55a70e38ea0d40929a48324e5b8a4 (diff)
downloadbcm5719-llvm-5282c872c020373fee306ccabf99ed6a130beb88.tar.gz
bcm5719-llvm-5282c872c020373fee306ccabf99ed6a130beb88.zip
[llvm-symbolizer][test] Extract tests from llvm-symbolizer.test and simplify (#3)
This is the fourth (and final for now) of a series of patches simplifying llvm-symbolizer tests. See r352752, r352753 and 352754 for the previous ones. This patch splits out several more distinct test cases from llvm-symbolizer.test into separate tests, and simplifies them in various ways including: 1) Building a test case for spaces in path from source, rather than using a pre-canned binary. This allows deleting of said binary and the source it was built from. 2) Switching to specifying addresses and objects directly on the command-line rather than via stdin. This also adds an explict test for the ability to specify a file and address as a line in stdin, since the majority of the tests have been migrated away from this approach, leaving this largely untested. Reviewed by: dblaikie Differential Revision: https://reviews.llvm.org/D57446 llvm-svn: 352756
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/DebugInfo/Inputs/dwarfdump-test3-decl.h7
-rw-r--r--llvm/test/DebugInfo/Inputs/dwarfdump-test3-decl2.h1
-rw-r--r--llvm/test/DebugInfo/Inputs/dwarfdump-test3.cc12
-rw-r--r--llvm/test/DebugInfo/llvm-symbolizer.test49
-rw-r--r--llvm/test/DebugInfo/symbolize-gnu-debuglink.test4
-rw-r--r--llvm/test/DebugInfo/symbolize-inlined.test22
-rw-r--r--llvm/test/DebugInfo/symbolize-missing-file.test3
-rw-r--r--llvm/test/tools/llvm-symbolizer/space-in-path.s15
8 files changed, 44 insertions, 69 deletions
diff --git a/llvm/test/DebugInfo/Inputs/dwarfdump-test3-decl.h b/llvm/test/DebugInfo/Inputs/dwarfdump-test3-decl.h
index 4a79e959b0c..e69de29bb2d 100644
--- a/llvm/test/DebugInfo/Inputs/dwarfdump-test3-decl.h
+++ b/llvm/test/DebugInfo/Inputs/dwarfdump-test3-decl.h
@@ -1,7 +0,0 @@
-#include "dwarfdump-test3-decl2.h"
-
-class C {
- explicit C(bool a = false, bool b = false);
-};
-
-void do1() {}
diff --git a/llvm/test/DebugInfo/Inputs/dwarfdump-test3-decl2.h b/llvm/test/DebugInfo/Inputs/dwarfdump-test3-decl2.h
index 9c92d56fcf4..e69de29bb2d 100644
--- a/llvm/test/DebugInfo/Inputs/dwarfdump-test3-decl2.h
+++ b/llvm/test/DebugInfo/Inputs/dwarfdump-test3-decl2.h
@@ -1 +0,0 @@
-void do2() { }
diff --git a/llvm/test/DebugInfo/Inputs/dwarfdump-test3.cc b/llvm/test/DebugInfo/Inputs/dwarfdump-test3.cc
index 7b4d7ea7118..e69de29bb2d 100644
--- a/llvm/test/DebugInfo/Inputs/dwarfdump-test3.cc
+++ b/llvm/test/DebugInfo/Inputs/dwarfdump-test3.cc
@@ -1,12 +0,0 @@
-#include "dwarfdump-test3-decl.h"
-
-C::C(bool a, bool b) {}
-
-// Built with gcc 4.6.3
-// $ mkdir -p /tmp/dbginfo/include
-// $ mkdir -p /tmp/include
-// $ cp dwarfdump-test3.cc /tmp/dbginfo
-// $ cp dwarfdump-test3-decl.h /tmp/include
-// $ cp dwarfdump-test3-decl2.h /tmp/dbginfo/include
-// $ cd /tmp/dbginfo
-// $ gcc dwarfdump-test3.cc -g -I/tmp/include -Iinclude -fPIC -shared -o <output>
diff --git a/llvm/test/DebugInfo/llvm-symbolizer.test b/llvm/test/DebugInfo/llvm-symbolizer.test
index cbd15859327..7b0bd142610 100644
--- a/llvm/test/DebugInfo/llvm-symbolizer.test
+++ b/llvm/test/DebugInfo/llvm-symbolizer.test
@@ -1,31 +1,17 @@
-RUN: rm -rf %t
-RUN: mkdir -p %t
RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x40113f" > %t.input
-RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64.debuglink 0x40113f" >> %t.input
RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x401020" >> %t.input
RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x40110e" >> %t.input
RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x401160" >> %t.input
RUN: echo "%p/Inputs/dwarfdump-test2.elf-x86-64 0x4004e8" >> %t.input
RUN: echo "%p/Inputs/dwarfdump-test2.elf-x86-64 0x4004f4" >> %t.input
RUN: echo "%p/Inputs/dwarfdump-test4.elf-x86-64 0x62c" >> %t.input
-RUN: echo "%p/Inputs/dwarfdump-inl-test.elf-x86-64 0x8dc" >> %t.input
-RUN: echo "%p/Inputs/dwarfdump-inl-test.elf-x86-64 0xa05" >> %t.input
-RUN: echo "%p/Inputs/dwarfdump-inl-test.elf-x86-64 0x987" >> %t.input
-RUN: cp "%p/Inputs/dwarfdump-test3.elf-x86-64-space" "%t/dwarfdump-test3.elf-x86-64 space"
-RUN: echo "\"%t/dwarfdump-test3.elf-x86-64 space\" 0x640" >> %t.input
-RUN: echo "\"%t/dwarfdump-test3.elf-x86-64 space\" 0x633" >> %t.input
-RUN: echo "\"%t/dwarfdump-test3.elf-x86-64 space\" 0x62d" >> %t.input
-RUN: cd %t
RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \
RUN: < %t.input | FileCheck --check-prefix=CHECK --check-prefix=SPLIT --check-prefix=DWO %s
CHECK: main
CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
-CHECK: main
-CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
-
CHECK: _start
CHECK: _Z1fii
@@ -42,38 +28,3 @@ CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test2-main.cc:4
CHECK: _Z1cv
CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test4-part1.cc:2
-
-CHECK: inlined_h
-CHECK-NEXT: dwarfdump-inl-test.h:2
-CHECK-NEXT: inlined_g
-CHECK-NEXT: dwarfdump-inl-test.h:7
-CHECK-NEXT: inlined_f
-CHECK-NEXT: dwarfdump-inl-test.cc:3
-CHECK-NEXT: main
-CHECK-NEXT: dwarfdump-inl-test.cc:8
-
-CHECK: inlined_g
-CHECK-NEXT: dwarfdump-inl-test.h:7
-CHECK-NEXT: inlined_f
-CHECK-NEXT: dwarfdump-inl-test.cc:3
-CHECK-NEXT: main
-CHECK-NEXT: dwarfdump-inl-test.cc:8
-
-CHECK: inlined_f
-CHECK-NEXT: dwarfdump-inl-test.cc:3
-CHECK-NEXT: main
-CHECK-NEXT: dwarfdump-inl-test.cc:8
-
-CHECK: C
-CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test3.cc:3
-
-CHECK: _Z3do1v
-CHECK-NEXT: /tmp/include{{[/\\]}}dwarfdump-test3-decl.h:7
-
-CHECK: _Z3do2v
-CHECK-NEXT: /tmp/dbginfo{{[/\\]}}include{{[/\\]}}dwarfdump-test3-decl2.h:1
-
-RUN: echo "unexisting-file 0x1234" > %t.input2
-RUN: llvm-symbolizer < %t.input2 2>&1 | FileCheck %s --check-prefix=MISSING-FILE
-
-MISSING-FILE: LLVMSymbolizer: error reading file: {{[Nn]}}o such file or directory
diff --git a/llvm/test/DebugInfo/symbolize-gnu-debuglink.test b/llvm/test/DebugInfo/symbolize-gnu-debuglink.test
new file mode 100644
index 00000000000..93ffda8bf6a
--- /dev/null
+++ b/llvm/test/DebugInfo/symbolize-gnu-debuglink.test
@@ -0,0 +1,4 @@
+RUN: llvm-symbolizer --obj=%p/Inputs/dwarfdump-test.elf-x86-64.debuglink 0x40113f | FileCheck %s
+
+CHECK: main
+CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
diff --git a/llvm/test/DebugInfo/symbolize-inlined.test b/llvm/test/DebugInfo/symbolize-inlined.test
new file mode 100644
index 00000000000..2757721b81f
--- /dev/null
+++ b/llvm/test/DebugInfo/symbolize-inlined.test
@@ -0,0 +1,22 @@
+RUN: llvm-symbolizer --inlining --obj=%p/Inputs/dwarfdump-inl-test.elf-x86-64 0x8dc 0xa05 0x987 | FileCheck %s
+
+CHECK: inlined_h
+CHECK-NEXT: dwarfdump-inl-test.h:2
+CHECK-NEXT: inlined_g
+CHECK-NEXT: dwarfdump-inl-test.h:7
+CHECK-NEXT: inlined_f
+CHECK-NEXT: dwarfdump-inl-test.cc:3
+CHECK-NEXT: main
+CHECK-NEXT: dwarfdump-inl-test.cc:8
+
+CHECK: inlined_g
+CHECK-NEXT: dwarfdump-inl-test.h:7
+CHECK-NEXT: inlined_f
+CHECK-NEXT: dwarfdump-inl-test.cc:3
+CHECK-NEXT: main
+CHECK-NEXT: dwarfdump-inl-test.cc:8
+
+CHECK: inlined_f
+CHECK-NEXT: dwarfdump-inl-test.cc:3
+CHECK-NEXT: main
+CHECK-NEXT: dwarfdump-inl-test.cc:8
diff --git a/llvm/test/DebugInfo/symbolize-missing-file.test b/llvm/test/DebugInfo/symbolize-missing-file.test
new file mode 100644
index 00000000000..2762af4ff5d
--- /dev/null
+++ b/llvm/test/DebugInfo/symbolize-missing-file.test
@@ -0,0 +1,3 @@
+RUN: llvm-symbolizer --obj=unexisting-file 0x1234 2>&1 | FileCheck %s
+
+CHECK: LLVMSymbolizer: error reading file: {{[Nn]}}o such file or directory
diff --git a/llvm/test/tools/llvm-symbolizer/space-in-path.s b/llvm/test/tools/llvm-symbolizer/space-in-path.s
new file mode 100644
index 00000000000..b54f0aa1fe0
--- /dev/null
+++ b/llvm/test/tools/llvm-symbolizer/space-in-path.s
@@ -0,0 +1,15 @@
+# REQUIRES: x86-registered-target
+
+.type foo,@function
+foo:
+ nop
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o "%t space.o" -g
+
+# Test both passing via stdin and via --obj.
+# RUN: echo "\"%t space.o\" 0" > %t.input
+# RUN: llvm-symbolizer < %t.input | FileCheck %s
+# RUN: llvm-symbolizer --obj="%t space.o" 0 | FileCheck %s
+
+# CHECK: foo
+# CHECK-NEXT: space-in-path.s:5
OpenPOWER on IntegriCloud