[llvm] [llvm-cxxfilt] Add --quote option to quote demangled function names (PR #111871)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 17 00:41:10 PDT 2024
================
@@ -1,21 +1,24 @@
-// Show that llvm-cxxfilt --quote can emit quoted demangled symbols (even at the
-// end of a line) but not without double-quoting in the case they are already
-// quoted.
-RUN: echo _Z3barv '"_Z3barv"' > %t
-RUN: echo '"_Z3barv"' _Z3barv >> %t
-// This is not mangled, thus it should not be quoted
-RUN: echo 'log()' >> %t
-// Check that an "import thunk for" prefix can be quoted along the demangled name
-RUN: echo __imp__ZSt6futureIvE >> %t
-RUN: llvm-cxxfilt --quote < %t | FileCheck --match-full-lines --check-prefix=CHECK-FILE %s
+// Show that llvm-cxxfilt --quote adds quotes around demangled symbols, unless the symbol is already quoted.
+
+RUN: split-file %s %t
+
+RUN: llvm-cxxfilt --quote < %t/symbols-in-file.test | FileCheck --match-full-lines --check-prefix=CHECK-FILE %s
CHECK-FILE: "bar()" "bar()"
CHECK-FILE-NEXT: "bar()" "bar()"
-CHECK-FILE-NEXT: log()
-CHECK-FILE-NEXT: "import thunk for std::future<void>"
+CHECK-FILE: log()
+CHECK-FILE: "import thunk for std::future<void>"
-// Check it works with cli symbols too. Since a quoted mangled name is not a
+// Check it works with CLI symbols too. Since a quoted mangled name is not a
// mangled name, it should be unchanged
RUN: llvm-cxxfilt --quote _Z3firv '"_Z3barv"' 'saw()' | FileCheck --match-full-lines --check-prefix=CHECK-CLI %s
CHECK-CLI: "fir()"
-CHECK-CLI: "_Z3barv"
-CHECK-CLI: saw()
+CHECK-CLI-NEXT: "_Z3barv"
+CHECK-CLI-NEXT: saw()
+
+//--- symbols-in-file.test
+_Z3barv "_Z3barv"
+"_Z3barv" _Z3barv
+// This is not mangled, thus it should not be quoted
----------------
jh7370 wrote:
Also missing "." here and below - comments should always end with one, just like in regular code.
https://github.com/llvm/llvm-project/pull/111871
More information about the llvm-commits
mailing list