1 ; These tests are based on clang/test/CodeGenCXX/mangle-ms-cxx11.cpp
3 ; RUN: llvm-undname < %s | FileCheck %s
5 ; CHECK-NOT: Invalid mangled name
8 ??0?$Class@VTypename@@@@QAE@XZ
9 ; CHECK: __thiscall Class<class Typename>::Class<class Typename>(void)
10 ??0?$Class@VTypename@@@@QEAA@XZ
11 ; CHECK: __cdecl Class<class Typename>::Class<class Typename>(void)
13 ??0?$Class@$$CBVTypename@@@@QAE@XZ
14 ; CHECK: __thiscall Class<class Typename const>::Class<class Typename const>(void)
15 ??0?$Class@$$CBVTypename@@@@QEAA@XZ
16 ; CHECK: __cdecl Class<class Typename const>::Class<class Typename const>(void)
18 ??0?$Class@$$CCVTypename@@@@QAE@XZ
19 ; CHECK: __thiscall Class<class Typename volatile>::Class<class Typename volatile>(void)
20 ??0?$Class@$$CCVTypename@@@@QEAA@XZ
21 ; CHECK: __cdecl Class<class Typename volatile>::Class<class Typename volatile>(void)
23 ??0?$Class@$$CDVTypename@@@@QAE@XZ
24 ; CHECK: __thiscall Class<class Typename const volatile>::Class<class Typename const volatile>(void)
25 ??0?$Class@$$CDVTypename@@@@QEAA@XZ
26 ; CHECK: __cdecl Class<class Typename const volatile>::Class<class Typename const volatile>(void)
28 ??0?$Class@V?$Nested@VTypename@@@@@@QAE@XZ
29 ; CHECK: __thiscall Class<class Nested<class Typename>>::Class<class Nested<class Typename>>(void)
30 ??0?$Class@V?$Nested@VTypename@@@@@@QEAA@XZ
31 ; CHECK: __cdecl Class<class Nested<class Typename>>::Class<class Nested<class Typename>>(void)
33 ??0?$Class@QAH@@QAE@XZ
34 ; CHECK: __thiscall Class<int *const>::Class<int *const>(void)
35 ??0?$Class@QEAH@@QEAA@XZ
36 ; CHECK: __cdecl Class<int *const>::Class<int *const>(void)
38 ??0?$Class@$$A6AHXZ@@QAE@XZ
39 ; CHECK: __thiscall Class<int __cdecl(void)>::Class<int __cdecl(void)>(void)
40 ??0?$Class@$$A6AHXZ@@QEAA@XZ
41 ; CHECK: __cdecl Class<int __cdecl(void)>::Class<int __cdecl(void)>(void)
43 ??0?$Class@$$BY0A@H@@QAE@XZ
44 ; CHECK: __thiscall Class<int[]>::Class<int[]>(void)
45 ??0?$Class@$$BY0A@H@@QEAA@XZ
46 ; CHECK: __cdecl Class<int[]>::Class<int[]>(void)
48 ??0?$Class@$$BY04H@@QAE@XZ
49 ; CHECK: __thiscall Class<int[5]>::Class<int[5]>(void)
50 ??0?$Class@$$BY04H@@QEAA@XZ
51 ; CHECK: __cdecl Class<int[5]>::Class<int[5]>(void)
53 ??0?$Class@$$BY04$$CBH@@QAE@XZ
54 ; CHECK: __thiscall Class<int const[5]>::Class<int const[5]>(void)
55 ??0?$Class@$$BY04$$CBH@@QEAA@XZ
56 ; CHECK: __cdecl Class<int const[5]>::Class<int const[5]>(void)
58 ??0?$Class@$$BY04QAH@@QAE@XZ
59 ; CHECK: __thiscall Class<int *const[5]>::Class<int *const[5]>(void)
60 ??0?$Class@$$BY04QEAH@@QEAA@XZ
61 ; CHECK: __cdecl Class<int *const[5]>::Class<int *const[5]>(void)
63 ??0?$BoolTemplate@$0A@@@QAE@XZ
64 ; CHECK: __thiscall BoolTemplate<0>::BoolTemplate<0>(void)
65 ??0?$BoolTemplate@$0A@@@QEAA@XZ
66 ; CHECK: __cdecl BoolTemplate<0>::BoolTemplate<0>(void)
68 ??0?$BoolTemplate@$00@@QAE@XZ
69 ; CHECK: __thiscall BoolTemplate<1>::BoolTemplate<1>(void)
70 ??0?$BoolTemplate@$00@@QEAA@XZ
71 ; CHECK: __cdecl BoolTemplate<1>::BoolTemplate<1>(void)
73 ??$Foo@H@?$BoolTemplate@$00@@QAEXH@Z
74 ; CHECK: void __thiscall BoolTemplate<1>::Foo<int>(int)
75 ??$Foo@H@?$BoolTemplate@$00@@QEAAXH@Z
76 ; CHECK: void __cdecl BoolTemplate<1>::Foo<int>(int)
78 ??0?$IntTemplate@$0A@@@QAE@XZ
79 ; CHECK: __thiscall IntTemplate<0>::IntTemplate<0>(void)
80 ??0?$IntTemplate@$0A@@@QEAA@XZ
81 ; CHECK: __cdecl IntTemplate<0>::IntTemplate<0>(void)
83 ??0?$IntTemplate@$04@@QAE@XZ
84 ; CHECK: __thiscall IntTemplate<5>::IntTemplate<5>(void)
85 ??0?$IntTemplate@$04@@QEAA@XZ
86 ; CHECK: __cdecl IntTemplate<5>::IntTemplate<5>(void)
88 ??0?$IntTemplate@$0L@@@QAE@XZ
89 ; CHECK: __thiscall IntTemplate<11>::IntTemplate<11>(void)
90 ??0?$IntTemplate@$0L@@@QEAA@XZ
91 ; CHECK: __cdecl IntTemplate<11>::IntTemplate<11>(void)
93 ??0?$IntTemplate@$0BAA@@@QAE@XZ
94 ; CHECK: __thiscall IntTemplate<256>::IntTemplate<256>(void)
95 ??0?$IntTemplate@$0BAA@@@QEAA@XZ
96 ; CHECK: __cdecl IntTemplate<256>::IntTemplate<256>(void)
98 ??0?$IntTemplate@$0CAB@@@QAE@XZ
99 ; CHECK: __thiscall IntTemplate<513>::IntTemplate<513>(void)
100 ??0?$IntTemplate@$0CAB@@@QEAA@XZ
101 ; CHECK: __cdecl IntTemplate<513>::IntTemplate<513>(void)
103 ??0?$IntTemplate@$0EAC@@@QAE@XZ
104 ; CHECK: __thiscall IntTemplate<1026>::IntTemplate<1026>(void)
105 ??0?$IntTemplate@$0EAC@@@QEAA@XZ
106 ; CHECK: __cdecl IntTemplate<1026>::IntTemplate<1026>(void)
108 ??0?$IntTemplate@$0PPPP@@@QAE@XZ
109 ; CHECK: __thiscall IntTemplate<65535>::IntTemplate<65535>(void)
110 ??0?$IntTemplate@$0PPPP@@@QEAA@XZ
111 ; CHECK: __cdecl IntTemplate<65535>::IntTemplate<65535>(void)
113 ??0?$IntTemplate@$0?0@@QAE@XZ
114 ; CHECK: __thiscall IntTemplate<-1>::IntTemplate<-1>(void)
115 ??0?$IntTemplate@$0?0@@QEAA@XZ
116 ; CHECK: __cdecl IntTemplate<-1>::IntTemplate<-1>(void)
118 ??0?$IntTemplate@$0?8@@QAE@XZ
119 ; CHECK: __thiscall IntTemplate<-9>::IntTemplate<-9>(void)
120 ??0?$IntTemplate@$0?8@@QEAA@XZ
121 ; CHECK: __cdecl IntTemplate<-9>::IntTemplate<-9>(void)
123 ??0?$IntTemplate@$0?9@@QAE@XZ
124 ; CHECK: __thiscall IntTemplate<-10>::IntTemplate<-10>(void)
125 ??0?$IntTemplate@$0?9@@QEAA@XZ
126 ; CHECK: __cdecl IntTemplate<-10>::IntTemplate<-10>(void)
128 ??0?$IntTemplate@$0?L@@@QAE@XZ
129 ; CHECK: __thiscall IntTemplate<-11>::IntTemplate<-11>(void)
130 ??0?$IntTemplate@$0?L@@@QEAA@XZ
131 ; CHECK: __cdecl IntTemplate<-11>::IntTemplate<-11>(void)
133 ??0?$UnsignedIntTemplate@$0PPPPPPPP@@@QAE@XZ
134 ; CHECK: __thiscall UnsignedIntTemplate<4294967295>::UnsignedIntTemplate<4294967295>(void)
135 ??0?$UnsignedIntTemplate@$0PPPPPPPP@@@QEAA@XZ
136 ; CHECK: __cdecl UnsignedIntTemplate<4294967295>::UnsignedIntTemplate<4294967295>(void)
138 ??0?$LongLongTemplate@$0?IAAAAAAAAAAAAAAA@@@QAE@XZ
139 ; CHECK: __thiscall LongLongTemplate<-9223372036854775808>::LongLongTemplate<-9223372036854775808>(void)
140 ??0?$LongLongTemplate@$0?IAAAAAAAAAAAAAAA@@@QEAA@XZ
141 ; CHECK: __cdecl LongLongTemplate<-9223372036854775808>::LongLongTemplate<-9223372036854775808>(void)
143 ??0?$LongLongTemplate@$0HPPPPPPPPPPPPPPP@@@QAE@XZ
144 ; CHECK: __thiscall LongLongTemplate<9223372036854775807>::LongLongTemplate<9223372036854775807>(void)
145 ??0?$LongLongTemplate@$0HPPPPPPPPPPPPPPP@@@QEAA@XZ
146 ; CHECK: __cdecl LongLongTemplate<9223372036854775807>::LongLongTemplate<9223372036854775807>(void)
148 ; -1 is indistinguishable from uint64_max in this encoding.
149 ??0?$UnsignedLongLongTemplate@$0?0@@QAE@XZ
150 ; CHECK: __thiscall UnsignedLongLongTemplate<-1>::UnsignedLongLongTemplate<-1>(void)
151 ??0?$UnsignedLongLongTemplate@$0?0@@QEAA@XZ
152 ; CHECK: __cdecl UnsignedLongLongTemplate<-1>::UnsignedLongLongTemplate<-1>(void)
154 ??$foo@H@space@@YAABHABH@Z
155 ; CHECK: int const & __cdecl space::foo<int>(int const &)
156 ??$foo@H@space@@YAAEBHAEBH@Z
157 ; CHECK: int const & __cdecl space::foo<int>(int const &)
159 ??$FunctionPointerTemplate@$1?spam@@YAXXZ@@YAXXZ
160 ; CHECK: void __cdecl FunctionPointerTemplate<&void __cdecl spam(void)>(void)
162 ??$variadic_fn_template@HHHH@@YAXABH000@Z
163 ; CHECK: void __cdecl variadic_fn_template<int, int, int, int>(int const &, int const &, int const &, int const &)
164 ??$variadic_fn_template@HHD$$BY01D@@YAXABH0ABDAAY01$$CBD@Z
165 ; CHECK: void __cdecl variadic_fn_template<int, int, char, char[2]>(int const &, int const &, char const &, char const (&)[2]
167 ??0?$VariadicClass@HD_N@@QAE@XZ
168 ; CHECK: __thiscall VariadicClass<int, char, bool>::VariadicClass<int, char, bool>(void)
170 ??0?$VariadicClass@_NDH@@QAE@XZ
171 ; CHECK: __thiscall VariadicClass<bool, char, int>::VariadicClass<bool, char, int>(void)
174 ?template_template_fun@@YAXU?$Type@U?$Thing@USecond@@$00@@USecond@@@@@Z
175 ; CHECK: void __cdecl template_template_fun(struct Type<struct Thing<struct Second, 1>, struct Second>)
177 ??$template_template_specialization@$$A6AXU?$Type@U?$Thing@USecond@@$00@@USecond@@@@@Z@@YAXXZ
178 ; CHECK: void __cdecl template_template_specialization<void __cdecl(struct Type<struct Thing<struct Second, 1>, struct Second>)>(void)
180 ?f@@YAXU?$S1@$0A@@@@Z
181 ; CHECK: void __cdecl f(struct S1<0>)
183 ?recref@@YAXU?$type1@$E?inst@@3Urecord@@B@@@Z
184 ; CHECK: void __cdecl recref(struct type1<struct record const inst>)
186 ?fun@@YAXU?$UUIDType1@Uuuid@@$1?_GUID_12345678_1234_1234_1234_1234567890ab@@3U__s_GUID@@B@@@Z
187 ; CHECK: void __cdecl fun(struct UUIDType1<struct uuid, &struct __s_GUID const _GUID_12345678_1234_1234_1234_1234567890ab>)
188 ?fun@@YAXU?$UUIDType2@Uuuid@@$E?_GUID_12345678_1234_1234_1234_1234567890ab@@3U__s_GUID@@B@@@Z
189 ; CHECK: void __cdecl fun(struct UUIDType2<struct uuid, struct __s_GUID const _GUID_12345678_1234_1234_1234_1234567890ab>)
191 ?FunctionDefinedWithInjectedName@@YAXU?$TypeWithFriendDefinition@H@@@Z
192 ; CHECK: void __cdecl FunctionDefinedWithInjectedName(struct TypeWithFriendDefinition<int>)
194 ?bar@?$UUIDType4@$1?_GUID_12345678_1234_1234_1234_1234567890ab@@3U__s_GUID@@B@@QAEXXZ
195 ; CHECK: void __thiscall UUIDType4<&struct __s_GUID const _GUID_12345678_1234_1234_1234_1234567890ab>::bar(void)
197 ??$f@US@@$1?g@1@QEAAXXZ@@YAXXZ
198 ; CHECK: void __cdecl f<struct S, &public: void __cdecl S::g(void)>(void)
200 ??$?0N@?$Foo@H@@QEAA@N@Z
201 ; CHECK: __cdecl Foo<int>::Foo<int><double>(double)