[llvm] 2815390 - [test][llvm-cxxfilt] Fix darwin build bot

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 9 06:01:50 PST 2019


Author: James Henderson
Date: 2019-12-09T14:01:14Z
New Revision: 281539053238ff17054c101efcf969ab1b6f52f3

URL: https://github.com/llvm/llvm-project/commit/281539053238ff17054c101efcf969ab1b6f52f3
DIFF: https://github.com/llvm/llvm-project/commit/281539053238ff17054c101efcf969ab1b6f52f3.diff

LOG: [test][llvm-cxxfilt] Fix darwin build bot

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.

Added: 
    llvm/test/tools/llvm-cxxfilt/strip-underscore-default-darwin.test
    llvm/test/tools/llvm-cxxfilt/strip-underscore-default.test
    llvm/test/tools/llvm-cxxfilt/strip-underscore.test

Modified: 
    llvm/test/tools/llvm-cxxfilt/simple.test

Removed: 
    llvm/test/tools/llvm-cxxfilt/darwin.test
    llvm/test/tools/llvm-cxxfilt/underscore.test


################################################################################
diff  --git a/llvm/test/tools/llvm-cxxfilt/darwin.test b/llvm/test/tools/llvm-cxxfilt/darwin.test
deleted file mode 100644
index 761a23d54c3f..000000000000
--- a/llvm/test/tools/llvm-cxxfilt/darwin.test
+++ /dev/null
@@ -1,4 +0,0 @@
-REQUIRES: system-darwin
-
-RUN: llvm-cxxfilt __Z1fv | FileCheck %s
-CHECK: f()

diff  --git a/llvm/test/tools/llvm-cxxfilt/simple.test b/llvm/test/tools/llvm-cxxfilt/simple.test
index 90dd18d58dcb..d1f8fed23029 100644
--- a/llvm/test/tools/llvm-cxxfilt/simple.test
+++ b/llvm/test/tools/llvm-cxxfilt/simple.test
@@ -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
index 000000000000..7dcffa05a048
--- /dev/null
+++ b/llvm/test/tools/llvm-cxxfilt/strip-underscore-default-darwin.test
@@ -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
index 000000000000..6d6fa51132b2
--- /dev/null
+++ b/llvm/test/tools/llvm-cxxfilt/strip-underscore-default.test
@@ -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()

diff  --git a/llvm/test/tools/llvm-cxxfilt/underscore.test b/llvm/test/tools/llvm-cxxfilt/strip-underscore.test
similarity index 78%
rename from llvm/test/tools/llvm-cxxfilt/underscore.test
rename to llvm/test/tools/llvm-cxxfilt/strip-underscore.test
index f84eac8087d9..4c33cdfeadd7 100644
--- a/llvm/test/tools/llvm-cxxfilt/underscore.test
+++ b/llvm/test/tools/llvm-cxxfilt/strip-underscore.test
@@ -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
 


        


More information about the llvm-commits mailing list