summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-symbolizer
diff options
context:
space:
mode:
authorJames Henderson <jh7370@my.bristol.ac.uk>2019-01-31 14:17:33 +0000
committerJames Henderson <jh7370@my.bristol.ac.uk>2019-01-31 14:17:33 +0000
commit0ca744c8454de17a9907d1b3430d1a1b9f315bd8 (patch)
tree99c25f524370f8cc0cd3f23c1ec5bd8e2e967a7c /llvm/test/tools/llvm-symbolizer
parentb10f112cf98e4836f3c6f32d84d83eb6b5de1c39 (diff)
downloadbcm5719-llvm-0ca744c8454de17a9907d1b3430d1a1b9f315bd8.tar.gz
bcm5719-llvm-0ca744c8454de17a9907d1b3430d1a1b9f315bd8.zip
[llvm-symbolizer][test] Extract tests from llvm-symbolizer.test and simplify (#2)
This is the third of a series of patches simplifying llvm-symbolizer tests. See r352752 and r352753 for the previous two. This patch splits out a number of distinct test cases from llvm-symbolizer.test into separate tests, and simplifies them in various ways including: 1) using --obj/positional arguments for the input file and addresses instead of stdin, 2) using runtime-generated inputs rather than a pre-canned binary, and 3) testing more specifically (i.e. checking only what is interesting to the behaviour changed in the original commit for that test case). This patch also removes the test case for using --obj. The tools/llvm-symbolizer/basic.s test already tests this case. Finally, this patch adds a simple test case to the demangle switch test case to show that demangling happens by default. See https://bugs.llvm.org/show_bug.cgi?id=40070#c1 for the motivation. Reviewed by: dblaikie Differential Revision: https://reviews.llvm.org/D57446 llvm-svn: 352754
Diffstat (limited to 'llvm/test/tools/llvm-symbolizer')
-rw-r--r--llvm/test/tools/llvm-symbolizer/demangle.s29
1 files changed, 29 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-symbolizer/demangle.s b/llvm/test/tools/llvm-symbolizer/demangle.s
new file mode 100644
index 00000000000..744e78eb8aa
--- /dev/null
+++ b/llvm/test/tools/llvm-symbolizer/demangle.s
@@ -0,0 +1,29 @@
+# REQUIRES: x86-registered-target
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o -g
+
+.type _Z1cv,@function
+_Z1cv:
+ nop
+
+# Check the default is to demangle and that the last of --demangle and
+# --no-demangle wins.
+# RUN: llvm-symbolizer --obj %t.o 0 \
+# RUN: | FileCheck %s --check-prefix=DEMANGLED_FUNCTION_NAME
+# RUN: llvm-symbolizer --demangle --obj %t.o 0 \
+# RUN: | FileCheck %s --check-prefix=DEMANGLED_FUNCTION_NAME
+# RUN: llvm-symbolizer -C --obj %t.o 0 \
+# RUN: | FileCheck %s --check-prefix=DEMANGLED_FUNCTION_NAME
+# RUN: llvm-symbolizer --no-demangle --obj %t.o 0 \
+# RUN: | FileCheck %s --check-prefix=MANGLED_FUNCTION_NAME
+# RUN: llvm-symbolizer --demangle --no-demangle --obj %t.o 0 \
+# RUN: | FileCheck %s --check-prefix=MANGLED_FUNCTION_NAME
+# RUN: llvm-symbolizer -C --no-demangle --obj %t.o 0 \
+# RUN: | FileCheck %s --check-prefix=MANGLED_FUNCTION_NAME
+# RUN: llvm-symbolizer --no-demangle --demangle --obj %t.o 0 \
+# RUN: | FileCheck %s --check-prefix=DEMANGLED_FUNCTION_NAME
+# RUN: llvm-symbolizer --no-demangle -C --obj %t.o 0 \
+# RUN: | FileCheck %s --check-prefix=DEMANGLED_FUNCTION_NAME
+
+# MANGLED_FUNCTION_NAME: _Z1cv
+# DEMANGLED_FUNCTION_NAME: c()
OpenPOWER on IntegriCloud