[test][llvm-cxxfilt] Fix darwin build bot
authorJames Henderson <jh7370@my.bristol.ac.uk>
Mon, 9 Dec 2019 13:58:40 +0000 (13:58 +0000)
committerJames Henderson <jh7370@my.bristol.ac.uk>
Mon, 9 Dec 2019 14:01:14 +0000 (14:01 +0000)
When committing dba420bc05ae, I missed that a darwin-specific change had
been recently introduced into llvm-cxxfilt, which my change ignored and
consequently broke the darwin build bot. This change fixes this issue as
well as improving naming/commenting of things related to this point so
that people are less likely to run into the same issue as I did.

llvm/test/tools/llvm-cxxfilt/darwin.test [deleted file]
llvm/test/tools/llvm-cxxfilt/simple.test
llvm/test/tools/llvm-cxxfilt/strip-underscore-default-darwin.test [new file with mode: 0644]
llvm/test/tools/llvm-cxxfilt/strip-underscore-default.test [new file with mode: 0644]
llvm/test/tools/llvm-cxxfilt/strip-underscore.test [moved from llvm/test/tools/llvm-cxxfilt/underscore.test with 78% similarity]

diff --git a/llvm/test/tools/llvm-cxxfilt/darwin.test b/llvm/test/tools/llvm-cxxfilt/darwin.test
deleted file mode 100644 (file)
index 761a23d..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-REQUIRES: system-darwin
-
-RUN: llvm-cxxfilt __Z1fv | FileCheck %s
-CHECK: f()
index 90dd18d..d1f8fed 100644 (file)
@@ -1,7 +1,12 @@
-RUN: llvm-cxxfilt _Z1fi abc | FileCheck %s
+## Show that llvm-cxxfilt can handle basic demangling for command-line inputs,
+## including when they are part of a string. Note that this test uses "-n"
+## because on darwin, the default for --strip-underscore is true, but false
+## elsewhere.
+
+RUN: llvm-cxxfilt -n _Z1fi abc | FileCheck %s
 RUN: echo "Mangled _Z1fi and _Z3foov in string." | llvm-cxxfilt \
 RUN:   | FileCheck %s --check-prefix=CHECK-STRING
-RUN: llvm-cxxfilt "CLI remains mangled _Z1fi" \
+RUN: llvm-cxxfilt -n "CLI remains mangled _Z1fi" \
 RUN:   | FileCheck %s --check-prefix=CHECK-MANGLED
 
 CHECK: f(int)
diff --git a/llvm/test/tools/llvm-cxxfilt/strip-underscore-default-darwin.test b/llvm/test/tools/llvm-cxxfilt/strip-underscore-default-darwin.test
new file mode 100644 (file)
index 0000000..7dcffa0
--- /dev/null
@@ -0,0 +1,7 @@
+REQUIRES: system-darwin
+
+## Show that on darwin, the default is to strip the leading underscore.
+
+RUN: llvm-cxxfilt __Z1fv _Z2bav | FileCheck %s
+CHECK: f()
+CHECK: _Z2bav
diff --git a/llvm/test/tools/llvm-cxxfilt/strip-underscore-default.test b/llvm/test/tools/llvm-cxxfilt/strip-underscore-default.test
new file mode 100644 (file)
index 0000000..6d6fa51
--- /dev/null
@@ -0,0 +1,8 @@
+UNSUPPORTED: system-darwin
+
+## Show that on non-darwin systems, the default is to strip the leading
+## underscore.
+
+RUN: llvm-cxxfilt __Z1fv _Z2bav | FileCheck %s
+CHECK: __Z1fv
+CHECK: ba()
@@ -1,6 +1,8 @@
+## Show the behaviour of --[no-]strip-underscore. This test does not test
+## the platform-specific default behaviour. This is tested elsewhere.
+
 RUN: llvm-cxxfilt -_ __ZN2ns1fE _ZSt1f _f | FileCheck %s -check-prefix CHECK-STRIPPED
 RUN: llvm-cxxfilt --strip-underscore __ZN2ns1fE _ZSt1f _f | FileCheck %s -check-prefix CHECK-STRIPPED
-RUN: llvm-cxxfilt __ZN2ns1fE _ZSt1f _f | FileCheck %s -check-prefix CHECK-UNSTRIPPED
 RUN: llvm-cxxfilt -n __ZN2ns1fE _ZSt1f _f | FileCheck %s -check-prefix CHECK-UNSTRIPPED
 RUN: llvm-cxxfilt --no-strip-underscore __ZN2ns1fE _ZSt1f _f | FileCheck %s -check-prefix CHECK-UNSTRIPPED