include/mscvpdb.h: Use flexible array members for the rest of structures.
[wine.git] / dlls / msvcrt / tests / cpp.c
blobbfc092e0591084b006da6f62a5280201ba8d87f7
1 /* Unit test suite for msvcrt C++ objects
3 * Copyright 2003 Jon Griffiths
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include "wine/test.h"
20 #include "winbase.h"
21 #include "winnt.h"
23 typedef void (*vtable_ptr)(void);
25 typedef struct __exception
27 vtable_ptr *vtable;
28 char *name;
29 int do_free;
30 } exception;
32 typedef struct __type_info
34 vtable_ptr *vtable;
35 char *name;
36 char mangled[16];
37 } type_info;
39 #undef __thiscall
40 #ifdef __i386__
41 #define __thiscall __stdcall
42 #else
43 #define __thiscall __cdecl
44 #endif
46 /* Function pointers. We need to use these to call these funcs as __thiscall */
47 static void* (__cdecl *poperator_new)(size_t);
48 static void (__cdecl *poperator_delete)(void*);
50 /* exception */
51 static void (__thiscall *pexception_ctor)(exception*,LPCSTR*);
52 static void (__thiscall *pexception_copy_ctor)(exception*,exception*);
53 static void (__thiscall *pexception_default_ctor)(exception*);
54 static void (__thiscall *pexception_dtor)(exception*);
55 static exception* (__thiscall *pexception_opequals)(exception*,exception*);
56 static char* (__thiscall *pexception_what)(exception*);
57 static vtable_ptr *pexception_vtable;
58 static void (__thiscall *pexception_vector_dtor)(exception*,unsigned int);
59 static void (__thiscall *pexception_scalar_dtor)(exception*,unsigned int);
61 /* bad_typeid */
62 static void (__thiscall *pbad_typeid_ctor)(exception*,LPCSTR);
63 static void (__thiscall *pbad_typeid_ctor_closure)(exception*);
64 static void (__thiscall *pbad_typeid_copy_ctor)(exception*,exception*);
65 static void (__thiscall *pbad_typeid_dtor)(exception*);
66 static exception* (__thiscall *pbad_typeid_opequals)(exception*,exception*);
67 static char* (__thiscall *pbad_typeid_what)(exception*);
68 static vtable_ptr *pbad_typeid_vtable;
69 static void (__thiscall *pbad_typeid_vector_dtor)(exception*,unsigned int);
70 static void (__thiscall *pbad_typeid_scalar_dtor)(exception*,unsigned int);
72 /* bad_cast */
73 static void (__thiscall *pbad_cast_ctor)(exception*,LPCSTR*);
74 static void (__thiscall *pbad_cast_ctor2)(exception*,LPCSTR);
75 static void (__thiscall *pbad_cast_ctor_closure)(exception*);
76 static void (__thiscall *pbad_cast_copy_ctor)(exception*,exception*);
77 static void (__thiscall *pbad_cast_dtor)(exception*);
78 static exception* (__thiscall *pbad_cast_opequals)(exception*,exception*);
79 static char* (__thiscall *pbad_cast_what)(exception*);
80 static vtable_ptr *pbad_cast_vtable;
81 static void (__thiscall *pbad_cast_vector_dtor)(exception*,unsigned int);
82 static void (__thiscall *pbad_cast_scalar_dtor)(exception*,unsigned int);
84 /* __non_rtti_object */
85 static void (__thiscall *p__non_rtti_object_ctor)(exception*,LPCSTR);
86 static void (__thiscall *p__non_rtti_object_copy_ctor)(exception*,exception*);
87 static void (__thiscall *p__non_rtti_object_dtor)(exception*);
88 static exception* (__thiscall *p__non_rtti_object_opequals)(exception*,exception*);
89 static char* (__thiscall *p__non_rtti_object_what)(exception*);
90 static vtable_ptr *p__non_rtti_object_vtable;
91 static void (__thiscall *p__non_rtti_object_vector_dtor)(exception*,unsigned int);
92 static void (__thiscall *p__non_rtti_object_scalar_dtor)(exception*,unsigned int);
94 /* type_info */
95 static void (__thiscall *ptype_info_dtor)(type_info*);
96 static char* (__thiscall *ptype_info_raw_name)(type_info*);
97 static char* (__thiscall *ptype_info_name)(type_info*);
98 static int (__thiscall *ptype_info_before)(type_info*,type_info*);
99 static int (__thiscall *ptype_info_opequals_equals)(type_info*,type_info*);
100 static int (__thiscall *ptype_info_opnot_equals)(type_info*,type_info*);
102 /* RTTI */
103 static type_info* (__cdecl *p__RTtypeid)(void*);
104 static void* (__cdecl *p__RTCastToVoid)(void*);
105 static void* (__cdecl *p__RTDynamicCast)(void*,int,void*,void*,int);
107 /*Demangle*/
108 static char* (__cdecl *p__unDName)(char*,const char*,int,void*,void*,unsigned short int);
111 /* Emulate a __thiscall */
112 #ifdef __i386__
114 #include "pshpack1.h"
115 struct thiscall_thunk
117 BYTE pop_eax; /* popl %eax (ret addr) */
118 BYTE pop_edx; /* popl %edx (func) */
119 BYTE pop_ecx; /* popl %ecx (this) */
120 BYTE push_eax; /* pushl %eax */
121 WORD jmp_edx; /* jmp *%edx */
123 #include "poppack.h"
125 static void * (WINAPI *call_thiscall_func1)( void *func, void *this );
126 static void * (WINAPI *call_thiscall_func2)( void *func, void *this, const void *a );
128 static void init_thiscall_thunk(void)
130 struct thiscall_thunk *thunk = VirtualAlloc( NULL, sizeof(*thunk),
131 MEM_COMMIT, PAGE_EXECUTE_READWRITE );
132 thunk->pop_eax = 0x58; /* popl %eax */
133 thunk->pop_edx = 0x5a; /* popl %edx */
134 thunk->pop_ecx = 0x59; /* popl %ecx */
135 thunk->push_eax = 0x50; /* pushl %eax */
136 thunk->jmp_edx = 0xe2ff; /* jmp *%edx */
137 call_thiscall_func1 = (void *)thunk;
138 call_thiscall_func2 = (void *)thunk;
141 #define call_func1(func,_this) call_thiscall_func1(func,_this)
142 #define call_func2(func,_this,a) call_thiscall_func2(func,_this,(const void*)(a))
144 #else
146 #define init_thiscall_thunk() do { } while(0)
147 #define call_func1(func,_this) func(_this)
148 #define call_func2(func,_this,a) func(_this,a)
150 #endif /* __i386__ */
152 /* Some exports are only available in later versions */
153 #define SETNOFAIL(x,y) x = (void*)GetProcAddress(hmsvcrt,y)
154 #define SET(x,y) do { SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y); } while(0)
156 static BOOL InitFunctionPtrs(void)
158 HMODULE hmsvcrt = GetModuleHandleA("msvcrt.dll");
160 SET(pexception_vtable, "??_7exception@@6B@");
161 SET(pbad_typeid_vtable, "??_7bad_typeid@@6B@");
162 SET(pbad_cast_vtable, "??_7bad_cast@@6B@");
163 SET(p__non_rtti_object_vtable, "??_7__non_rtti_object@@6B@");
165 SET(p__RTtypeid, "__RTtypeid");
166 SET(p__RTCastToVoid, "__RTCastToVoid");
167 SET(p__RTDynamicCast, "__RTDynamicCast");
169 SET(p__unDName,"__unDName");
171 /* Extremely early versions export logic_error, and crash in RTTI */
172 if (sizeof(void *) > sizeof(int)) /* 64-bit initialization */
174 SETNOFAIL(poperator_new, "??_U@YAPEAX_K@Z");
175 SETNOFAIL(poperator_delete, "??_V@YAXPEAX@Z");
177 SET(pexception_ctor, "??0exception@@QEAA@AEBQEBD@Z");
178 SET(pexception_copy_ctor, "??0exception@@QEAA@AEBV0@@Z");
179 SET(pexception_default_ctor, "??0exception@@QEAA@XZ");
180 SET(pexception_dtor, "??1exception@@UEAA@XZ");
181 SET(pexception_opequals, "??4exception@@QEAAAEAV0@AEBV0@@Z");
182 SET(pexception_what, "?what@exception@@UEBAPEBDXZ");
183 pexception_vector_dtor = (void*)pexception_vtable[0];
184 pexception_scalar_dtor = (void*)pexception_vtable[0];
186 SET(pbad_typeid_ctor, "??0bad_typeid@@QEAA@PEBD@Z");
187 SETNOFAIL(pbad_typeid_ctor_closure, "??_Fbad_typeid@@QEAAXXZ");
188 SET(pbad_typeid_copy_ctor, "??0bad_typeid@@QEAA@AEBV0@@Z");
189 SET(pbad_typeid_dtor, "??1bad_typeid@@UEAA@XZ");
190 SET(pbad_typeid_opequals, "??4bad_typeid@@QEAAAEAV0@AEBV0@@Z");
191 SET(pbad_typeid_what, "?what@exception@@UEBAPEBDXZ");
192 pbad_typeid_vector_dtor = (void*)pbad_typeid_vtable[0];
193 pbad_typeid_scalar_dtor = (void*)pbad_typeid_vtable[0];
195 SET(pbad_cast_ctor, "??0bad_cast@@QEAA@AEBQEBD@Z");
196 SET(pbad_cast_ctor2, "??0bad_cast@@QEAA@PEBD@Z");
197 SET(pbad_cast_ctor_closure, "??_Fbad_cast@@QEAAXXZ");
198 SET(pbad_cast_copy_ctor, "??0bad_cast@@QEAA@AEBV0@@Z");
199 SET(pbad_cast_dtor, "??1bad_cast@@UEAA@XZ");
200 SET(pbad_cast_opequals, "??4bad_cast@@QEAAAEAV0@AEBV0@@Z");
201 SET(pbad_cast_what, "?what@exception@@UEBAPEBDXZ");
202 pbad_cast_vector_dtor = (void*)pbad_cast_vtable[0];
203 pbad_cast_scalar_dtor = (void*)pbad_cast_vtable[0];
205 SET(p__non_rtti_object_ctor, "??0__non_rtti_object@@QEAA@PEBD@Z");
206 SET(p__non_rtti_object_copy_ctor, "??0__non_rtti_object@@QEAA@AEBV0@@Z");
207 SET(p__non_rtti_object_dtor, "??1__non_rtti_object@@UEAA@XZ");
208 SET(p__non_rtti_object_opequals, "??4__non_rtti_object@@QEAAAEAV0@AEBV0@@Z");
209 SET(p__non_rtti_object_what, "?what@exception@@UEBAPEBDXZ");
210 p__non_rtti_object_vector_dtor = (void*)p__non_rtti_object_vtable[0];
211 p__non_rtti_object_scalar_dtor = (void*)p__non_rtti_object_vtable[0];
213 SET(ptype_info_dtor, "??1type_info@@UEAA@XZ");
214 SET(ptype_info_raw_name, "?raw_name@type_info@@QEBAPEBDXZ");
215 SET(ptype_info_name, "?name@type_info@@QEBAPEBDXZ");
216 SET(ptype_info_before, "?before@type_info@@QEBAHAEBV1@@Z");
217 SET(ptype_info_opequals_equals, "??8type_info@@QEBAHAEBV0@@Z");
218 SET(ptype_info_opnot_equals, "??9type_info@@QEBAHAEBV0@@Z");
220 else
222 #ifdef __arm__
223 SETNOFAIL(poperator_new, "??_U@YAPAXI@Z");
224 SETNOFAIL(poperator_delete, "??_V@YAXPAX@Z");
226 SET(pexception_ctor, "??0exception@@QAA@ABQBD@Z");
227 SET(pexception_copy_ctor, "??0exception@@QAA@ABV0@@Z");
228 SET(pexception_default_ctor, "??0exception@@QAA@XZ");
229 SET(pexception_dtor, "??1exception@@UAA@XZ");
230 SET(pexception_opequals, "??4exception@@QAAAAV0@ABV0@@Z");
231 SET(pexception_what, "?what@exception@@UBAPBDXZ");
232 pexception_vector_dtor = (void*)pexception_vtable[0];
233 pexception_scalar_dtor = (void*)pexception_vtable[0];
235 SET(pbad_typeid_ctor, "??0bad_typeid@@QAA@PBD@Z");
236 SETNOFAIL(pbad_typeid_ctor_closure, "??_Fbad_typeid@@QAAXXZ");
237 SET(pbad_typeid_copy_ctor, "??0bad_typeid@@QAA@ABV0@@Z");
238 SET(pbad_typeid_dtor, "??1bad_typeid@@UAA@XZ");
239 SET(pbad_typeid_opequals, "??4bad_typeid@@QAAAAV0@ABV0@@Z");
240 SET(pbad_typeid_what, "?what@exception@@UBAPBDXZ");
241 pbad_typeid_vector_dtor = (void*)pbad_typeid_vtable[0];
242 pbad_typeid_scalar_dtor = (void*)pbad_typeid_vtable[0];
244 SETNOFAIL(pbad_cast_ctor, "??0bad_cast@@QAE@ABQBD@Z");
245 if (!pbad_cast_ctor)
246 SET(pbad_cast_ctor, "??0bad_cast@@AAA@PBQBD@Z");
247 SETNOFAIL(pbad_cast_ctor2, "??0bad_cast@@QAA@PBD@Z");
248 SETNOFAIL(pbad_cast_ctor_closure, "??_Fbad_cast@@QAAXXZ");
249 SET(pbad_cast_copy_ctor, "??0bad_cast@@QAA@ABV0@@Z");
250 SET(pbad_cast_dtor, "??1bad_cast@@UAA@XZ");
251 SET(pbad_cast_opequals, "??4bad_cast@@QAAAAV0@ABV0@@Z");
252 SET(pbad_cast_what, "?what@exception@@UBAPBDXZ");
253 pbad_cast_vector_dtor = (void*)pbad_cast_vtable[0];
254 pbad_cast_scalar_dtor = (void*)pbad_cast_vtable[0];
256 SET(p__non_rtti_object_ctor, "??0__non_rtti_object@@QAA@PBD@Z");
257 SET(p__non_rtti_object_copy_ctor, "??0__non_rtti_object@@QAA@ABV0@@Z");
258 SET(p__non_rtti_object_dtor, "??1__non_rtti_object@@UAA@XZ");
259 SET(p__non_rtti_object_opequals, "??4__non_rtti_object@@QAAAAV0@ABV0@@Z");
260 SET(p__non_rtti_object_what, "?what@exception@@UBAPBDXZ");
261 p__non_rtti_object_vector_dtor = (void*)p__non_rtti_object_vtable[0];
262 p__non_rtti_object_scalar_dtor = (void*)p__non_rtti_object_vtable[0];
264 SET(ptype_info_dtor, "??1type_info@@UAA@XZ");
265 SET(ptype_info_raw_name, "?raw_name@type_info@@QBAPBDXZ");
266 SET(ptype_info_name, "?name@type_info@@QBAPBDXZ");
267 SET(ptype_info_before, "?before@type_info@@QBAHABV1@@Z");
268 SET(ptype_info_opequals_equals, "??8type_info@@QBAHABV0@@Z");
269 SET(ptype_info_opnot_equals, "??9type_info@@QBAHABV0@@Z");
270 #else
271 SETNOFAIL(poperator_new, "??_U@YAPAXI@Z");
272 SETNOFAIL(poperator_delete, "??_V@YAXPAX@Z");
274 SET(pexception_ctor, "??0exception@@QAE@ABQBD@Z");
275 SET(pexception_copy_ctor, "??0exception@@QAE@ABV0@@Z");
276 SET(pexception_default_ctor, "??0exception@@QAE@XZ");
277 SET(pexception_dtor, "??1exception@@UAE@XZ");
278 SET(pexception_opequals, "??4exception@@QAEAAV0@ABV0@@Z");
279 SET(pexception_what, "?what@exception@@UBEPBDXZ");
280 SET(pexception_vector_dtor, "??_Eexception@@UAEPAXI@Z");
281 SET(pexception_scalar_dtor, "??_Gexception@@UAEPAXI@Z");
283 SET(pbad_typeid_ctor, "??0bad_typeid@@QAE@PBD@Z");
284 SETNOFAIL(pbad_typeid_ctor_closure, "??_Fbad_typeid@@QAEXXZ");
285 SET(pbad_typeid_copy_ctor, "??0bad_typeid@@QAE@ABV0@@Z");
286 SET(pbad_typeid_dtor, "??1bad_typeid@@UAE@XZ");
287 SET(pbad_typeid_opequals, "??4bad_typeid@@QAEAAV0@ABV0@@Z");
288 SET(pbad_typeid_what, "?what@exception@@UBEPBDXZ");
289 SET(pbad_typeid_vector_dtor, "??_Ebad_typeid@@UAEPAXI@Z");
290 SET(pbad_typeid_scalar_dtor, "??_Gbad_typeid@@UAEPAXI@Z");
292 SETNOFAIL(pbad_cast_ctor, "??0bad_cast@@QAE@ABQBD@Z");
293 if (!pbad_cast_ctor)
294 SET(pbad_cast_ctor, "??0bad_cast@@AAE@PBQBD@Z");
295 SETNOFAIL(pbad_cast_ctor2, "??0bad_cast@@QAE@PBD@Z");
296 SETNOFAIL(pbad_cast_ctor_closure, "??_Fbad_cast@@QAEXXZ");
297 SET(pbad_cast_copy_ctor, "??0bad_cast@@QAE@ABV0@@Z");
298 SET(pbad_cast_dtor, "??1bad_cast@@UAE@XZ");
299 SET(pbad_cast_opequals, "??4bad_cast@@QAEAAV0@ABV0@@Z");
300 SET(pbad_cast_what, "?what@exception@@UBEPBDXZ");
301 SET(pbad_cast_vector_dtor, "??_Ebad_cast@@UAEPAXI@Z");
302 SET(pbad_cast_scalar_dtor, "??_Gbad_cast@@UAEPAXI@Z");
304 SET(p__non_rtti_object_ctor, "??0__non_rtti_object@@QAE@PBD@Z");
305 SET(p__non_rtti_object_copy_ctor, "??0__non_rtti_object@@QAE@ABV0@@Z");
306 SET(p__non_rtti_object_dtor, "??1__non_rtti_object@@UAE@XZ");
307 SET(p__non_rtti_object_opequals, "??4__non_rtti_object@@QAEAAV0@ABV0@@Z");
308 SET(p__non_rtti_object_what, "?what@exception@@UBEPBDXZ");
309 SET(p__non_rtti_object_vector_dtor, "??_E__non_rtti_object@@UAEPAXI@Z");
310 SET(p__non_rtti_object_scalar_dtor, "??_G__non_rtti_object@@UAEPAXI@Z");
312 SET(ptype_info_dtor, "??1type_info@@UAE@XZ");
313 SET(ptype_info_raw_name, "?raw_name@type_info@@QBEPBDXZ");
314 SET(ptype_info_name, "?name@type_info@@QBEPBDXZ");
315 SET(ptype_info_before, "?before@type_info@@QBEHABV1@@Z");
316 SET(ptype_info_opequals_equals, "??8type_info@@QBEHABV0@@Z");
317 SET(ptype_info_opnot_equals, "??9type_info@@QBEHABV0@@Z");
318 #endif /* __arm__ */
321 if (!poperator_new)
322 poperator_new = malloc;
323 if (!poperator_delete)
324 poperator_delete = free;
326 init_thiscall_thunk();
327 return TRUE;
330 static void test_exception(void)
332 static const char* e_name = "An exception name";
333 char* name;
334 exception e, e2, e3, *pe;
336 if (!poperator_new || !poperator_delete ||
337 !pexception_ctor || !pexception_copy_ctor || !pexception_default_ctor ||
338 !pexception_dtor || !pexception_opequals || !pexception_what ||
339 !pexception_vtable || !pexception_vector_dtor || !pexception_scalar_dtor)
340 return;
342 /* 'const char*&' ctor */
343 memset(&e, 0, sizeof(e));
344 call_func2(pexception_ctor, &e, &e_name);
345 ok(e.vtable != NULL, "Null exception vtable for e\n");
346 ok(e.name && e.name != e_name && !strcmp(e.name, "An exception name"), "Bad name '%s' for e\n", e.name);
347 ok(e.do_free == 1, "do_free set to %d for e\n", e.do_free);
349 /* Copy ctor */
350 memset(&e2, 0, sizeof(e2));
351 call_func2(pexception_copy_ctor, &e2, &e);
352 ok(e2.vtable != NULL, "Null exception vtable for e2\n");
353 ok(e2.name && e2.name != e.name && !strcmp(e2.name, "An exception name"), "Bad exception name for e2\n");
354 ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
356 /* Default ctor */
357 memset(&e3, 1, sizeof(e3));
358 call_func1(pexception_default_ctor, &e3);
359 ok(e3.vtable != NULL, "Null exception vtable for e3\n");
360 ok(e3.name == NULL, "Bad exception name for e3\n");
361 ok(e3.do_free == 0, "do_free set to %d for e3\n", e3.do_free);
363 ok(e.vtable == e2.vtable && e.vtable == e3.vtable, "exception vtables differ!\n");
365 /* Test calling the dtors */
366 call_func1(pexception_dtor, &e2);
367 call_func1(pexception_dtor, &e3);
369 /* Operator equals */
370 memset(&e2, 0, sizeof(e2));
371 call_func1(pexception_default_ctor, &e2);
372 pe = call_func2(pexception_opequals, &e2, &e);
373 ok(e2.vtable != NULL, "Null exception vtable for e2\n");
374 ok(e2.name && e2.name != e.name && !strcmp(e2.name, "An exception name"), "Bad exception name for e2\n");
375 ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
376 ok(pe == &e2, "opequals didn't return e2\n");
378 /* what() */
379 name = call_func1(pexception_what, &e2);
380 ok(e2.name == name, "Bad exception name from e2::what()\n");
382 /* vtable ptr */
383 ok(e2.vtable == pexception_vtable, "Bad vtable for e2\n");
384 call_func1(pexception_dtor, &e2);
386 /* new() */
387 pe = poperator_new(sizeof(exception));
388 ok(pe != NULL, "new() failed\n");
389 if (pe)
391 call_func2(pexception_ctor, pe, &e_name);
392 /* scalar dtor */
393 call_func2(pexception_scalar_dtor, pe, 0); /* Shouldn't delete pe */
394 pe->name = NULL;
395 pe->do_free = 0;
396 call_func2(pexception_scalar_dtor, pe, 1); /* Should delete pe */
399 pe = poperator_new(sizeof(exception));
400 ok(pe != NULL, "new() failed\n");
401 if (pe)
403 /* vector dtor, single element */
404 call_func2(pexception_ctor, pe, &e_name);
405 call_func2(pexception_vector_dtor, pe, 1); /* Should delete pe as single element*/
408 pe = poperator_new(sizeof(exception) * 4 + sizeof(size_t));
409 ok(pe != NULL, "new() failed\n");
410 if (pe)
412 /* vector dtor, multiple elements */
413 char name[] = "a constant";
414 *((size_t*)pe) = 3;
415 pe = (exception*)((size_t*)pe + 1);
416 call_func2(pexception_ctor, &pe[0], &e_name);
417 call_func2(pexception_ctor, &pe[1], &e_name);
418 call_func2(pexception_ctor, &pe[2], &e_name);
419 pe[3].name = name;
420 pe[3].do_free = 1; /* Crash if we try to free this */
421 call_func2(pexception_vector_dtor, pe, 3); /* Should delete all 3 and then pe block */
424 /* test our exported vtable is kosher */
425 pe = (void*)pexception_vtable; /* Use the exception struct to get vtable ptrs */
426 pexception_vector_dtor = (void*)pe->vtable;
427 pexception_what = (void*)pe->name;
429 name = call_func1(pexception_what, &e);
430 ok(e.name == name, "Bad exception name from vtable e::what()\n");
432 if (p__RTtypeid)
434 /* Check the rtti */
435 type_info *ti = p__RTtypeid(&e);
436 ok (ti && !strcmp(ti->mangled, ".?AVexception@@"), "bad rtti for e\n");
438 if (ti)
440 /* Check the returned type_info has rtti too */
441 type_info *ti2 = p__RTtypeid(ti);
442 ok (ti2 != NULL && !strcmp(ti2->mangled, ".?AVtype_info@@"), "bad rtti for e's type_info\n");
446 call_func2(pexception_vector_dtor, &e, 0); /* Should delete e.name, but not e */
449 /* This test is basically a cut 'n' paste of the exception test. but it verifies that
450 * bad_typeid works the exact same way... */
451 static void test_bad_typeid(void)
453 static const char* e_name = "A bad_typeid name";
454 char* name;
455 exception e, e2, e3, *pe;
457 if (!poperator_new || !poperator_delete ||
458 !pbad_typeid_ctor || !pbad_typeid_copy_ctor ||
459 !pbad_typeid_dtor || !pbad_typeid_opequals || !pbad_typeid_what ||
460 !pbad_typeid_vtable || !pbad_typeid_vector_dtor || !pbad_typeid_scalar_dtor)
461 return;
463 /* 'const char*' ctor */
464 memset(&e, 0, sizeof(e));
465 call_func2(pbad_typeid_ctor, &e, e_name);
466 ok(e.vtable != NULL, "Null bad_typeid vtable for e\n");
467 ok(e.name && e.name != e_name && !strcmp(e.name, "A bad_typeid name"), "Bad name '%s' for e\n", e.name);
468 ok(e.do_free == 1, "do_free set to %d for e\n", e.do_free);
470 /* Copy ctor */
471 memset(&e2, 0, sizeof(e2));
472 call_func2(pbad_typeid_copy_ctor, &e2, &e);
473 ok(e2.vtable != NULL, "Null bad_typeid vtable for e2\n");
474 ok(e2.name && e2.name != e.name && !strcmp(e2.name, "A bad_typeid name"), "Bad name '%s' for e2\n", e2.name);
475 ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
477 /* Ctor closure */
478 if (pbad_typeid_ctor_closure)
480 memset(&e3, 1, sizeof(e3));
481 call_func1(pbad_typeid_ctor_closure, &e3);
482 ok(e3.vtable != NULL, "Null bad_typeid vtable for e3\n");
483 ok(e3.name && !strcmp(e3.name, "bad typeid"), "Bad bad_typeid name for e3\n");
484 ok(e3.do_free == 1, "do_free set to %d for e3\n", e3.do_free);
485 ok(e.vtable == e3.vtable, "bad_typeid closure vtables differ!\n");
486 call_func1(pbad_typeid_dtor, &e3);
488 ok(e.vtable == e2.vtable, "bad_typeid vtables differ!\n");
490 /* Test calling the dtors */
491 call_func1(pbad_typeid_dtor, &e2);
493 /* Operator equals */
494 memset(&e2, 1, sizeof(e2));
495 call_func1(pexception_default_ctor, &e2);
496 pe = call_func2(pbad_typeid_opequals, &e2, &e);
497 ok(e2.vtable != NULL, "Null bad_typeid vtable for e2\n");
498 ok(e2.name && e2.name != e.name && !strcmp(e2.name, "A bad_typeid name"), "Bad bad_typeid name for e2\n");
499 ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
500 ok(pe == &e2, "opequals didn't return e2\n");
502 /* what() */
503 name = call_func1(pbad_typeid_what, &e2);
504 ok(e2.name == name, "Bad bad_typeid name from e2::what()\n");
506 /* vtable ptr */
507 ok(e2.vtable == pexception_vtable, "Bad vtable for e2\n");
508 call_func1(pbad_typeid_dtor, &e2);
510 /* new() */
511 pe = poperator_new(sizeof(exception));
512 ok(pe != NULL, "new() failed\n");
513 if (pe)
515 call_func2(pbad_typeid_ctor, pe, e_name);
516 /* scalar dtor */
517 call_func2(pbad_typeid_scalar_dtor, pe, 0); /* Shouldn't delete pe */
518 pe->name = NULL;
519 pe->do_free = 0;
520 call_func2(pbad_typeid_scalar_dtor, pe, 1); /* Should delete pe */
523 pe = poperator_new(sizeof(exception));
524 ok(pe != NULL, "new() failed\n");
525 if (pe)
527 /* vector dtor, single element */
528 call_func2(pbad_typeid_ctor, pe, e_name);
529 call_func2(pbad_typeid_vector_dtor, pe, 1); /* Should delete pe as single element*/
532 pe = poperator_new(sizeof(exception) * 4 + sizeof(size_t));
533 ok(pe != NULL, "new() failed\n");
534 if (pe)
536 /* vector dtor, multiple elements */
537 *((size_t*)pe) = 3;
538 pe = (exception*)((size_t*)pe + 1);
539 call_func2(pbad_typeid_ctor, &pe[0], e_name);
540 call_func2(pbad_typeid_ctor, &pe[1], e_name);
541 call_func2(pbad_typeid_ctor, &pe[2], e_name);
542 pe[3].name = 0;
543 pe[3].do_free = 1; /* Crash if we try to free this element */
544 call_func2(pbad_typeid_vector_dtor, pe, 3); /* Should delete all 3 and then pe block */
547 /* test our exported vtable is kosher */
548 pe = (void*)pbad_typeid_vtable; /* Use the exception struct to get vtable ptrs */
549 pbad_typeid_vector_dtor = (void*)pe->vtable;
550 pbad_typeid_what = (void*)pe->name;
552 name = call_func1(pbad_typeid_what, &e);
553 ok(e.name == name, "Bad bad_typeid name from vtable e::what()\n");
555 if (p__RTtypeid)
557 /* Check the rtti */
558 type_info *ti = p__RTtypeid(&e);
559 ok (ti != NULL && !strcmp(ti->mangled, ".?AVbad_typeid@@"), "bad rtti for e (%s)\n",
560 !ti ? "null" : ti->mangled);
563 call_func2(pbad_typeid_vector_dtor, &e, 0); /* Should delete e.name, but not e */
567 /* Ditto for this test... */
568 static void test_bad_cast(void)
570 static const char* e_name = "A bad_cast name";
571 char* name;
572 exception e, e2, e3, *pe;
574 if (!poperator_new || !poperator_delete ||
575 !pbad_cast_ctor || !pbad_cast_copy_ctor ||
576 !pbad_cast_dtor || !pbad_cast_opequals || !pbad_cast_what ||
577 !pbad_cast_vtable || !pbad_cast_vector_dtor || !pbad_cast_scalar_dtor)
578 return;
580 if (pbad_cast_ctor2)
582 /* 'const char*' ctor */
583 memset(&e, 0, sizeof(e));
584 call_func2(pbad_cast_ctor2, &e, e_name);
585 ok(e.vtable != NULL, "Null bad_cast vtable for e\n");
586 ok(e.name && e.name != e_name && !strcmp(e.name, "A bad_cast name"), "Bad name '%s' for e\n", e.name);
587 ok(e.do_free == 1, "do_free set to %d for e\n", e.do_free);
588 call_func1(pbad_cast_dtor, &e);
591 /* 'const char*&' ctor */
592 memset(&e, 0, sizeof(e));
593 call_func2(pbad_cast_ctor, &e, &e_name);
594 ok(e.vtable != NULL, "Null bad_cast vtable for e\n");
595 ok(e.name && e.name != e_name && !strcmp(e.name, "A bad_cast name"), "Bad name '%s' for e\n", e.name);
596 ok(e.do_free == 1, "do_free set to %d for e\n", e.do_free);
598 /* Copy ctor */
599 memset(&e2, 0, sizeof(e2));
600 call_func2(pbad_cast_copy_ctor, &e2, &e);
601 ok(e2.vtable != NULL, "Null bad_cast vtable for e2\n");
602 ok(e2.name && e2.name != e.name && !strcmp(e2.name, "A bad_cast name"), "Bad name '%s' for e2\n", e2.name);
603 ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
605 /* Ctor closure */
606 if (pbad_cast_ctor_closure)
608 memset(&e3, 1, sizeof(e3));
609 call_func1(pbad_cast_ctor_closure, &e3);
610 ok(e3.vtable != NULL, "Null bad_cast vtable for e3\n");
611 ok(e3.name && !strcmp(e3.name, "bad cast"), "Bad bad_cast name for e3\n");
612 ok(e3.do_free == 1, "do_free set to %d for e3\n", e3.do_free);
613 ok(e.vtable == e3.vtable, "bad_cast closure vtables differ!\n");
614 call_func1(pbad_cast_dtor, &e3);
616 ok(e.vtable == e2.vtable, "bad_cast vtables differ!\n");
618 /* Test calling the dtors */
619 call_func1(pbad_cast_dtor, &e2);
621 /* Operator equals */
622 memset(&e2, 1, sizeof(e2));
623 call_func1(pexception_default_ctor, &e2);
624 pe = call_func2(pbad_cast_opequals, &e2, &e);
625 ok(e2.vtable != NULL, "Null bad_cast vtable for e2\n");
626 ok(e2.name && e2.name != e.name && !strcmp(e2.name, "A bad_cast name"), "Bad bad_cast name for e2\n");
627 ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
628 ok(pe == &e2, "opequals didn't return e2\n");
630 /* what() */
631 name = call_func1(pbad_cast_what, &e2);
632 ok(e2.name == name, "Bad bad_cast name from e2::what()\n");
634 /* vtable ptr */
635 ok(e2.vtable == pexception_vtable, "Bad vtable for e2\n");
636 call_func1(pbad_cast_dtor, &e2);
638 /* new() */
639 pe = poperator_new(sizeof(exception));
640 ok(pe != NULL, "new() failed\n");
641 if (pe)
643 call_func2(pbad_cast_ctor, pe, &e_name);
644 /* scalar dtor */
645 call_func2(pbad_cast_scalar_dtor, pe, 0); /* Shouldn't delete pe */
646 pe->name = NULL;
647 pe->do_free = 0;
648 call_func2(pbad_cast_scalar_dtor, pe, 1); /* Should delete pe */
651 pe = poperator_new(sizeof(exception));
652 ok(pe != NULL, "new() failed\n");
653 if (pe)
655 /* vector dtor, single element */
656 call_func2(pbad_cast_ctor, pe, &e_name);
657 call_func2(pbad_cast_vector_dtor, pe, 1); /* Should delete pe as single element*/
660 pe = poperator_new(sizeof(exception) * 4 + sizeof(size_t));
661 ok(pe != NULL, "new() failed\n");
662 if (pe)
664 /* vector dtor, multiple elements */
665 *((size_t*)pe) = 3;
666 pe = (exception*)((size_t*)pe + 1);
667 call_func2(pbad_cast_ctor, &pe[0], &e_name);
668 call_func2(pbad_cast_ctor, &pe[1], &e_name);
669 call_func2(pbad_cast_ctor, &pe[2], &e_name);
670 pe[3].name = 0;
671 pe[3].do_free = 1; /* Crash if we try to free this element */
672 call_func2(pbad_cast_vector_dtor, pe, 3); /* Should delete all 3 and then pe block */
675 /* test our exported vtable is kosher */
676 pe = (void*)pbad_cast_vtable; /* Use the exception struct to get vtable ptrs */
677 pbad_cast_vector_dtor = (void*)pe->vtable;
678 pbad_cast_what = (void*)pe->name;
680 name = call_func1(pbad_cast_what, &e);
681 ok(e.name == name, "Bad bad_cast name from vtable e::what()\n");
683 if (p__RTtypeid)
685 /* Check the rtti */
686 type_info *ti = p__RTtypeid(&e);
687 ok (ti != NULL && !strcmp(ti->mangled, ".?AVbad_cast@@"), "bad rtti for e\n");
689 call_func2(pbad_cast_vector_dtor, &e, 0); /* Should delete e.name, but not e */
692 /* ... and this one */
693 static void test___non_rtti_object(void)
695 static const char* e_name = "A __non_rtti_object name";
696 char* name;
697 exception e, e2, *pe;
699 if (!poperator_new || !poperator_delete ||
700 !p__non_rtti_object_ctor || !p__non_rtti_object_copy_ctor ||
701 !p__non_rtti_object_dtor || !p__non_rtti_object_opequals || !p__non_rtti_object_what ||
702 !p__non_rtti_object_vtable || !p__non_rtti_object_vector_dtor || !p__non_rtti_object_scalar_dtor)
703 return;
705 /* 'const char*' ctor */
706 memset(&e, 0, sizeof(e));
707 call_func2(p__non_rtti_object_ctor, &e, e_name);
708 ok(e.vtable != NULL, "Null __non_rtti_object vtable for e\n");
709 ok(e.name && e.name != e_name && !strcmp(e.name, "A __non_rtti_object name"), "Bad name '%s' for e\n", e.name);
710 ok(e.do_free == 1, "do_free set to %d for e\n", e.do_free);
712 /* Copy ctor */
713 memset(&e2, 0, sizeof(e2));
714 call_func2(p__non_rtti_object_copy_ctor, &e2, &e);
715 ok(e2.vtable != NULL, "Null __non_rtti_object vtable for e2\n");
716 ok(e2.name && e2.name != e.name && !strcmp(e2.name, "A __non_rtti_object name"), "Bad name '%s' for e2\n", e2.name);
717 ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
718 ok(e.vtable == e2.vtable, "__non_rtti_object vtables differ!\n");
720 /* Test calling the dtors */
721 call_func1(p__non_rtti_object_dtor, &e2);
723 /* Operator equals */
724 memset(&e2, 1, sizeof(e2));
725 call_func1(pexception_default_ctor, &e2);
726 pe = call_func2(p__non_rtti_object_opequals, &e2, &e);
727 ok(e2.vtable != NULL, "Null __non_rtti_object vtable for e2\n");
728 ok(e2.name && e2.name != e.name && !strcmp(e2.name, "A __non_rtti_object name"), "Bad __non_rtti_object name for e2\n");
729 ok(e2.do_free == 1, "do_free set to %d for e2\n", e2.do_free);
730 ok(pe == &e2, "opequals didn't return e2\n");
732 /* what() */
733 name = call_func1(p__non_rtti_object_what, &e2);
734 ok(e2.name == name, "Bad __non_rtti_object name from e2::what()\n");
736 /* vtable ptr */
737 ok(e2.vtable == pexception_vtable, "Bad vtable for e2\n");
738 call_func1(p__non_rtti_object_dtor, &e2);
740 /* new() */
741 pe = poperator_new(sizeof(exception));
742 ok(pe != NULL, "new() failed\n");
743 if (pe)
745 call_func2(p__non_rtti_object_ctor, pe, e_name);
746 /* scalar dtor */
747 call_func2(p__non_rtti_object_scalar_dtor, pe, 0); /* Shouldn't delete pe */
748 pe->name = NULL;
749 pe->do_free = 0;
750 call_func2(p__non_rtti_object_scalar_dtor, pe, 1); /* Should delete pe */
753 pe = poperator_new(sizeof(exception));
754 ok(pe != NULL, "new() failed\n");
755 if (pe)
757 /* vector dtor, single element */
758 call_func2(p__non_rtti_object_ctor, pe, e_name);
759 call_func2(p__non_rtti_object_vector_dtor, pe, 1); /* Should delete pe as single element*/
762 pe = poperator_new(sizeof(exception) * 4 + sizeof(size_t));
763 ok(pe != NULL, "new() failed\n");
764 if (pe)
766 /* vector dtor, multiple elements */
767 *((size_t*)pe) = 3;
768 pe = (exception*)((size_t*)pe + 1);
769 call_func2(p__non_rtti_object_ctor, &pe[0], e_name);
770 call_func2(p__non_rtti_object_ctor, &pe[1], e_name);
771 call_func2(p__non_rtti_object_ctor, &pe[2], e_name);
772 pe[3].name = 0;
773 pe[3].do_free = 1; /* Crash if we try to free this element */
774 call_func2(p__non_rtti_object_vector_dtor, pe, 3); /* Should delete all 3 and then pe block */
777 /* test our exported vtable is kosher */
778 pe = (void*)p__non_rtti_object_vtable; /* Use the exception struct to get vtable ptrs */
779 p__non_rtti_object_vector_dtor = (void*)pe->vtable;
780 p__non_rtti_object_what = (void*)pe->name;
782 name = call_func1(p__non_rtti_object_what, &e);
783 ok(e.name == name, "Bad __non_rtti_object name from vtable e::what()\n");
785 if (p__RTtypeid)
787 /* Check the rtti */
788 type_info *ti = p__RTtypeid(&e);
789 ok (ti != NULL && !strcmp(ti->mangled, ".?AV__non_rtti_object@@"), "bad rtti for e\n");
791 call_func2(p__non_rtti_object_vector_dtor, &e, 0); /* Should delete e.name, but not e */
794 static void test_type_info(void)
796 static type_info t1 = { NULL, NULL,{'.','?','A','V','t','e','s','t','1','@','@',0,0,0,0,0 } };
797 static type_info t1_1 = { NULL, NULL,{'?','?','A','V','t','e','s','t','1','@','@',0,0,0,0,0 } };
798 static type_info t2 = { NULL, NULL, {'.','?','A','V','t','e','s','t','2','@','@',0,0,0,0,0 } };
799 char* name;
800 int res;
802 if (!ptype_info_dtor || !ptype_info_raw_name ||
803 !ptype_info_name || !ptype_info_before ||
804 !ptype_info_opequals_equals || !ptype_info_opnot_equals)
805 return;
807 /* Test calling the dtors */
808 call_func1(ptype_info_dtor, &t1); /* No effect, since name is NULL */
809 t1.name = malloc(64);
810 strcpy(t1.name, "foo");
811 call_func1(ptype_info_dtor, &t1); /* Frees t1.name using 'free' */
813 /* raw_name */
814 t1.name = NULL;
815 name = call_func1(ptype_info_raw_name, &t1);
817 /* FIXME: This fails on native; it shouldn't though - native bug?
818 * ok(name && !strcmp(name, t1.mangled), "bad raw_name '%s' for t1 (expected '%s')\n", name, t1.mangled);
820 ok(t1.name == NULL, "raw_name() set name for t1\n");
822 /* name */
823 t1.name = NULL;
824 name = call_func1(ptype_info_name, &t1);
825 ok(name && t1.name && !strcmp(name, t1.name), "bad name '%s' for t1\n", name);
827 ok(t1.name && !strcmp(t1.name, "class test1"), "demangled to '%s' for t1\n", t1.name);
828 call_func1(ptype_info_dtor, &t1);
830 /* before */
831 t1.name = NULL;
832 res = (int)call_func2(ptype_info_before, &t1, &t1);
833 ok(res == 0, "expected 0, got %d\n", res);
834 res = (int)call_func2(ptype_info_before, &t2, &t1);
835 ok(res == 0, "expected 0, got %d\n", res);
836 res = (int)call_func2(ptype_info_before, &t1, &t2);
837 ok(res == 1, "expected 1, got %d\n", res);
838 /* Doesn't check first char */
839 res = (int)call_func2(ptype_info_before, &t1, &t1_1);
840 ok(res == 0, "expected 0, got %d\n", res);
842 /* opequals_equals */
843 t1.name = NULL;
844 res = (int)call_func2(ptype_info_opequals_equals, &t1, &t1);
845 ok(res == 1, "expected 1, got %d\n", res);
846 res = (int)call_func2(ptype_info_opequals_equals, &t1, &t2);
847 ok(res == 0, "expected 0, got %d\n", res);
848 res = (int)call_func2(ptype_info_opequals_equals, &t2, &t1);
849 ok(res == 0, "expected 0, got %d\n", res);
851 /* opnot_equals */
852 t1.name = NULL;
853 res = (int)call_func2(ptype_info_opnot_equals, &t1, &t1);
854 ok(res == 0, "expected 0, got %d\n", res);
855 res = (int)call_func2(ptype_info_opnot_equals, &t1, &t2);
856 ok(res == 1, "expected 1, got %d\n", res);
857 res = (int)call_func2(ptype_info_opnot_equals, &t2, &t1);
858 ok(res == 1, "expected 1, got %d\n", res);
861 static inline vtable_ptr *get_vtable( void *obj )
863 return *(vtable_ptr **)obj;
866 static inline void/*rtti_object_locator*/ *get_obj_locator( void *cppobj )
868 const vtable_ptr *vtable = get_vtable( cppobj );
869 return (void *)vtable[-1];
872 #ifdef __i386__
873 #define DEFINE_RTTI_REF(type, name) type *name
874 #define RTTI_REF(instance, name) &instance.name
875 #define RTTI_REF_SIG0(instance, name, base) RTTI_REF(instance, name)
876 #else
877 #define DEFINE_RTTI_REF(type, name) unsigned name
878 #define RTTI_REF(instance, name) FIELD_OFFSET(struct rtti_data, name)
879 #define RTTI_REF_SIG0(instance, name, base) ((char*)&instance.name-base)
880 #endif
881 /* Test RTTI functions */
882 static void test_rtti(void)
884 struct _object_locator
886 unsigned int signature;
887 int base_class_offset;
888 unsigned int flags;
889 DEFINE_RTTI_REF(type_info, type_descriptor);
890 DEFINE_RTTI_REF(struct _rtti_object_hierarchy, type_hierarchy);
891 DEFINE_RTTI_REF(void, object_locator);
892 } *obj_locator;
894 struct _rtti_base_descriptor
896 DEFINE_RTTI_REF(type_info, type_descriptor);
897 int num_base_classes;
898 struct {
899 int this_offset;
900 int vbase_descr;
901 int vbase_offset;
902 } this_ptr_offsets;
903 unsigned int attributes;
906 struct _rtti_base_array {
907 DEFINE_RTTI_REF(struct _rtti_base_descriptor, bases[4]);
910 struct _rtti_object_hierarchy {
911 unsigned int signature;
912 unsigned int attributes;
913 int array_len;
914 DEFINE_RTTI_REF(struct _rtti_base_array, base_classes);
917 struct rtti_data
919 type_info type_info[4];
921 struct _rtti_base_descriptor base_descriptor[4];
922 struct _rtti_base_array base_array;
923 struct _rtti_object_hierarchy object_hierarchy;
924 struct _object_locator object_locator;
925 } simple_class_rtti = {
926 { {NULL, NULL, "simple_class"} },
927 { {RTTI_REF(simple_class_rtti, type_info[0]), 0, {0, 0, 0}, 0} },
928 { {RTTI_REF(simple_class_rtti, base_descriptor[0])} },
929 {0, 0, 1, RTTI_REF(simple_class_rtti, base_array)},
930 {1, 0, 0, RTTI_REF(simple_class_rtti, type_info[0]), RTTI_REF(simple_class_rtti, object_hierarchy), RTTI_REF(simple_class_rtti, object_locator)}
931 }, child_class_rtti = {
932 { {NULL, NULL, "simple_class"}, {NULL, NULL, "child_class"} },
933 { {RTTI_REF(child_class_rtti, type_info[1]), 0, {4, -1, 0}, 0}, {RTTI_REF(child_class_rtti, type_info[0]), 0, {8, -1, 0}, 0} },
934 { {RTTI_REF(child_class_rtti, base_descriptor[0]), RTTI_REF(child_class_rtti, base_descriptor[1])} },
935 {0, 0, 2, RTTI_REF(child_class_rtti, base_array)},
936 {1, 0, 0, RTTI_REF(child_class_rtti, type_info[1]), RTTI_REF(child_class_rtti, object_hierarchy), RTTI_REF(child_class_rtti, object_locator)}
937 }, virtual_base_class_rtti = {
938 { {NULL, NULL, "simple_class"}, {NULL, NULL, "child_class"} },
939 { {RTTI_REF(virtual_base_class_rtti, type_info[1]), 0, {0x10, sizeof(void*), sizeof(int)}, 0}, {RTTI_REF(virtual_base_class_rtti, type_info[0]), 0, {8, -1, 0}, 0} },
940 { {RTTI_REF(virtual_base_class_rtti, base_descriptor[0]), RTTI_REF(virtual_base_class_rtti, base_descriptor[1])} },
941 {0, 0, 2, RTTI_REF(virtual_base_class_rtti, base_array)},
942 {1, 0, 0, RTTI_REF(virtual_base_class_rtti, type_info[1]), RTTI_REF(virtual_base_class_rtti, object_hierarchy), RTTI_REF(virtual_base_class_rtti, object_locator)}
944 static struct rtti_data simple_class_sig0_rtti, child_class_sig0_rtti;
946 void *simple_class_vtbl[2] = {&simple_class_rtti.object_locator};
947 void *simple_class = &simple_class_vtbl[1];
948 void *child_class_vtbl[2] = {&child_class_rtti.object_locator};
949 struct {
950 void *vtbl;
951 char data[4];
952 } child_class = { &child_class_vtbl[1] };
953 void *simple_class_sig0_vtbl[2] = {&simple_class_sig0_rtti.object_locator};
954 void *simple_class_sig0 = &simple_class_sig0_vtbl[1];
955 void *child_class_sig0_vtbl[2] = {&child_class_sig0_rtti.object_locator};
956 struct {
957 void *vtbl;
958 char data[4];
959 } child_class_sig0 = { &child_class_sig0_vtbl[1] };
960 void *virtual_base_class_vtbl[2] = {&virtual_base_class_rtti.object_locator};
961 int virtual_base_class_vbtbl[2] = {0, 0x100};
962 struct {
963 void *virtual_base[2];
964 char data[0x110-sizeof(void*)];
965 void *vbthis;
966 } virtual_base_class = { {&virtual_base_class_vtbl[1], virtual_base_class_vbtbl} };
968 static const char* e_name = "name";
969 type_info *ti,*bti;
970 exception e,b;
971 void *casted;
972 BOOL old_signature;
973 #ifndef __i386__
974 char *base = (char*)GetModuleHandleW(NULL);
975 #endif
977 if (!p__RTCastToVoid || !p__RTtypeid || !pexception_ctor || !pbad_typeid_ctor
978 || !p__RTDynamicCast || !pexception_dtor || !pbad_typeid_dtor)
979 return;
981 call_func2(pexception_ctor, &e, &e_name);
982 call_func2(pbad_typeid_ctor, &b, e_name);
984 obj_locator = get_obj_locator(&e);
985 if(obj_locator->signature!=1 && sizeof(void*)>sizeof(int))
986 old_signature = TRUE;
987 else
988 old_signature = FALSE;
990 /* dynamic_cast to void* */
991 casted = p__RTCastToVoid(&e);
992 ok (casted == (void*)&e, "failed cast to void\n");
994 /* dynamic_cast up */
995 ti = p__RTtypeid(&e);
996 bti = p__RTtypeid(&b);
998 casted = p__RTDynamicCast(&b, 0, NULL, ti, 0);
999 if (casted)
1001 /* New versions do not allow this conversion due to compiler changes */
1002 ok (casted == (void*)&b, "failed cast from bad_typeid to exception\n");
1005 /* dynamic_cast down */
1006 casted = p__RTDynamicCast(&e, 0, NULL, bti, 0);
1007 ok (casted == NULL, "Cast succeeded\n");
1009 call_func1(pexception_dtor, &e);
1010 call_func1(pbad_typeid_dtor, &b);
1012 simple_class_sig0_rtti = simple_class_rtti;
1013 simple_class_sig0_rtti.object_locator.signature = 0;
1014 simple_class_sig0_rtti.base_descriptor[0].type_descriptor = RTTI_REF_SIG0(simple_class_sig0_rtti, type_info[0], base);
1015 simple_class_sig0_rtti.base_array.bases[0] = RTTI_REF_SIG0(simple_class_sig0_rtti, base_descriptor[0], base);
1016 simple_class_sig0_rtti.object_hierarchy.base_classes = RTTI_REF_SIG0(simple_class_sig0_rtti, base_array, base);
1017 simple_class_sig0_rtti.object_locator.type_descriptor = RTTI_REF_SIG0(simple_class_sig0_rtti, type_info[0], base);
1018 simple_class_sig0_rtti.object_locator.type_hierarchy = RTTI_REF_SIG0(simple_class_sig0_rtti, object_hierarchy, base);
1020 child_class_sig0_rtti = child_class_rtti;
1021 child_class_sig0_rtti.object_locator.signature = 0;
1022 child_class_sig0_rtti.base_descriptor[0].type_descriptor = RTTI_REF_SIG0(child_class_sig0_rtti, type_info[1], base);
1023 child_class_sig0_rtti.base_descriptor[1].type_descriptor = RTTI_REF_SIG0(child_class_sig0_rtti, type_info[0], base);
1024 child_class_sig0_rtti.base_array.bases[0] = RTTI_REF_SIG0(child_class_sig0_rtti, base_descriptor[0], base);
1025 child_class_sig0_rtti.base_array.bases[1] = RTTI_REF_SIG0(child_class_sig0_rtti, base_descriptor[1], base);
1026 child_class_sig0_rtti.object_hierarchy.base_classes = RTTI_REF_SIG0(child_class_sig0_rtti, base_array, base);
1027 child_class_sig0_rtti.object_locator.type_descriptor = RTTI_REF_SIG0(child_class_sig0_rtti, type_info[1], base);
1028 child_class_sig0_rtti.object_locator.type_hierarchy = RTTI_REF_SIG0(child_class_sig0_rtti, object_hierarchy, base);
1030 ti = p__RTtypeid(&simple_class_sig0);
1031 ok (ti && !strcmp(ti->mangled, "simple_class"), "incorrect rtti data\n");
1033 casted = p__RTCastToVoid(&simple_class_sig0);
1034 ok (casted == (void*)&simple_class_sig0, "failed cast to void\n");
1036 ti = p__RTtypeid(&child_class_sig0);
1037 ok (ti && !strcmp(ti->mangled, "child_class"), "incorrect rtti data\n");
1039 casted = p__RTCastToVoid(&child_class_sig0);
1040 ok (casted == (void*)&child_class_sig0, "failed cast to void\n");
1042 casted = p__RTDynamicCast(&child_class_sig0, 0, NULL, simple_class_sig0_rtti.type_info, 0);
1043 if(casted)
1045 ok (casted == (char*)&child_class_sig0+8, "failed cast to simple_class (%p %p)\n", casted, &child_class_sig0);
1048 casted = p__RTDynamicCast(&child_class_sig0, 0, &child_class_sig0_rtti.type_info[0], &child_class_sig0_rtti.type_info[1], 0);
1049 ok(casted == (char*)&child_class_sig0+4, "failed cast to child class (%p %p)\n", casted, &child_class_sig0);
1051 if(old_signature) {
1052 skip("signature==1 is not supported\n");
1053 return;
1056 ti = p__RTtypeid(&simple_class);
1057 ok (ti && !strcmp(ti->mangled, "simple_class"), "incorrect rtti data\n");
1059 casted = p__RTCastToVoid(&simple_class);
1060 ok (casted == (void*)&simple_class, "failed cast to void\n");
1062 ti = p__RTtypeid(&child_class);
1063 ok (ti && !strcmp(ti->mangled, "child_class"), "incorrect rtti data\n");
1065 casted = p__RTCastToVoid(&child_class);
1066 ok (casted == (void*)&child_class, "failed cast to void\n");
1068 casted = p__RTDynamicCast(&child_class, 0, NULL, simple_class_rtti.type_info, 0);
1069 if(casted)
1071 ok (casted == (char*)&child_class+8, "failed cast to simple_class (%p %p)\n", casted, &child_class);
1074 casted = p__RTDynamicCast(&child_class, 0, &child_class_rtti.type_info[0], &child_class_rtti.type_info[1], 0);
1075 ok(casted == (char*)&child_class+4, "failed cast to child class (%p %p)\n", casted, &child_class);
1077 casted = p__RTDynamicCast(&virtual_base_class, 0, &virtual_base_class_rtti.type_info[0], &virtual_base_class_rtti.type_info[1], 0);
1078 ok(casted == &virtual_base_class.vbthis, "failed cast to child class (%p %p)\n", casted, &virtual_base_class);
1081 struct _demangle {
1082 LPCSTR mangled;
1083 LPCSTR result;
1084 BOOL test_in_wine;
1087 static void test_demangle_datatype(void)
1089 char * name;
1090 struct _demangle demangle[]={
1091 { "BlaBla"," ?? ::Bla", FALSE},
1092 { "ABVVec4@ref2@dice@@", "class dice::ref2::Vec4 const &", TRUE},
1093 { "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$0H@@@",
1094 "class CDB_GEN_BIG_ENUM_FLAG<enum CDB_WYSIWYG_BITS_ENUM,7>", TRUE},
1095 { "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$0HO@@@",
1096 "class CDB_GEN_BIG_ENUM_FLAG<enum CDB_WYSIWYG_BITS_ENUM,126>",TRUE},
1097 { "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$0HOA@@@",
1098 "class CDB_GEN_BIG_ENUM_FLAG<enum CDB_WYSIWYG_BITS_ENUM,2016>",TRUE},
1099 { "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$0HOAA@@@",
1100 "class CDB_GEN_BIG_ENUM_FLAG<enum CDB_WYSIWYG_BITS_ENUM,32256>",TRUE},
1101 { "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$01@@@",
1102 "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$01@@@", FALSE},
1103 { "P8test@@AACXZ", "signed char (__cdecl test::*)(void)", TRUE},
1104 { "P8test@@BACXZ", "signed char (__cdecl test::*)(void)const ", TRUE},
1106 int i, num_test = ARRAY_SIZE(demangle);
1108 for (i = 0; i < num_test; i++)
1110 name = p__unDName(0, demangle[i].mangled, 0, malloc, free, 0x2800);
1111 todo_wine_if (!demangle[i].test_in_wine)
1112 ok(name != NULL && !strcmp(name,demangle[i].result), "Got name \"%s\" for %d\n", name, i);
1113 free(name);
1117 static void test_demangle(void)
1119 static struct {const char* in; const char* out; const char *broken; unsigned int flags;} test[] = {
1120 /* 0 */ {"??0bad_alloc@std@@QAE@ABV01@@Z",
1121 "public: __thiscall std::bad_alloc::bad_alloc(class std::bad_alloc const &)",
1122 "public: __thiscall std::bad_alloc::bad_alloc(class bad_alloc::bad_alloc const &)"},
1123 /* 1 */ {"??0bad_alloc@std@@QAE@PBD@Z",
1124 "public: __thiscall std::bad_alloc::bad_alloc(char const *)"},
1125 /* 2 */ {"??0bad_cast@@AAE@PBQBD@Z",
1126 "private: __thiscall bad_cast::bad_cast(char const * const *)"},
1127 /* 3 */ {"??0bad_cast@@QAE@ABQBD@Z",
1128 "public: __thiscall bad_cast::bad_cast(char const * const &)"},
1129 /* 4 */ {"??0bad_cast@@QAE@ABV0@@Z",
1130 "public: __thiscall bad_cast::bad_cast(class bad_cast const &)"},
1131 /* 5 */ {"??0bad_exception@std@@QAE@ABV01@@Z",
1132 "public: __thiscall std::bad_exception::bad_exception(class std::bad_exception const &)",
1133 "public: __thiscall std::bad_exception::bad_exception(class bad_exception::bad_exception const &)"},
1134 /* 6 */ {"??0bad_exception@std@@QAE@PBD@Z",
1135 "public: __thiscall std::bad_exception::bad_exception(char const *)"},
1136 /* 7 */ {"??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@ABV01@@Z",
1137 "public: __thiscall std::basic_filebuf<char,struct std::char_traits<char> >::basic_filebuf<char,struct std::char_traits<char> >(class std::basic_filebuf<char,struct std::char_traits<char> > const &)",
1138 "public: __thiscall std::basic_filebuf<char,struct std::char_traits<char> >::basic_filebuf<char,struct std::char_traits<char> >(class basic_filebuf<char,struct std::char_traits<char> >::basic_filebuf<char,struct std::char_traits<char> > const &)"},
1139 /* 8 */ {"??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z",
1140 "public: __thiscall std::basic_filebuf<char,struct std::char_traits<char> >::basic_filebuf<char,struct std::char_traits<char> >(struct _iobuf *)"},
1141 /* 9 */ {"??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@@Z",
1142 "public: __thiscall std::basic_filebuf<char,struct std::char_traits<char> >::basic_filebuf<char,struct std::char_traits<char> >(enum std::_Uninitialized)",
1143 "public: __thiscall std::basic_filebuf<char,struct std::char_traits<char> >::basic_filebuf<char,struct std::char_traits<char> >(enum basic_filebuf<char,struct std::char_traits<char> >::_Uninitialized)"},
1144 /* 10 */ {"??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@ABV01@@Z",
1145 "public: __thiscall std::basic_filebuf<unsigned short,struct std::char_traits<unsigned short> >::basic_filebuf<unsigned short,struct std::char_traits<unsigned short> >(class std::basic_filebuf<unsigned short,struct std::char_traits<unsigned short> > const &)",
1146 "public: __thiscall std::basic_filebuf<unsigned short,struct std::char_traits<unsigned short> >::basic_filebuf<unsigned short,struct std::char_traits<unsigned short> >(class basic_filebuf<unsigned short,struct std::char_traits<unsigned short> >::basic_filebuf<unsigned short,struct std::char_traits<unsigned short> > const &)"},
1147 /* 11 */ {"??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z",
1148 "public: __thiscall std::basic_filebuf<unsigned short,struct std::char_traits<unsigned short> >::basic_filebuf<unsigned short,struct std::char_traits<unsigned short> >(struct _iobuf *)"},
1149 /* 12 */ {"??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@@Z",
1150 "public: __thiscall std::basic_filebuf<unsigned short,struct std::char_traits<unsigned short> >::basic_filebuf<unsigned short,struct std::char_traits<unsigned short> >(enum std::_Uninitialized)",
1151 "public: __thiscall std::basic_filebuf<unsigned short,struct std::char_traits<unsigned short> >::basic_filebuf<unsigned short,struct std::char_traits<unsigned short> >(enum basic_filebuf<unsigned short,struct std::char_traits<unsigned short> >::_Uninitialized)"},
1152 /* 13 */ {"??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z",
1153 "public: __thiscall std::basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >::basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> > const &)",
1154 "public: __thiscall std::basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >::basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >(class basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >::basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> > const &)"},
1155 /* 14 */ {"??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@H@Z",
1156 "public: __thiscall std::basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >::basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int)",
1157 "public: __thiscall std::basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >::basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >(class basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int)"},
1158 /* 15 */ {"??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z",
1159 "public: __thiscall std::basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >::basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >(int)"},
1160 /* 16 */ {"??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@ABV01@@Z",
1161 "public: __thiscall std::basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >(class std::basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &)",
1162 "public: __thiscall std::basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >(class basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &)"},
1163 /* 17 */ {"??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@ABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@1@H@Z",
1164 "public: __thiscall std::basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >(class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &,int)",
1165 "public: __thiscall std::basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >(class basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &,int)"},
1166 /* 18 */ {"??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z",
1167 "public: __thiscall std::basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >(int)"},
1168 /* 19 */ {"??0?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QAE@ABV_Locinfo@1@I@Z",
1169 "public: __thiscall std::num_get<char,class std::istreambuf_iterator<char,struct std::char_traits<char> > >::num_get<char,class std::istreambuf_iterator<char,struct std::char_traits<char> > >(class std::_Locinfo const &,unsigned int)",
1170 "public: __thiscall std::num_get<char,class std::istreambuf_iterator<char,struct std::char_traits<char> > >::num_get<char,class std::istreambuf_iterator<char,struct std::char_traits<char> > >(class num_get<char,class std::istreambuf_iterator<char,struct std::char_traits<char> > >::_Locinfo const &,unsigned int)"},
1171 /* 20 */ {"??0?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QAE@I@Z",
1172 "public: __thiscall std::num_get<char,class std::istreambuf_iterator<char,struct std::char_traits<char> > >::num_get<char,class std::istreambuf_iterator<char,struct std::char_traits<char> > >(unsigned int)"},
1173 /* 21 */ {"??0?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QAE@ABV_Locinfo@1@I@Z",
1174 "public: __thiscall std::num_get<unsigned short,class std::istreambuf_iterator<unsigned short,struct std::char_traits<unsigned short> > >::num_get<unsigned short,class std::istreambuf_iterator<unsigned short,struct std::char_traits<unsigned short> > >(class std::_Locinfo const &,unsigned int)",
1175 "public: __thiscall std::num_get<unsigned short,class std::istreambuf_iterator<unsigned short,struct std::char_traits<unsigned short> > >::num_get<unsigned short,class std::istreambuf_iterator<unsigned short,struct std::char_traits<unsigned short> > >(class num_get<unsigned short,class std::istreambuf_iterator<unsigned short,struct std::char_traits<unsigned short> > >::_Locinfo const &,unsigned int)"},
1176 /* 22 */ {"??0?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QAE@I@Z", "public: __thiscall std::num_get<unsigned short,class std::istreambuf_iterator<unsigned short,struct std::char_traits<unsigned short> > >::num_get<unsigned short,class std::istreambuf_iterator<unsigned short,struct std::char_traits<unsigned short> > >(unsigned int)"},
1177 /* 23 */ {"??0streambuf@@QAE@ABV0@@Z", "public: __thiscall streambuf::streambuf(class streambuf const &)"},
1178 /* 24 */ {"??0strstreambuf@@QAE@ABV0@@Z", "public: __thiscall strstreambuf::strstreambuf(class strstreambuf const &)"},
1179 /* 25 */ {"??0strstreambuf@@QAE@H@Z", "public: __thiscall strstreambuf::strstreambuf(int)"},
1180 /* 26 */ {"??0strstreambuf@@QAE@Q6APAXJ@ZS6AXPAX@Z@Z", "public: __thiscall strstreambuf::strstreambuf(void * (__cdecl*const)(long),void (__cdecl*const volatile)(void *))"},
1181 /* 27 */ {"??0strstreambuf@@QAE@PADH0@Z", "public: __thiscall strstreambuf::strstreambuf(char *,int,char *)"},
1182 /* 28 */ {"??0strstreambuf@@QAE@PAEH0@Z", "public: __thiscall strstreambuf::strstreambuf(unsigned char *,int,unsigned char *)"},
1183 /* 29 */ {"??0strstreambuf@@QAE@XZ", "public: __thiscall strstreambuf::strstreambuf(void)"},
1184 /* 30 */ {"??1__non_rtti_object@std@@UAE@XZ", "public: virtual __thiscall std::__non_rtti_object::~__non_rtti_object(void)"},
1185 /* 31 */ {"??1__non_rtti_object@@UAE@XZ", "public: virtual __thiscall __non_rtti_object::~__non_rtti_object(void)"},
1186 /* 32 */ {"??1?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@UAE@XZ", "public: virtual __thiscall std::num_get<char,class std::istreambuf_iterator<char,struct std::char_traits<char> > >::~num_get<char,class std::istreambuf_iterator<char,struct std::char_traits<char> > >(void)"},
1187 /* 33 */ {"??1?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@UAE@XZ", "public: virtual __thiscall std::num_get<unsigned short,class std::istreambuf_iterator<unsigned short,struct std::char_traits<unsigned short> > >::~num_get<unsigned short,class std::istreambuf_iterator<unsigned short,struct std::char_traits<unsigned short> > >(void)"},
1188 /* 34 */ {"??4istream_withassign@@QAEAAV0@ABV0@@Z", "public: class istream_withassign & __thiscall istream_withassign::operator=(class istream_withassign const &)"},
1189 /* 35 */ {"??4istream_withassign@@QAEAAVistream@@ABV1@@Z", "public: class istream & __thiscall istream_withassign::operator=(class istream const &)"},
1190 /* 36 */ {"??4istream_withassign@@QAEAAVistream@@PAVstreambuf@@@Z", "public: class istream & __thiscall istream_withassign::operator=(class streambuf *)"},
1191 /* 37 */ {"??5std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAC@Z", "class std::basic_istream<char,struct std::char_traits<char> > & __cdecl std::operator>>(class std::basic_istream<char,struct std::char_traits<char> > &,signed char &)"},
1192 /* 38 */ {"??5std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAD@Z", "class std::basic_istream<char,struct std::char_traits<char> > & __cdecl std::operator>>(class std::basic_istream<char,struct std::char_traits<char> > &,char &)"},
1193 /* 39 */ {"??5std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAE@Z", "class std::basic_istream<char,struct std::char_traits<char> > & __cdecl std::operator>>(class std::basic_istream<char,struct std::char_traits<char> > &,unsigned char &)"},
1194 /* 40 */ {"??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z", "public: class std::basic_ostream<unsigned short,struct std::char_traits<unsigned short> > & __thiscall std::basic_ostream<unsigned short,struct std::char_traits<unsigned short> >::operator<<(class std::ios_base & (__cdecl*)(class std::ios_base &))"},
1195 /* 41 */ {"??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z", "public: class std::basic_ostream<unsigned short,struct std::char_traits<unsigned short> > & __thiscall std::basic_ostream<unsigned short,struct std::char_traits<unsigned short> >::operator<<(class std::basic_streambuf<unsigned short,struct std::char_traits<unsigned short> > *)"},
1196 /* 42 */ {"??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@PBX@Z", "public: class std::basic_ostream<unsigned short,struct std::char_traits<unsigned short> > & __thiscall std::basic_ostream<unsigned short,struct std::char_traits<unsigned short> >::operator<<(void const *)"},
1197 /* 43 */ {"??_8?$basic_fstream@DU?$char_traits@D@std@@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@", "const std::basic_fstream<char,struct std::char_traits<char> >::`vbtable'{for `std::basic_ostream<char,struct std::char_traits<char> >'}"},
1198 /* 44 */ {"??_8?$basic_fstream@GU?$char_traits@G@std@@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@", "const std::basic_fstream<unsigned short,struct std::char_traits<unsigned short> >::`vbtable'{for `std::basic_istream<unsigned short,struct std::char_traits<unsigned short> >'}"},
1199 /* 45 */ {"??_8?$basic_fstream@GU?$char_traits@G@std@@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@", "const std::basic_fstream<unsigned short,struct std::char_traits<unsigned short> >::`vbtable'{for `std::basic_ostream<unsigned short,struct std::char_traits<unsigned short> >'}"},
1200 /* 46 */ {"??9std@@YA_NPBDABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z", "bool __cdecl std::operator!=(char const *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)"},
1201 /* 47 */ {"??9std@@YA_NPBGABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z", "bool __cdecl std::operator!=(unsigned short const *,class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &)"},
1202 /* 48 */ {"??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAADI@Z", "public: char & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator[](unsigned int)"},
1203 /* 49 */ {"??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEABDI@Z", "public: char const & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator[](unsigned int)const "},
1204 /* 50 */ {"??A?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAGI@Z", "public: unsigned short & __thiscall std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::operator[](unsigned int)"},
1205 /* 51 */ {"??A?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEABGI@Z", "public: unsigned short const & __thiscall std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::operator[](unsigned int)const "},
1206 /* 52 */ {"?abs@std@@YAMABV?$complex@M@1@@Z", "float __cdecl std::abs(class std::complex<float> const &)"},
1207 /* 53 */ {"?abs@std@@YANABV?$complex@N@1@@Z", "double __cdecl std::abs(class std::complex<double> const &)"},
1208 /* 54 */ {"?abs@std@@YAOABV?$complex@O@1@@Z", "long double __cdecl std::abs(class std::complex<long double> const &)"},
1209 /* 55 */ {"?cin@std@@3V?$basic_istream@DU?$char_traits@D@std@@@1@A", "class std::basic_istream<char,struct std::char_traits<char> > std::cin"},
1210 /* 56 */ {"?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAAG@Z", "protected: virtual class std::istreambuf_iterator<char,struct std::char_traits<char> > __thiscall std::num_get<char,class std::istreambuf_iterator<char,struct std::char_traits<char> > >::do_get(class std::istreambuf_iterator<char,struct std::char_traits<char> >,class std::istreambuf_iterator<char,struct std::char_traits<char> >,class std::ios_base &,int &,unsigned short &)const "},
1211 /* 57 */ {"?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAAI@Z", "protected: virtual class std::istreambuf_iterator<char,struct std::char_traits<char> > __thiscall std::num_get<char,class std::istreambuf_iterator<char,struct std::char_traits<char> > >::do_get(class std::istreambuf_iterator<char,struct std::char_traits<char> >,class std::istreambuf_iterator<char,struct std::char_traits<char> >,class std::ios_base &,int &,unsigned int &)const "},
1212 /* 58 */ {"?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAAJ@Z", "protected: virtual class std::istreambuf_iterator<char,struct std::char_traits<char> > __thiscall std::num_get<char,class std::istreambuf_iterator<char,struct std::char_traits<char> > >::do_get(class std::istreambuf_iterator<char,struct std::char_traits<char> >,class std::istreambuf_iterator<char,struct std::char_traits<char> >,class std::ios_base &,int &,long &)const "},
1213 /* 59 */ {"?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAAK@Z", "protected: virtual class std::istreambuf_iterator<char,struct std::char_traits<char> > __thiscall std::num_get<char,class std::istreambuf_iterator<char,struct std::char_traits<char> > >::do_get(class std::istreambuf_iterator<char,struct std::char_traits<char> >,class std::istreambuf_iterator<char,struct std::char_traits<char> >,class std::ios_base &,int &,unsigned long &)const "},
1214 /* 60 */ {"?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAAM@Z", "protected: virtual class std::istreambuf_iterator<char,struct std::char_traits<char> > __thiscall std::num_get<char,class std::istreambuf_iterator<char,struct std::char_traits<char> > >::do_get(class std::istreambuf_iterator<char,struct std::char_traits<char> >,class std::istreambuf_iterator<char,struct std::char_traits<char> >,class std::ios_base &,int &,float &)const "},
1215 /* 61 */ {"?_query_new_handler@@YAR6AHI@ZXZ", "int (__cdecl*__cdecl _query_new_handler(void))(unsigned int)"},
1216 /* 62 */ {"?register_callback@ios_base@std@@QAEXP6AXW4event@12@AAV12@H@ZH@Z", "public: void __thiscall std::ios_base::register_callback(void (__cdecl*)(enum std::ios_base::event,class std::ios_base &,int),int)"},
1217 /* 63 */ {"?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@JW4seekdir@ios_base@2@@Z", "public: class std::basic_istream<char,struct std::char_traits<char> > & __thiscall std::basic_istream<char,struct std::char_traits<char> >::seekg(long,enum std::ios_base::seekdir)"},
1218 /* 64 */ {"?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z", "public: class std::basic_istream<char,struct std::char_traits<char> > & __thiscall std::basic_istream<char,struct std::char_traits<char> >::seekg(class std::fpos<int>)"},
1219 /* 65 */ {"?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@JW4seekdir@ios_base@2@@Z", "public: class std::basic_istream<unsigned short,struct std::char_traits<unsigned short> > & __thiscall std::basic_istream<unsigned short,struct std::char_traits<unsigned short> >::seekg(long,enum std::ios_base::seekdir)"},
1220 /* 66 */ {"?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z", "public: class std::basic_istream<unsigned short,struct std::char_traits<unsigned short> > & __thiscall std::basic_istream<unsigned short,struct std::char_traits<unsigned short> >::seekg(class std::fpos<int>)"},
1221 /* 67 */ {"?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z", "protected: virtual class std::fpos<int> __thiscall std::basic_filebuf<char,struct std::char_traits<char> >::seekoff(long,enum std::ios_base::seekdir,int)"},
1222 /* 68 */ {"?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z", "protected: virtual class std::fpos<int> __thiscall std::basic_filebuf<unsigned short,struct std::char_traits<unsigned short> >::seekoff(long,enum std::ios_base::seekdir,int)"},
1223 /* 69 */ {"?set_new_handler@@YAP6AXXZP6AXXZ@Z", "void (__cdecl*__cdecl set_new_handler(void (__cdecl*)(void)))(void)"},
1224 /* 70 */ {"?str@?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z", "public: void __thiscall std::basic_istringstream<char,struct std::char_traits<char>,class std::allocator<char> >::str(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)"},
1225 /* 71 */ {"?str@?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ", "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall std::basic_istringstream<char,struct std::char_traits<char>,class std::allocator<char> >::str(void)const "},
1226 /* 72 */ {"?str@?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@@Z", "public: void __thiscall std::basic_istringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::str(class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &)"},
1227 /* 73 */ {"?str@?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBE?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ", "public: class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > __thiscall std::basic_istringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::str(void)const "},
1228 /* 74 */ {"?str@?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z", "public: void __thiscall std::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> >::str(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)"},
1229 /* 75 */ {"?str@?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ", "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall std::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> >::str(void)const "},
1230 /* 76 */ {"?str@?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@@Z", "public: void __thiscall std::basic_ostringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::str(class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &)"},
1231 /* 77 */ {"?str@?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBE?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ", "public: class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > __thiscall std::basic_ostringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::str(void)const "},
1232 /* 78 */ {"?str@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z", "public: void __thiscall std::basic_stringbuf<char,struct std::char_traits<char>,class std::allocator<char> >::str(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)"},
1233 /* 79 */ {"?str@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ", "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall std::basic_stringbuf<char,struct std::char_traits<char>,class std::allocator<char> >::str(void)const "},
1234 /* 80 */ {"?str@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@@Z", "public: void __thiscall std::basic_stringbuf<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::str(class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &)"},
1235 /* 81 */ {"?str@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBE?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ", "public: class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > __thiscall std::basic_stringbuf<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::str(void)const "},
1236 /* 82 */ {"?str@?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z", "public: void __thiscall std::basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >::str(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)"},
1237 /* 83 */ {"?str@?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ", "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall std::basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >::str(void)const "},
1238 /* 84 */ {"?str@?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@@Z", "public: void __thiscall std::basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::str(class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &)"},
1239 /* 85 */ {"?str@?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBE?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ", "public: class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > __thiscall std::basic_stringstream<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::str(void)const "},
1240 /* 86 */ {"?_Sync@ios_base@std@@0_NA", "private: static bool std::ios_base::_Sync"},
1241 /* 87 */ {"??_U@YAPAXI@Z", "void * __cdecl operator new[](unsigned int)"},
1242 /* 88 */ {"??_V@YAXPAX@Z", "void __cdecl operator delete[](void *)"},
1243 /* 89 */ {"??X?$_Complex_base@M@std@@QAEAAV01@ABM@Z", "public: class std::_Complex_base<float> & __thiscall std::_Complex_base<float>::operator*=(float const &)"},
1244 /* 90 */ {"??Xstd@@YAAAV?$complex@M@0@AAV10@ABV10@@Z", "class std::complex<float> & __cdecl std::operator*=(class std::complex<float> &,class std::complex<float> const &)"},
1245 /* 91 */ {"?aaa@@YAHAAUbbb@@@Z", "int __cdecl aaa(struct bbb &)"},
1246 /* 92 */ {"?aaa@@YAHBAUbbb@@@Z", "int __cdecl aaa(struct bbb & volatile)"},
1247 /* 93 */ {"?aaa@@YAHPAUbbb@@@Z", "int __cdecl aaa(struct bbb *)"},
1248 /* 94 */ {"?aaa@@YAHQAUbbb@@@Z", "int __cdecl aaa(struct bbb * const)"},
1249 /* 95 */ {"?aaa@@YAHRAUbbb@@@Z", "int __cdecl aaa(struct bbb * volatile)"},
1250 /* 96 */ {"?aaa@@YAHSAUbbb@@@Z", "int __cdecl aaa(struct bbb * const volatile)"},
1251 /* 97 */ {"??0aa.a@@QAE@XZ", "??0aa.a@@QAE@XZ"},
1252 /* 98 */ {"??0aa$_3a@@QAE@XZ", "public: __thiscall aa$_3a::aa$_3a(void)"},
1253 /* 99 */ {"??2?$aaa@AAUbbb@@AAUccc@@AAU2@@ddd@1eee@2@QAEHXZ", "public: int __thiscall eee::eee::ddd::ddd::aaa<struct bbb &,struct ccc &,struct ccc &>::operator new(void)"},
1254 /* 100 */ {"?pSW@@3P6GHKPAX0PAU_tagSTACKFRAME@@0P6GH0K0KPAK@ZP6GPAX0K@ZP6GK0K@ZP6GK00PAU_tagADDRESS@@@Z@ZA", "int (__stdcall* pSW)(unsigned long,void *,void *,struct _tagSTACKFRAME *,void *,int (__stdcall*)(void *,unsigned long,void *,unsigned long,unsigned long *),void * (__stdcall*)(void *,unsigned long),unsigned long (__stdcall*)(void *,unsigned long),unsigned long (__stdcall*)(void *,void *,struct _tagADDRESS *))"},
1255 /* 101 */ {"?$_aaa@Vbbb@@", "_aaa<class bbb>"},
1256 /* 102 */ {"?$aaa@Vbbb@ccc@@Vddd@2@", "aaa<class ccc::bbb,class ccc::ddd>"},
1257 /* 103 */ { "??0?$Foo@P6GHPAX0@Z@@QAE@PAD@Z", "public: __thiscall Foo<int (__stdcall*)(void *,void *)>::Foo<int (__stdcall*)(void *,void *)>(char *)"},
1258 /* 104 */ { "??0?$Foo@P6GHPAX0@Z@@QAE@PAD@Z", "__thiscall Foo<int (__stdcall*)(void *,void *)>::Foo<int (__stdcall*)(void *,void *)>(char *)", NULL, 0x880},
1259 /* 105 */ { "?Qux@Bar@@0PAP6AHPAV1@AAH1PAH@ZA", "private: static int (__cdecl** Bar::Qux)(class Bar *,int &,int &,int *)" },
1260 /* 106 */ { "?Qux@Bar@@0PAP6AHPAV1@AAH1PAH@ZA", "Bar::Qux", NULL, 0x1800},
1261 /* 107 */ {"?$AAA@$DBAB@", "AAA<`template-parameter257'>"},
1262 /* 108 */ {"?$AAA@?C@", "AAA<`template-parameter-2'>"},
1263 /* 109 */ {"?$AAA@PAUBBB@@", "AAA<struct BBB *>"},
1264 /* 110 */ {"??$ccccc@PAVaaa@@@bar@bb@foo@@DGPAV0@PAV0@PAVee@@IPAPAVaaa@@1@Z",
1265 "private: static class bar * __stdcall foo::bb::bar::ccccc<class aaa *>(class bar *,class ee *,unsigned int,class aaa * *,class ee *)",
1266 "??$ccccc@PAVaaa@@@bar@bb@foo@@DGPAV0@PAV0@PAVee@@IPAPAVaaa@@1@Z"},
1267 /* 111 */ {"?f@T@@QAEHQCY1BE@BO@D@Z", "public: int __thiscall T::f(char (volatile * const)[20][30])"},
1268 /* 112 */ {"?f@T@@QAEHQAY2BE@BO@CI@D@Z", "public: int __thiscall T::f(char (* const)[20][30][40])"},
1269 /* 113 */ {"?f@T@@QAEHQAY1BE@BO@$$CBD@Z", "public: int __thiscall T::f(char const (* const)[20][30])"},
1270 /* 114 */ {"??0?$Foo@U?$vector_c@H$00$01$0?1$0A@$0A@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@$0HPPPPPPP@@mpl@boost@@@@QAE@XZ",
1271 "public: __thiscall Foo<struct boost::mpl::vector_c<int,1,2,-2,0,0,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647> >::Foo<struct boost::mpl::vector_c<int,1,2,-2,0,0,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647> >(void)"},
1272 /* 115 */ {"?swprintf@@YAHPAGIPBGZZ", "int __cdecl swprintf(unsigned short *,unsigned int,unsigned short const *,...)"},
1273 /* 116 */ {"?vswprintf@@YAHPAGIPBGPAD@Z", "int __cdecl vswprintf(unsigned short *,unsigned int,unsigned short const *,char *)"},
1274 /* 117 */ {"?vswprintf@@YAHPA_WIPB_WPAD@Z", "int __cdecl vswprintf(wchar_t *,unsigned int,wchar_t const *,char *)"},
1275 /* 118 */ {"?swprintf@@YAHPA_WIPB_WZZ", "int __cdecl swprintf(wchar_t *,unsigned int,wchar_t const *,...)"},
1276 /* 119 */ {"??Xstd@@YAAEAV?$complex@M@0@AEAV10@AEBV10@@Z", "class std::complex<float> & __ptr64 __cdecl std::operator*=(class std::complex<float> & __ptr64,class std::complex<float> const & __ptr64)"},
1277 /* 120 */ {"?_Doraise@bad_cast@std@@MEBAXXZ", "protected: virtual void __cdecl std::bad_cast::_Doraise(void)const __ptr64"},
1278 /* 121 */ {"??$?DM@std@@YA?AV?$complex@M@0@ABMABV10@@Z",
1279 "class std::complex<float> __cdecl std::operator*<float>(float const &,class std::complex<float> const &)",
1280 "??$?DM@std@@YA?AV?$complex@M@0@ABMABV10@@Z"},
1281 /* 122 */ {"?_R2@?BN@???$_Fabs@N@std@@YANAEBV?$complex@N@1@PEAH@Z@4NB",
1282 "double const `double __cdecl std::_Fabs<double>(class std::complex<double> const & __ptr64,int * __ptr64)'::`29'::_R2",
1283 "?_R2@?BN@???$_Fabs@N@std@@YANAEBV?$complex@N@1@PEAH@Z@4NB"},
1284 /* 123 */ {"?vtordisp_thunk@std@@$4PPPPPPPM@3EAA_NXZ",
1285 "[thunk]:public: virtual bool __cdecl std::vtordisp_thunk`vtordisp{4294967292,4}' (void) __ptr64",
1286 "[thunk]:public: virtual bool __cdecl std::vtordisp_thunk`vtordisp{-4,4}' (void) __ptr64"},
1287 /* 124 */ {"??_9CView@@$BBII@AE",
1288 "[thunk]: __thiscall CView::`vcall'{392,{flat}}' }'",
1289 "[thunk]: __thiscall CView::`vcall'{392,{flat}}' "},
1290 /* 125 */ {"?_dispatch@_impl_Engine@SalomeApp@@$R4CE@BA@PPPPPPPM@7AE_NAAVomniCallHandle@@@Z",
1291 "[thunk]:public: virtual bool __thiscall SalomeApp::_impl_Engine::_dispatch`vtordispex{36,16,4294967292,8}' (class omniCallHandle &)",
1292 "?_dispatch@_impl_Engine@SalomeApp@@$R4CE@BA@PPPPPPPM@7AE_NAAVomniCallHandle@@@Z"},
1293 /* 126 */ {"?_Doraise@bad_cast@std@@MEBAXXZ", "protected: virtual void __cdecl std::bad_cast::_Doraise(void)", NULL, 0x60},
1294 /* 127 */ {"??Xstd@@YAAEAV?$complex@M@0@AEAV10@AEBV10@@Z", "class std::complex<float> & ptr64 cdecl std::operator*=(class std::complex<float> & ptr64,class std::complex<float> const & ptr64)", NULL, 1},
1295 /* 128 */ {"??Xstd@@YAAEAV?$complex@M@0@AEAV10@AEBV10@@Z",
1296 "class std::complex<float> & std::operator*=(class std::complex<float> &,class std::complex<float> const &)",
1297 "??Xstd@@YAAEAV?$complex@M@0@AEAV10@AEBV10@@Z", 2},
1298 /* 129 */ {"??$run@XVTask_Render_Preview@@@QtConcurrent@@YA?AV?$QFuture@X@@PEAVTask_Render_Preview@@P82@EAAXXZ@Z",
1299 "class QFuture<void> __cdecl QtConcurrent::run<void,class Task_Render_Preview>(class Task_Render_Preview * __ptr64,void (__cdecl Task_Render_Preview::*)(void) __ptr64)",
1300 "??$run@XVTask_Render_Preview@@@QtConcurrent@@YA?AV?$QFuture@X@@PEAVTask_Render_Preview@@P82@EAAXXZ@Z"},
1301 /* 130 */ {"??_E?$TStrArray@$$BY0BAA@D$0BA@@@UAEPAXI@Z",
1302 "public: virtual void * __thiscall TStrArray<char [256],16>::`vector deleting destructor'(unsigned int)"},
1303 /* 131 */ {"??_R0?AVCC@DD@@@8", "class DD::CC `RTTI Type Descriptor'"},
1304 /* 132 */ {"??$meth@FD@DD@CC@@QAE_NK@Z", "public: bool __thiscall CC::DD::meth<short,char>(unsigned long)"},
1305 /* 133 */ {"?func@@YAXPIFAH@Z", "void __cdecl func(int __unaligned * __restrict)"},
1306 /* 135 */ {"?x@@3PAY02HA", "int (* x)[3]"},
1307 /* 136 */ {"?Qux@Bar@@0PAPAP6AHPAV1@AAH1PAH@ZA",
1308 "private: static int (__cdecl** * Bar::Qux)(class Bar *,int &,int &,int *)"}, /* variation of 105: note white space handling! */
1309 /* 137 */ {"?x@@3PAW4myenum@@A", "enum myenum * x"},
1310 /* 138 */ {"?pfunc@@3PAY0E@P6AXF@ZA", "void (__cdecl*(* pfunc)[4])(short)"},
1311 /* 139 */ {"??$?0AEAVzzz@BB4@AA@@AEAV012@$0A@@?$pair@Vzzz@BB4@AA@@V123@@std@@QEAA@AEAVzzz@BB4@AA@@0@Z",
1312 "public: __cdecl std::pair<class AA::BB4::zzz,class AA::BB4::zzz>::pair<class AA::BB4::zzz,class AA::BB4::zzz><class AA::BB4::zzz & __ptr64,class AA::BB4::zzz & __ptr64,0>(class AA::BB4::zzz & __ptr64,class AA::BB4::zzz & __ptr64) __ptr64"},
1313 /* 140 */ {"??$?BH@?$foo@N@@QEAAHXZ", "public: __cdecl foo<double>::operator<int> int(void) __ptr64"},
1314 /* 141 */ {"??Bcastop@@QAEHXZ", "public: __thiscall castop::operator int(void)"},
1315 /* 142 */ {"??Bcastop@@QAE?BHXZ", "public: __thiscall castop::operator int const (void)"},
1316 /* 143 */ {"?pfield@@3PTAA@@DT1@", "char const volatile AA::* const volatile pfield"},
1317 /* 144 */ {"?ptititi1@@3PEQtititi@@IEQ1@", "unsigned int tititi::* __ptr64 __ptr64 ptititi1"},
1318 /* 145 */ {"?ptititi2@@3PERtititi@@IER1@", "unsigned int const tititi::* __ptr64 const __ptr64 ptititi2"},
1319 /* 146 */ {"?ptititi3@@3PEStititi@@IES1@", "unsigned int volatile tititi::* __ptr64 volatile __ptr64 ptititi3"},
1320 /* 147 */ {"?ptititi4@@3PETtititi@@IET1@", "unsigned int const volatile tititi::* __ptr64 const volatile __ptr64 ptititi4"},
1321 /* 148 */ {"?ptititi4v@@3RETtititi@@IET1@", "unsigned int const volatile tititi::* __ptr64 const volatile __ptr64 ptititi4v"},
1322 /* 149 */ {"?meth@AAA@@QFCEXXZ", "public: void __thiscall AAA::meth(void)volatile __unaligned "},
1323 /* 150 */ {"?RegisterModuleUninitializer@<CrtImplementationDetails>@@YAXP$AAVEventHandler@System@@@Z",
1324 "void __cdecl <CrtImplementationDetails>::RegisterModuleUninitializer(class System::EventHandler ^)"},
1325 /* 151 */ {"?RegisterModuleUninitializer@<CrtImplementationDetails>@@YAXBE$AAVEventHandler@System@@@Z",
1326 "void __cdecl <CrtImplementationDetails>::RegisterModuleUninitializer(class System::EventHandler % __ptr64 volatile)"},
1327 /* 152 */ {"??$forward@AEAUFFIValue@?1??call@FFIFunctionBinder@@CAHPEAUlua_State@@@Z@@std@@YAAEAUFFIValue@?1??call@"
1328 "FFIFunctionBinder@@CAHPEAUxlua_State@@@Z@AEAU1?1??23@CAH0@Z@@Z",
1329 "struct `private: static int __cdecl FFIFunctionBinder::call(struct xlua_State * __ptr64)'::`2'::FFIValue & "
1330 "__ptr64 __cdecl std::forward<struct `private: static int __cdecl FFIFunctionBinder::call(struct lua_State "
1331 "* __ptr64)'::`2'::FFIValue & __ptr64>(struct `private: static int __cdecl FFIFunctionBinder::call(struct "
1332 "xlua_State * __ptr64)'::`2'::FFIValue & __ptr64)"},
1333 /* 153 */ {"?$AAA@XX", "AAA<void,void>"},
1334 /* 154 */ {"?$AAA@", "AAA<>"},
1336 int i;
1337 char* name;
1339 for (i = 0; i < ARRAY_SIZE(test); i++)
1341 name = p__unDName(0, test[i].in, 0, malloc, free, test[i].flags);
1342 ok(name != NULL, "%u: unDName failed\n", i);
1343 if (!name) continue;
1344 ok( !strcmp(test[i].out, name) ||
1345 broken(test[i].broken && !strcmp(test[i].broken, name)),
1346 "%u: Got name \"%s\"\n", i, name );
1347 ok( !strcmp(test[i].out, name) ||
1348 broken(test[i].broken && !strcmp(test[i].broken, name)),
1349 "%u: Expected \"%s\"\n", i, test[i].out );
1350 free(name);
1354 START_TEST(cpp)
1356 if (!InitFunctionPtrs())
1357 return;
1359 test_exception();
1360 test_bad_typeid();
1361 test_bad_cast();
1362 test___non_rtti_object();
1363 test_type_info();
1364 test_rtti();
1365 test_demangle_datatype();
1366 test_demangle();