1; Run llvm-undname with invalid inputs and make sure it doesn't crash.
2; RUN: not llvm-undname < %s 2>&1 | FileCheck %s
3
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
7
8?f0@@YAXPEU?$AS_@$00$$CAD@__clang@@@Z
9; CHECK-EMPTY:
10; CHECK-NEXT: ?f0@@YAXPEU?$AS_@$00$$CAD@__clang@@@Z
11; CHECK-NEXT: error: Invalid mangled name
12
13?@@8
14; CHECK-EMPTY:
15; CHECK-NEXT: ?@@8
16; CHECK-NEXT: error: Invalid mangled name
17
18??
19; CHECK-EMPTY:
20; CHECK-NEXT: ??
21; CHECK-NEXT: error: Invalid mangled name
22
23??0@
24; CHECK-EMPTY:
25; CHECK-NEXT: ??0@
26; CHECK-NEXT: error: Invalid mangled name
27
28? @@   YC@
29; CHECK-EMPTY:
30; CHECK-NEXT: ? @@   YC@
31; CHECK-NEXT: error: Invalid mangled name
32
33??B@$$J0
34; CHECK-EMPTY:
35; CHECK-NEXT: ??B@$$J0
36; CHECK-NEXT: error: Invalid mangled name
37
38??B@4
39; CHECK-EMPTY:
40; CHECK-NEXT: ??B@4
41; CHECK-NEXT: error: Invalid mangled name
42
43?A?@?@???B@4D
44; CHECK-EMPTY:
45; CHECK-NEXT: ?A?@?@???B@4D
46; CHECK-NEXT: error: Invalid mangled name
47
48?A?@?@???B@4DD
49; CHECK-EMPTY:
50; CHECK-NEXT: ?A?@?@???B@4DD
51; CHECK-NEXT: error: Invalid mangled name
52
53??$A@P15@
54; CHECK-EMPTY:
55; CHECK-NEXT: ??$A@P15@
56; CHECK-NEXT: error: Invalid mangled name
57
58??$A@P
59; CHECK-EMPTY:
60; CHECK-NEXT: ??$A@P
61; CHECK-NEXT: error: Invalid mangled name
62
63?A@@
64; CHECK-EMPTY:
65; CHECK-NEXT: ?A@@
66; CHECK-NEXT: error: Invalid mangled name
67
68?A@@P
69; CHECK-EMPTY:
70; CHECK-NEXT: ?A@@P
71; CHECK-NEXT: error: Invalid mangled name
72
73?A@@4PQA@@
74; CHECK-EMPTY:
75; CHECK-NEXT: ?A@@4PQA@@
76; CHECK-NEXT: error: Invalid mangled name
77
78??__E
79; CHECK-EMPTY:
80; CHECK-NEXT: ??__E
81; CHECK-NEXT: error: Invalid mangled name
82
83??__E@@
84; CHECK-EMPTY:
85; CHECK-NEXT: ??__E@@
86; CHECK-NEXT: error: Invalid mangled name
87
88??__E?Foo@@0HA@@
89; CHECK-EMPTY:
90; CHECK-NEXT: ??__E?Foo@@0HA@@
91; CHECK-NEXT: error: Invalid mangled name
92
93??__E?i@C@@0HA@
94; CHECK-EMPTY:
95; CHECK-NEXT: ??__E?i@C@@0HA@
96; CHECK-NEXT: error: Invalid mangled name
97
98??__E?Foo@@YAXXZ
99; CHECK-EMPTY:
100; CHECK-NEXT: ??__E?Foo@@YAXXZ
101; CHECK-NEXT: error: Invalid mangled name
102
103?foo@@YAH0@Z
104; CHECK-EMPTY:
105; CHECK-NEXT: ?foo@@YAH0@Z
106; CHECK-NEXT: error: Invalid mangled name
107
108?foo@@YAHH
109; CHECK-EMPTY:
110; CHECK-NEXT: ?foo@@YAHH
111; CHECK-NEXT: error: Invalid mangled name
112
113??8@8
114; CHECK-EMPTY:
115; CHECK-NEXT: ??8@8
116; CHECK-NEXT: error: Invalid mangled name
117
118?B@?$?K$H?
119; CHECK-EMPTY:
120; CHECK-NEXT: ?B@?$?K$H?
121; CHECK-NEXT: error: Invalid mangled name
122
123??C@$
124; CHECK-EMPTY:
125; CHECK-NEXT: ??C@$
126; CHECK-NEXT: error: Invalid mangled name
127
128?x@@3PAW
129; CHECK-EMPTY:
130; CHECK-NEXT: ?x@@3PAW
131; CHECK-NEXT: error: Invalid mangled name
132
133??}
134; CHECK-EMPTY:
135; CHECK-NEXT: ??}
136; CHECK-NEXT: error: Invalid mangled name
137
138?foo@?$?_
139; CHECK-EMPTY:
140; CHECK-NEXT: ?foo@?$?_
141; CHECK-NEXT: error: Invalid mangled name
142
143??_R4
144; CHECK-EMPTY:
145; CHECK-NEXT: ??_R4
146; CHECK-NEXT: error: Invalid mangled name
147
148??_R4foo@@
149; CHECK-EMPTY:
150; CHECK-NEXT: ??_R4foo@@
151; CHECK-NEXT: error: Invalid mangled name
152
153?foo@?$?BH@@QAEHXZ
154; CHECK-EMPTY:
155; CHECK-NEXT: ?foo@?$?BH@@QAEHXZ
156; CHECK-NEXT: error: Invalid mangled name
157
158?foo@?$?0H@
159; CHECK-EMPTY:
160; CHECK-NEXT: ?foo@?$?0H@
161; CHECK-NEXT: error: Invalid mangled name
162
163??_C@_0A@01234567@a
164; CHECK-EMPTY:
165; CHECK-NEXT: ??_C@_0A@01234567@a
166; CHECK-NEXT: error: Invalid mangled name
167
168??_C@_1A@01234567@a
169; CHECK-EMPTY:
170; CHECK-NEXT: ??_C@_1A@01234567@a
171; CHECK-NEXT: error: Invalid mangled name
172
173??_C@_0301234567@a
174; CHECK-EMPTY:
175; CHECK-NEXT: ??_C@_0301234567@a
176; CHECK-NEXT: error: Invalid mangled name
177
178??_C@_1301234567@a
179; CHECK-EMPTY:
180; CHECK-NEXT: ??_C@_1301234567@a
181; CHECK-NEXT: error: Invalid mangled name
182
183??_C@_0601234567@abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRTSUVWXYZabcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRTSUVWXYZabcdefghijklmnopqrtsuvwxyz
184; CHECK-EMPTY:
185; CHECK-NEXT: ??_C@_0601234567@abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRTSUVWXYZabcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRTSUVWXYZabcdefghijklmnopqrtsuvwxyz
186; CHECK-NEXT: error: Invalid mangled name
187
188??_C@_12@?z
189; CHECK-EMPTY:
190; CHECK-NEXT: ??_C@_12@?z
191; CHECK-NEXT: error: Invalid mangled name
192
193??$foo@$1??_C@_02PCEFGMJL@hi?$AA@@
194; CHECK-EMPTY:
195; CHECK-NEXT: ??$foo@$1??_C@_02PCEFGMJL@hi?$AA@@
196; CHECK-NEXT: error: Invalid mangled name
197
198??_C@
199; CHECK-EMPTY:
200; CHECK-NEXT: ??_C@
201; CHECK-NEXT: error: Invalid mangled name
202
203??_C@_
204; CHECK-EMPTY:
205; CHECK-NEXT: ??_C@_
206; CHECK-NEXT: error: Invalid mangled name
207
208??_C@_3
209; CHECK-EMPTY:
210; CHECK-NEXT: ??_C@_3
211; CHECK-NEXT: error: Invalid mangled name
212
213??_C@_01
214; CHECK-EMPTY:
215; CHECK-NEXT: ??_C@_01
216; CHECK-NEXT: error: Invalid mangled name
217
218??_C@_0101234567@
219; CHECK-EMPTY:
220; CHECK-NEXT: ??_C@_0101234567@
221; CHECK-NEXT: error: Invalid mangled name
222
223??_C@_0101234567@?
224; CHECK-EMPTY:
225; CHECK-NEXT: ??_C@_0101234567@?
226; CHECK-NEXT: error: Invalid mangled name
227
228??_C@_0101234567@?$
229; CHECK-EMPTY:
230; CHECK-NEXT: ??_C@_0101234567@?$
231; CHECK-NEXT: error: Invalid mangled name
232
233??_C@_0101234567@?$za
234; CHECK-EMPTY:
235; CHECK-NEXT: ??_C@_0101234567@?$za
236; CHECK-NEXT: error: Invalid mangled name
237
238??_C@_0101234567@?$az
239; CHECK-EMPTY:
240; CHECK-NEXT: ??_C@_0101234567@?$az
241; CHECK-NEXT: error: Invalid mangled name
242
243??_C@_1201234567@a?$az
244; CHECK-EMPTY:
245; CHECK-NEXT: ??_C@_1201234567@a?$az
246; CHECK-NEXT: error: Invalid mangled name
247
248??@foo
249; CHECK-EMPTY:
250; CHECK-NEXT: ??@foo
251; CHECK-NEXT: error: Invalid mangled name
252
253?foo@@3YA@A
254; CHECK-EMPTY:
255; CHECK-NEXT: ?foo@@3YA@A
256; CHECK-NEXT: error: Invalid mangled name
257
258?foo@@3Y~01KA
259; CHECK-EMPTY:
260; CHECK-NEXT: ?foo@@3Y~01KA
261; CHECK-NEXT: error: Invalid mangled name
262
263?foo@@3Y0~1KA
264; CHECK-EMPTY:
265; CHECK-NEXT: ?foo@@3Y0~1KA
266; CHECK-NEXT: error: Invalid mangled name
267
268?x@@3PEAY02$$CRHEA
269; CHECK-EMPTY:
270; CHECK-NEXT: ?x@@3PEAY02$$CRHEA
271; CHECK-NEXT: error: Invalid mangled name
272
273?foo@@3_
274; CHECK-EMPTY:
275; CHECK-NEXT: ?foo@@3_
276; CHECK-NEXT: error: Invalid mangled name
277
278?foo@@3_XA
279; CHECK-EMPTY:
280; CHECK-NEXT: ?foo@@3_XA
281; CHECK-NEXT: error: Invalid mangled name
282
283?foo@@3Vbar
284; CHECK-EMPTY:
285; CHECK-NEXT: ?foo@@3Vbar
286; CHECK-NEXT: error: Invalid mangled name
287
288?foo@@3Vbar@
289; CHECK-EMPTY:
290; CHECK-NEXT: ?foo@@3Vbar@
291; CHECK-NEXT: error: Invalid mangled name
292
293?foo@?A
294; CHECK-EMPTY:
295; CHECK-NEXT: ?foo@?A
296; CHECK-NEXT: error: Invalid mangled name
297
298?foo@?
299; CHECK-EMPTY:
300; CHECK-NEXT: ?foo@?
301; CHECK-NEXT: error: Invalid mangled name
302
303?foo@??
304; CHECK-EMPTY:
305; CHECK-NEXT: ?foo@??
306; CHECK-NEXT: error: Invalid mangled name
307
308?foo@?XX?
309; CHECK-EMPTY:
310; CHECK-NEXT: ?foo@?XX?
311; CHECK-NEXT: error: Invalid mangled name
312
313?foo@?A@?
314; CHECK-EMPTY:
315; CHECK-NEXT: ?foo@?A@?
316; CHECK-NEXT: error: Invalid mangled name
317
318?foo@?Q@?
319; CHECK-EMPTY:
320; CHECK-NEXT: ?foo@?Q@?
321; CHECK-NEXT: error: Invalid mangled name
322
323?foo@?BQ@?
324; CHECK-EMPTY:
325; CHECK-NEXT: ?foo@?BQ@?
326; CHECK-NEXT: error: Invalid mangled name
327
328?foo@?0?
329; CHECK-EMPTY:
330; CHECK-NEXT: ?foo@?0?
331; CHECK-NEXT: error: Invalid mangled name
332
333??_Sfoo@@1Abar@@
334; CHECK-EMPTY:
335; CHECK-NEXT: ??_Sfoo@@1Abar@@
336; CHECK-NEXT: error: Invalid mangled name
337
338??_Bfoo@@1
339; CHECK-EMPTY:
340; CHECK-NEXT: ??_Bfoo@@1
341; CHECK-NEXT: error: Invalid mangled name
342
343??_R0
344; CHECK-EMPTY:
345; CHECK-NEXT: ??_R0
346; CHECK-NEXT: error: Invalid mangled name
347
348??_R0H
349; CHECK-EMPTY:
350; CHECK-NEXT: ??_R0H
351; CHECK-NEXT: error: Invalid mangled name
352
353??_R0H@8foo
354; CHECK-EMPTY:
355; CHECK-NEXT: ??_R0H@8foo
356; CHECK-NEXT: error: Invalid mangled name
357
358??_R1012?3foo@@
359; CHECK-EMPTY:
360; CHECK-NEXT: ??_R1012?3foo@@
361; CHECK-NEXT: error: Invalid mangled name
362
363??_R2foo@@1
364; CHECK-EMPTY:
365; CHECK-NEXT: ??_R2foo@@1
366; CHECK-NEXT: error: Invalid mangled name
367
368??_A
369; CHECK-EMPTY:
370; CHECK-NEXT: ??_A
371; CHECK-NEXT: error: Invalid mangled name
372
373??_P
374; CHECK-EMPTY:
375; CHECK-NEXT: ??_P
376; CHECK-NEXT: error: Invalid mangled name
377
378.?AUBase@@@8
379; CHECK-EMPTY:
380; CHECK-NEXT: .?AUBase@@@8
381; CHECK-NEXT: error: Invalid mangled name
382