xref: /llvm-project/llvm/test/tools/llvm-cxxfilt/no-params.test (revision 569ec185f5dc4a9e4a239948191977ecc2b2b475)
1RUN: llvm-cxxfilt             -n _Z3fooILZ3BarEET_f _Z3fooIPFcfEET_d _ZN1f2baC2ERKNS_2baIT_EE _Z3foov.123 | FileCheck %s --check-prefix=CHECK-PARAMS
2RUN: llvm-cxxfilt          -p -n _Z3fooILZ3BarEET_f _Z3fooIPFcfEET_d _ZN1f2baC2ERKNS_2baIT_EE _Z3foov.123 | FileCheck %s --check-prefix=CHECK-NO-PARAMS --match-full-lines
3RUN: llvm-cxxfilt --no-params -n _Z3fooILZ3BarEET_f _Z3fooIPFcfEET_d _ZN1f2baC2ERKNS_2baIT_EE _Z3foov.123 | FileCheck %s --check-prefix=CHECK-NO-PARAMS --match-full-lines
4
5# Check that -p or --no-params flag omits function parameters and the return
6# type.
7
8CHECK-PARAMS: Bar foo<Bar>(float)
9CHECK-NO-PARAMS: foo<Bar>
10
11# Check that only the top-level function is impacted by the switch, and that
12# nested function types in the encoding (e.g. where a function type is being
13# used as a template parameter) still include their parameters.
14#
15# template <typename T> T foo(double);
16# typedef char (*F)(float);
17# F foo<F>(double)
18
19CHECK-PARAMS: char (*foo<char (*)(float)>(double))(float)
20CHECK-NO-PARAMS: foo<char (*)(float)>
21
22# Use an invalid mangled name broken in the function parameters to check how -p
23# or --no-params flag works. If the option is given we should be able to
24# demangle the function name just fine. If it is not given, demangling will fail
25# because of the invalid params.
26
27CHECK-PARAMS: _ZN1f2baC2ERKNS_2baIT_EE
28CHECK-NO-PARAMS: f::ba::ba
29
30# Check that a vendor specific suffix is also omitted when --no-params is
31# specified. This matches c++filt's behaviour.
32
33CHECK-PARAMS: foo() (.123)
34CHECK-NO-PARAMS: foo
35