[PATCH] D71202: [test][llvm-cxxfilt]

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


jhenderson created this revision.
jhenderson added reviewers: grimar, MaskRay, compnerd, rupprecht, erik.pilkington, steven_wu.
Herald added a subscriber: dexonsmith.
Herald added a project: LLVM.

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

      

When committing rGdba420bc05ae <https://reviews.llvm.org/rGdba420bc05aec26c2b6d060cfd186169da30b5f7>, I missed that a darwin-specific change had been recently introduced into llvm-cxxfilt (see rGe84468c1f145 <https://reviews.llvm.org/rGe84468c1f145e9a5e54640ebdc78bc40c7da3fce>), 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.

I have landed this patch already as rG281539053238 <https://reviews.llvm.org/rG281539053238ff17054c101efcf969ab1b6f52f3> to unbreak the build bot, but would appreciate a post-commit review.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D71202

Files:
  llvm/test/tools/llvm-cxxfilt/darwin.test
  llvm/test/tools/llvm-cxxfilt/simple.test
  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
  llvm/test/tools/llvm-cxxfilt/underscore.test


Index: llvm/test/tools/llvm-cxxfilt/strip-underscore.test
===================================================================
--- llvm/test/tools/llvm-cxxfilt/strip-underscore.test
+++ 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
 
Index: llvm/test/tools/llvm-cxxfilt/strip-underscore-default.test
===================================================================
--- /dev/null
+++ 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()
Index: llvm/test/tools/llvm-cxxfilt/strip-underscore-default-darwin.test
===================================================================
--- /dev/null
+++ 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
Index: llvm/test/tools/llvm-cxxfilt/simple.test
===================================================================
--- llvm/test/tools/llvm-cxxfilt/simple.test
+++ 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)
Index: llvm/test/tools/llvm-cxxfilt/darwin.test
===================================================================
--- llvm/test/tools/llvm-cxxfilt/darwin.test
+++ /dev/null
@@ -1,4 +0,0 @@
-REQUIRES: system-darwin
-
-RUN: llvm-cxxfilt __Z1fv | FileCheck %s
-CHECK: f()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71202.232828.patch
Type: text/x-patch
Size: 2840 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191209/9d745b2d/attachment.bin>


More information about the llvm-commits mailing list