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.
+++ /dev/null
-REQUIRES: system-darwin
-
-RUN: llvm-cxxfilt __Z1fv | FileCheck %s
-CHECK: f()
-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)
--- /dev/null
+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
--- /dev/null
+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()
+## 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