1 ; Run llvm-undname with invalid inputs and make sure it doesn't crash.
2 ; RUN: not llvm-undname < %s 2>&1 | FileCheck %s
4 ?ff@@$$J0YAXAU?$AS_@$0A@PEAU?$AS_@$0A@H@__clang@@@__clang@@@Z
5 ; CHECK: ?ff@@$$J0YAXAU?$AS_@$0A@PEAU?$AS_@$0A@H@__clang@@@__clang@@@Z
6 ; CHECK-NEXT: error: Invalid mangled name
8 ?f0@@YAXPEU?$AS_@$00$$CAD@__clang@@@Z
10 ; CHECK-NEXT: ?f0@@YAXPEU?$AS_@$00$$CAD@__clang@@@Z
11 ; CHECK-NEXT: error: Invalid mangled name
16 ; CHECK-NEXT: error: Invalid mangled name
21 ; CHECK-NEXT: error: Invalid mangled name
26 ; CHECK-NEXT: error: Invalid mangled name
30 ; CHECK-NEXT: ? @@ YC@
31 ; CHECK-NEXT: error: Invalid mangled name
35 ; CHECK-NEXT: ??B@$$J0
36 ; CHECK-NEXT: error: Invalid mangled name
41 ; CHECK-NEXT: error: Invalid mangled name
45 ; CHECK-NEXT: ?A?@?@???B@4D
46 ; CHECK-NEXT: error: Invalid mangled name
50 ; CHECK-NEXT: ?A?@?@???B@4DD
51 ; CHECK-NEXT: error: Invalid mangled name
55 ; CHECK-NEXT: ??$A@P15@
56 ; CHECK-NEXT: error: Invalid mangled name
61 ; CHECK-NEXT: error: Invalid mangled name
66 ; CHECK-NEXT: error: Invalid mangled name
71 ; CHECK-NEXT: error: Invalid mangled name
75 ; CHECK-NEXT: ?A@@4PQA@@
76 ; CHECK-NEXT: error: Invalid mangled name
81 ; CHECK-NEXT: error: Invalid mangled name
86 ; CHECK-NEXT: error: Invalid mangled name
90 ; CHECK-NEXT: ??__E?Foo@@0HA@@
91 ; CHECK-NEXT: error: Invalid mangled name
95 ; CHECK-NEXT: ??__E?i@C@@0HA@
96 ; CHECK-NEXT: error: Invalid mangled name
100 ; CHECK-NEXT: ??__E?Foo@@YAXXZ
101 ; CHECK-NEXT: error: Invalid mangled name
105 ; CHECK-NEXT: ?foo@@YAH0@Z
106 ; CHECK-NEXT: error: Invalid mangled name
110 ; CHECK-NEXT: ?foo@@YAHH
111 ; CHECK-NEXT: error: Invalid mangled name
116 ; CHECK-NEXT: error: Invalid mangled name
120 ; CHECK-NEXT: ?B@?$?K$H?
121 ; CHECK-NEXT: error: Invalid mangled name
126 ; CHECK-NEXT: error: Invalid mangled name
130 ; CHECK-NEXT: ?x@@3PAW
131 ; CHECK-NEXT: error: Invalid mangled name
136 ; CHECK-NEXT: error: Invalid mangled name
140 ; CHECK-NEXT: ?foo@?$?_
141 ; CHECK-NEXT: error: Invalid mangled name
146 ; CHECK-NEXT: error: Invalid mangled name
150 ; CHECK-NEXT: ??_R4foo@@
151 ; CHECK-NEXT: error: Invalid mangled name
155 ; CHECK-NEXT: ?foo@?$?BH@@QAEHXZ
156 ; CHECK-NEXT: error: Invalid mangled name
160 ; CHECK-NEXT: ?foo@?$?0H@
161 ; CHECK-NEXT: error: Invalid mangled name
165 ; CHECK-NEXT: ??_C@_0A@01234567@a
166 ; CHECK-NEXT: error: Invalid mangled name
170 ; CHECK-NEXT: ??_C@_1A@01234567@a
171 ; CHECK-NEXT: error: Invalid mangled name
175 ; CHECK-NEXT: ??_C@_0301234567@a
176 ; CHECK-NEXT: error: Invalid mangled name
180 ; CHECK-NEXT: ??_C@_1301234567@a
181 ; CHECK-NEXT: error: Invalid mangled name
183 ??_C@_0601234567@abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRTSUVWXYZabcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRTSUVWXYZabcdefghijklmnopqrtsuvwxyz
185 ; CHECK-NEXT: ??_C@_0601234567@abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRTSUVWXYZabcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRTSUVWXYZabcdefghijklmnopqrtsuvwxyz
186 ; CHECK-NEXT: error: Invalid mangled name
190 ; CHECK-NEXT: ??_C@_12@?z
191 ; CHECK-NEXT: error: Invalid mangled name
193 ??$foo@$1??_C@_02PCEFGMJL@hi?$AA@@
195 ; CHECK-NEXT: ??$foo@$1??_C@_02PCEFGMJL@hi?$AA@@
196 ; CHECK-NEXT: error: Invalid mangled name
201 ; CHECK-NEXT: error: Invalid mangled name
206 ; CHECK-NEXT: error: Invalid mangled name
210 ; CHECK-NEXT: ??_C@_3
211 ; CHECK-NEXT: error: Invalid mangled name
215 ; CHECK-NEXT: ??_C@_01
216 ; CHECK-NEXT: error: Invalid mangled name
220 ; CHECK-NEXT: ??_C@_0101234567@
221 ; CHECK-NEXT: error: Invalid mangled name
225 ; CHECK-NEXT: ??_C@_0101234567@?
226 ; CHECK-NEXT: error: Invalid mangled name
230 ; CHECK-NEXT: ??_C@_0101234567@?$
231 ; CHECK-NEXT: error: Invalid mangled name
233 ??_C@_0101234567@?$za
235 ; CHECK-NEXT: ??_C@_0101234567@?$za
236 ; CHECK-NEXT: error: Invalid mangled name
238 ??_C@_0101234567@?$az
240 ; CHECK-NEXT: ??_C@_0101234567@?$az
241 ; CHECK-NEXT: error: Invalid mangled name
243 ??_C@_1201234567@a?$az
245 ; CHECK-NEXT: ??_C@_1201234567@a?$az
246 ; CHECK-NEXT: error: Invalid mangled name
251 ; CHECK-NEXT: error: Invalid mangled name
255 ; CHECK-NEXT: ?foo@@3YA@A
256 ; CHECK-NEXT: error: Invalid mangled name
260 ; CHECK-NEXT: ?foo@@3Y~01KA
261 ; CHECK-NEXT: error: Invalid mangled name
265 ; CHECK-NEXT: ?foo@@3Y0~1KA
266 ; CHECK-NEXT: error: Invalid mangled name
270 ; CHECK-NEXT: ?x@@3PEAY02$$CRHEA
271 ; CHECK-NEXT: error: Invalid mangled name
275 ; CHECK-NEXT: ?foo@@3_
276 ; CHECK-NEXT: error: Invalid mangled name
280 ; CHECK-NEXT: ?foo@@3_XA
281 ; CHECK-NEXT: error: Invalid mangled name
285 ; CHECK-NEXT: ?foo@@3Vbar
286 ; CHECK-NEXT: error: Invalid mangled name
290 ; CHECK-NEXT: ?foo@@3Vbar@
291 ; CHECK-NEXT: error: Invalid mangled name
295 ; CHECK-NEXT: ?foo@?A
296 ; CHECK-NEXT: error: Invalid mangled name
301 ; CHECK-NEXT: error: Invalid mangled name
305 ; CHECK-NEXT: ?foo@??
306 ; CHECK-NEXT: error: Invalid mangled name
310 ; CHECK-NEXT: ?foo@?XX?
311 ; CHECK-NEXT: error: Invalid mangled name
315 ; CHECK-NEXT: ?foo@?A@?
316 ; CHECK-NEXT: error: Invalid mangled name
320 ; CHECK-NEXT: ?foo@?Q@?
321 ; CHECK-NEXT: error: Invalid mangled name
325 ; CHECK-NEXT: ?foo@?BQ@?
326 ; CHECK-NEXT: error: Invalid mangled name
330 ; CHECK-NEXT: ?foo@?0?
331 ; CHECK-NEXT: error: Invalid mangled name
335 ; CHECK-NEXT: ??_Sfoo@@1Abar@@
336 ; CHECK-NEXT: error: Invalid mangled name
340 ; CHECK-NEXT: ??_Bfoo@@1
341 ; CHECK-NEXT: error: Invalid mangled name
346 ; CHECK-NEXT: error: Invalid mangled name
351 ; CHECK-NEXT: error: Invalid mangled name
355 ; CHECK-NEXT: ??_R0H@8foo
356 ; CHECK-NEXT: error: Invalid mangled name
360 ; CHECK-NEXT: ??_R1012?3foo@@
361 ; CHECK-NEXT: error: Invalid mangled name
365 ; CHECK-NEXT: ??_R2foo@@1
366 ; CHECK-NEXT: error: Invalid mangled name
371 ; CHECK-NEXT: error: Invalid mangled name
376 ; CHECK-NEXT: error: Invalid mangled name
380 ; CHECK-NEXT: .?AUBase@@@8
381 ; CHECK-NEXT: error: Invalid mangled name