Skip to content

Commit 2e070db

Browse files
committed
[llvm-cxxfilt][NFC] Use split-file to avoid echo abuse
Apply reviews from @jh7370.
1 parent ecd1d77 commit 2e070db

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

llvm/docs/CommandGuide/llvm-cxxfilt.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ OPTIONS
5454

5555
.. option:: --quote
5656

57-
Add `"` `"` around demangled function symbols.
58-
Do not quote already quoted symbols.
57+
Add `"` `"` around demangled function symbols. Do not quote already quoted
58+
symbols.
5959

6060
.. option:: --no-strip-underscore, -n
6161

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
// Show that llvm-cxxfilt --quote adds quotes around demangled symbols, unless the symbol is already quoted.
2-
RUN: echo _Z3barv '"_Z3barv"' > %t
3-
RUN: echo '"_Z3barv"' _Z3barv >> %t
4-
// This is not mangled, thus it should not be quoted
5-
RUN: echo 'log()' >> %t
6-
// Check that an "import thunk for" prefix can be quoted along the demangled name
7-
RUN: echo __imp__ZSt6futureIvE >> %t
8-
RUN: llvm-cxxfilt --quote < %t | FileCheck --match-full-lines --check-prefix=CHECK-FILE %s
2+
3+
RUN: split-file %s %t
4+
5+
RUN: llvm-cxxfilt --quote < %t/symbols-in-file.test | FileCheck --match-full-lines --check-prefix=CHECK-FILE %s
96
CHECK-FILE: "bar()" "bar()"
107
CHECK-FILE-NEXT: "bar()" "bar()"
11-
CHECK-FILE-NEXT: log()
12-
CHECK-FILE-NEXT: "import thunk for std::future<void>"
8+
CHECK-FILE: log()
9+
CHECK-FILE: "import thunk for std::future<void>"
1310

14-
// Check it works with cli symbols too. Since a quoted mangled name is not a
11+
// Check it works with CLI symbols too. Since a quoted mangled name is not a
1512
// mangled name, it should be unchanged
1613
RUN: llvm-cxxfilt --quote _Z3firv '"_Z3barv"' 'saw()' | FileCheck --match-full-lines --check-prefix=CHECK-CLI %s
1714
CHECK-CLI: "fir()"
18-
CHECK-CLI: "_Z3barv"
19-
CHECK-CLI: saw()
15+
CHECK-CLI-NEXT: "_Z3barv"
16+
CHECK-CLI-NEXT: saw()
17+
18+
//--- symbols-in-file.test
19+
_Z3barv "_Z3barv"
20+
"_Z3barv" _Z3barv
21+
// This is not mangled, thus it should not be quoted
22+
log()
23+
// Check that an "import thunk for" prefix can be quoted along the demangled name
24+
__imp__ZSt6futureIvE

0 commit comments

Comments
 (0)