[libcxx-commits] [libcxxabi] [llvm] [llvm-cxxfilt] Added the option --no-params (PR #75348)
James Henderson via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Dec 19 01:48:38 PST 2023
================
@@ -0,0 +1,28 @@
+RUN: llvm-cxxfilt _Z3fooIiJEEvf _Z3fooIPFcfEET_d _ZN1f2baC2ERKNS_2baIT_EE | FileCheck %s --check-prefix=CHECK-PARAMS
+RUN: llvm-cxxfilt -p _Z3fooIiJEEvf _Z3fooIPFcfEET_d _ZN1f2baC2ERKNS_2baIT_EE | FileCheck %s --check-prefix=CHECK-NO-PARAMS --match-full-lines
+RUN: llvm-cxxfilt --no-params _Z3fooIiJEEvf _Z3fooIPFcfEET_d _ZN1f2baC2ERKNS_2baIT_EE | FileCheck %s --check-prefix=CHECK-NO-PARAMS --match-full-lines
+
+# Use a simple valid mangled name to check that -p or --no-params flag omits
+# function parameters and the return type.
+
+CHECK-PARAMS: void foo<int>(float)
+CHECK-NO-PARAMS: foo<int>
+
+# Check that only the top-level function is impacted by the switch, and that
+# nested function types in the encoding (e.g. where a function type is being
+# used as a template parameter) still include their parameters.
+#
+# template <typename T> T foo(double);
+# typedef char (*F)(float);
+# F foo<F>(double)
+
+CHECK-PARAMS: char (*foo<char (*)(float)>(double))(float)
+CHECK-NO-PARAMS: foo<char (*)(float)>
+
+# Use an invalid mangled name broken in the function parameters to check how -p
+# or --no-params flag works. If the option is given we should be able to
+# demangle function name just fine. If it is not given, demangling will fail
----------------
jh7370 wrote:
```suggestion
# demangle the function name just fine. If it is not given, demangling will fail
```
Sorry, missed this one.
https://github.com/llvm/llvm-project/pull/75348
More information about the libcxx-commits
mailing list