Clang Project

clang_source_code/test/Index/USR/func-type.cpp
1// RUN: c-index-test core -print-source-symbols -- %s | FileCheck %s
2
3// Functions taking function pointer parameters with different signatures should result in unique USRs.
4
5typedef void (*_VoidToVoidPtr_)();
6typedef void (*_IntToVoidPtr_)( int );
7typedef _VoidToVoidPtr_ (*IntTo_VoidToVoidPtr_Ptr)( int );
8typedef _IntToVoidPtr_ (*VoidTo_IntToVoidPtr_Ptr)();
9
10void Func( IntTo_VoidToVoidPtr_Ptr );
11// CHECK: {{[0-9]+}}:6 | function/C | Func | c:@F@Func#*F*Fv()(#I)# |
12void Func( VoidTo_IntToVoidPtr_Ptr );
13// CHECK: {{[0-9]+}}:6 | function/C | Func | c:@F@Func#*F*Fv(#I)()# |
14
15void Func( void (* (*)(int, int))(int, int) );
16// CHECK: {{[0-9]+}}:6 | function/C | Func | c:@F@Func#*F*Fv(#I#I)(#I#I)# |
17void Func( void (* (*)(int, int, int))(int) );
18// CHECK: {{[0-9]+}}:6 | function/C | Func | c:@F@Func#*F*Fv(#I)(#I#I#I)# |
19