d3d10/effect: Use case-insensitive comparison in GetMemberTypeBySemantic().
[wine.git] / dlls / msvcrt / tests / cpp.c
blob15105ca60ddc8e1b30352f50aa97cae989ec4a90
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@std@@QAA@ABQBD@Z");
227 SET(pexception_copy_ctor, "??0exception@std@@QAA@ABV01@@Z");
228 SET(pexception_default_ctor, "??0exception@std@@QAA@XZ");
229 SET(pexception_dtor, "??1exception@std@@UAA@XZ");
230 SET(pexception_opequals, "??4exception@std@@QAAAAV01@ABV01@@Z");
231 SET(pexception_what, "?what@exception@std@@UBAPBDXZ");
232 SET(pexception_vector_dtor, "??_Eexception@@UAEPAXI@Z");/**/
233 SET(pexception_scalar_dtor, "??_Gexception@@UAEPAXI@Z");/**/
235 SET(pbad_typeid_ctor, "??0bad_typeid@std@@QAA@PBD@Z");
236 SETNOFAIL(pbad_typeid_ctor_closure, "??_Fbad_typeid@std@@QAAXXZ");
237 SET(pbad_typeid_copy_ctor, "??0bad_typeid@std@@QAA@ABV01@@Z");
238 SET(pbad_typeid_dtor, "??1bad_typeid@std@@UAA@XZ");
239 SET(pbad_typeid_opequals, "??4bad_typeid@std@@QAAAAV01@ABV01@@Z");
240 SET(pbad_typeid_what, "?what@exception@std@@UBAPBDXZ");
241 SET(pbad_typeid_vector_dtor, "??_Ebad_cast@@UAEPAXI@Z");
242 SET(pbad_typeid_scalar_dtor, "??_Gbad_cast@@UAEPAXI@Z");
244 SETNOFAIL(pbad_cast_ctor, "??0bad_cast@@QAE@ABQBD@Z");
245 if (!pbad_cast_ctor)
246 SET(pbad_cast_ctor, "??0bad_cast@std@@AAA@PBQBD@Z");
247 SETNOFAIL(pbad_cast_ctor2, "??0bad_cast@std@@QAA@PBD@Z");
248 SETNOFAIL(pbad_cast_ctor_closure, "??_Fbad_cast@std@@QAAXXZ");
249 /* FIXME: No ARM equivalent for "??0bad_cast@@QAE@ABV0@@Z" */
250 SET(pbad_cast_dtor, "??1bad_cast@std@@UAA@XZ");
251 SET(pbad_cast_opequals, "??4bad_cast@std@@QAAAAV01@ABV01@@Z");
252 SET(pbad_cast_what, "?what@exception@std@@UBAPBDXZ");
253 SET(pbad_cast_vector_dtor, "??_Ebad_cast@@UAEPAXI@Z");
254 SET(pbad_cast_scalar_dtor, "??_Gbad_cast@@UAEPAXI@Z");
256 SET(p__non_rtti_object_ctor, "??0__non_rtti_object@std@@QAA@PBD@Z");
257 SET(p__non_rtti_object_copy_ctor, "??0__non_rtti_object@std@@QAA@ABV01@@Z");
258 SET(p__non_rtti_object_dtor, "??1__non_rtti_object@std@@UAA@XZ");
259 SET(p__non_rtti_object_opequals, "??4__non_rtti_object@std@@QAAAAV01@ABV01@@Z");
260 SET(p__non_rtti_object_what, "?what@exception@std@@UBAPBDXZ");
261 SET(p__non_rtti_object_vector_dtor, "??_E__non_rtti_object@@UAEPAXI@Z");
262 SET(p__non_rtti_object_scalar_dtor, "??_G__non_rtti_object@@UAEPAXI@Z");
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@@QBEPBDXZ");
267 SET(ptype_info_before, "?before@type_info@@QBA_NABV1@@Z");
268 SET(ptype_info_opequals_equals, "??8type_info@@QBA_NABV0@@Z");
269 SET(ptype_info_opnot_equals, "??9type_info@@QBA_NABV0@@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 #ifndef __x86_64__
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_data
896 type_info type_info[4];
898 struct _rtti_base_descriptor
900 DEFINE_RTTI_REF(type_info, type_descriptor);
901 int num_base_classes;
902 struct {
903 int this_offset;
904 int vbase_descr;
905 int vbase_offset;
906 } this_ptr_offsets;
907 unsigned int attributes;
908 } base_descriptor[4];
910 struct _rtti_base_array {
911 DEFINE_RTTI_REF(struct _rtti_base_descriptor, bases[4]);
912 } base_array;
914 struct _rtti_object_hierarchy {
915 unsigned int signature;
916 unsigned int attributes;
917 int array_len;
918 DEFINE_RTTI_REF(struct _rtti_base_array, base_classes);
919 } object_hierarchy;
921 struct _object_locator object_locator;
922 } simple_class_rtti = {
923 { {NULL, NULL, "simple_class"} },
924 { {RTTI_REF(simple_class_rtti, type_info[0]), 0, {0, 0, 0}, 0} },
925 { {RTTI_REF(simple_class_rtti, base_descriptor[0])} },
926 {0, 0, 1, RTTI_REF(simple_class_rtti, base_array)},
927 {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)}
928 }, child_class_rtti = {
929 { {NULL, NULL, "simple_class"}, {NULL, NULL, "child_class"} },
930 { {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} },
931 { {RTTI_REF(child_class_rtti, base_descriptor[0]), RTTI_REF(child_class_rtti, base_descriptor[1])} },
932 {0, 0, 2, RTTI_REF(child_class_rtti, base_array)},
933 {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)}
934 }, virtual_base_class_rtti = {
935 { {NULL, NULL, "simple_class"}, {NULL, NULL, "child_class"} },
936 { {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} },
937 { {RTTI_REF(virtual_base_class_rtti, base_descriptor[0]), RTTI_REF(virtual_base_class_rtti, base_descriptor[1])} },
938 {0, 0, 2, RTTI_REF(virtual_base_class_rtti, base_array)},
939 {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)}
941 static struct rtti_data simple_class_sig0_rtti, child_class_sig0_rtti;
943 void *simple_class_vtbl[2] = {&simple_class_rtti.object_locator};
944 void *simple_class = &simple_class_vtbl[1];
945 void *child_class_vtbl[2] = {&child_class_rtti.object_locator};
946 void *child_class = &child_class_vtbl[1];
947 void *simple_class_sig0_vtbl[2] = {&simple_class_sig0_rtti.object_locator};
948 void *simple_class_sig0 = &simple_class_sig0_vtbl[1];
949 void *child_class_sig0_vtbl[2] = {&child_class_sig0_rtti.object_locator};
950 void *child_class_sig0 = &child_class_sig0_vtbl[1];
951 void *virtual_base_class_vtbl[2] = {&virtual_base_class_rtti.object_locator};
952 int virtual_base_class_vbtbl[2] = {0, 0x100};
953 struct {
954 void *virtual_base[2];
955 char data[0x110-sizeof(void*)];
956 void *vbthis;
957 } virtual_base_class = { {&virtual_base_class_vtbl[1], virtual_base_class_vbtbl} };
959 static const char* e_name = "name";
960 type_info *ti,*bti;
961 exception e,b;
962 void *casted;
963 BOOL old_signature;
964 #ifdef __x86_64__
965 char *base = (char*)GetModuleHandleW(NULL);
966 #endif
968 if (!p__RTCastToVoid || !p__RTtypeid || !pexception_ctor || !pbad_typeid_ctor
969 || !p__RTDynamicCast || !pexception_dtor || !pbad_typeid_dtor)
970 return;
972 call_func2(pexception_ctor, &e, &e_name);
973 call_func2(pbad_typeid_ctor, &b, e_name);
975 obj_locator = get_obj_locator(&e);
976 if(obj_locator->signature!=1 && sizeof(void*)>sizeof(int))
977 old_signature = TRUE;
978 else
979 old_signature = FALSE;
981 /* dynamic_cast to void* */
982 casted = p__RTCastToVoid(&e);
983 ok (casted == (void*)&e, "failed cast to void\n");
985 /* dynamic_cast up */
986 ti = p__RTtypeid(&e);
987 bti = p__RTtypeid(&b);
989 casted = p__RTDynamicCast(&b, 0, NULL, ti, 0);
990 if (casted)
992 /* New versions do not allow this conversion due to compiler changes */
993 ok (casted == (void*)&b, "failed cast from bad_typeid to exception\n");
996 /* dynamic_cast down */
997 casted = p__RTDynamicCast(&e, 0, NULL, bti, 0);
998 ok (casted == NULL, "Cast succeeded\n");
1000 call_func1(pexception_dtor, &e);
1001 call_func1(pbad_typeid_dtor, &b);
1003 simple_class_sig0_rtti = simple_class_rtti;
1004 simple_class_sig0_rtti.object_locator.signature = 0;
1005 simple_class_sig0_rtti.base_descriptor[0].type_descriptor = RTTI_REF_SIG0(simple_class_sig0_rtti, type_info[0], base);
1006 simple_class_sig0_rtti.base_array.bases[0] = RTTI_REF_SIG0(simple_class_sig0_rtti, base_descriptor[0], base);
1007 simple_class_sig0_rtti.object_hierarchy.base_classes = RTTI_REF_SIG0(simple_class_sig0_rtti, base_array, base);
1008 simple_class_sig0_rtti.object_locator.type_descriptor = RTTI_REF_SIG0(simple_class_sig0_rtti, type_info[0], base);
1009 simple_class_sig0_rtti.object_locator.type_hierarchy = RTTI_REF_SIG0(simple_class_sig0_rtti, object_hierarchy, base);
1011 child_class_sig0_rtti = child_class_rtti;
1012 child_class_sig0_rtti.object_locator.signature = 0;
1013 child_class_sig0_rtti.base_descriptor[0].type_descriptor = RTTI_REF_SIG0(child_class_sig0_rtti, type_info[1], base);
1014 child_class_sig0_rtti.base_descriptor[1].type_descriptor = RTTI_REF_SIG0(child_class_sig0_rtti, type_info[0], base);
1015 child_class_sig0_rtti.base_array.bases[0] = RTTI_REF_SIG0(child_class_sig0_rtti, base_descriptor[0], base);
1016 child_class_sig0_rtti.base_array.bases[1] = RTTI_REF_SIG0(child_class_sig0_rtti, base_descriptor[1], base);
1017 child_class_sig0_rtti.object_hierarchy.base_classes = RTTI_REF_SIG0(child_class_sig0_rtti, base_array, base);
1018 child_class_sig0_rtti.object_locator.type_descriptor = RTTI_REF_SIG0(child_class_sig0_rtti, type_info[1], base);
1019 child_class_sig0_rtti.object_locator.type_hierarchy = RTTI_REF_SIG0(child_class_sig0_rtti, object_hierarchy, base);
1021 ti = p__RTtypeid(&simple_class_sig0);
1022 ok (ti && !strcmp(ti->mangled, "simple_class"), "incorrect rtti data\n");
1024 casted = p__RTCastToVoid(&simple_class_sig0);
1025 ok (casted == (void*)&simple_class_sig0, "failed cast to void\n");
1027 ti = p__RTtypeid(&child_class_sig0);
1028 ok (ti && !strcmp(ti->mangled, "child_class"), "incorrect rtti data\n");
1030 casted = p__RTCastToVoid(&child_class_sig0);
1031 ok (casted == (void*)&child_class_sig0, "failed cast to void\n");
1033 casted = p__RTDynamicCast(&child_class_sig0, 0, NULL, simple_class_sig0_rtti.type_info, 0);
1034 if(casted)
1036 ok (casted == (char*)&child_class_sig0+8, "failed cast to simple_class (%p %p)\n", casted, &child_class_sig0);
1039 casted = p__RTDynamicCast(&child_class_sig0, 0, &child_class_sig0_rtti.type_info[0], &child_class_sig0_rtti.type_info[1], 0);
1040 ok(casted == (char*)&child_class_sig0+4, "failed cast to child class (%p %p)\n", casted, &child_class_sig0);
1042 if(old_signature) {
1043 skip("signature==1 is not supported\n");
1044 return;
1047 ti = p__RTtypeid(&simple_class);
1048 ok (ti && !strcmp(ti->mangled, "simple_class"), "incorrect rtti data\n");
1050 casted = p__RTCastToVoid(&simple_class);
1051 ok (casted == (void*)&simple_class, "failed cast to void\n");
1053 ti = p__RTtypeid(&child_class);
1054 ok (ti && !strcmp(ti->mangled, "child_class"), "incorrect rtti data\n");
1056 casted = p__RTCastToVoid(&child_class);
1057 ok (casted == (void*)&child_class, "failed cast to void\n");
1059 casted = p__RTDynamicCast(&child_class, 0, NULL, simple_class_rtti.type_info, 0);
1060 if(casted)
1062 ok (casted == (char*)&child_class+8, "failed cast to simple_class (%p %p)\n", casted, &child_class);
1065 casted = p__RTDynamicCast(&child_class, 0, &child_class_rtti.type_info[0], &child_class_rtti.type_info[1], 0);
1066 ok(casted == (char*)&child_class+4, "failed cast to child class (%p %p)\n", casted, &child_class);
1068 casted = p__RTDynamicCast(&virtual_base_class, 0, &virtual_base_class_rtti.type_info[0], &virtual_base_class_rtti.type_info[1], 0);
1069 ok(casted == &virtual_base_class.vbthis, "failed cast to child class (%p %p)\n", casted, &virtual_base_class);
1072 struct _demangle {
1073 LPCSTR mangled;
1074 LPCSTR result;
1075 BOOL test_in_wine;
1078 static void test_demangle_datatype(void)
1080 char * name;
1081 struct _demangle demangle[]={
1082 { "BlaBla"," ?? ::Bla", FALSE},
1083 { "ABVVec4@ref2@dice@@", "class dice::ref2::Vec4 const &", TRUE},
1084 { "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$0H@@@",
1085 "class CDB_GEN_BIG_ENUM_FLAG<enum CDB_WYSIWYG_BITS_ENUM,7>", TRUE},
1086 { "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$0HO@@@",
1087 "class CDB_GEN_BIG_ENUM_FLAG<enum CDB_WYSIWYG_BITS_ENUM,126>",TRUE},
1088 { "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$0HOA@@@",
1089 "class CDB_GEN_BIG_ENUM_FLAG<enum CDB_WYSIWYG_BITS_ENUM,2016>",TRUE},
1090 { "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$0HOAA@@@",
1091 "class CDB_GEN_BIG_ENUM_FLAG<enum CDB_WYSIWYG_BITS_ENUM,32256>",TRUE},
1092 { "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$01@@@",
1093 "?AV?$CDB_GEN_BIG_ENUM_FLAG@W4CDB_WYSIWYG_BITS_ENUM@@$01@@@", FALSE},
1094 { "P8test@@AACXZ", "signed char (__cdecl test::*)(void)", TRUE},
1095 { "P8test@@BACXZ", "signed char (__cdecl test::*)(void)const ", TRUE},
1097 int i, num_test = ARRAY_SIZE(demangle);
1099 for (i = 0; i < num_test; i++)
1101 name = p__unDName(0, demangle[i].mangled, 0, malloc, free, 0x2800);
1102 todo_wine_if (!demangle[i].test_in_wine)
1103 ok(name != NULL && !strcmp(name,demangle[i].result), "Got name \"%s\" for %d\n", name, i);
1104 free(name);
1108 static void test_demangle(void)
1110 static struct {const char* in; const char* out; const char *broken; unsigned int flags;} test[] = {
1111 /* 0 */ {"??0bad_alloc@std@@QAE@ABV01@@Z",
1112 "public: __thiscall std::bad_alloc::bad_alloc(class std::bad_alloc const &)",
1113 "public: __thiscall std::bad_alloc::bad_alloc(class bad_alloc::bad_alloc const &)"},
1114 /* 1 */ {"??0bad_alloc@std@@QAE@PBD@Z",
1115 "public: __thiscall std::bad_alloc::bad_alloc(char const *)"},
1116 /* 2 */ {"??0bad_cast@@AAE@PBQBD@Z",
1117 "private: __thiscall bad_cast::bad_cast(char const * const *)"},
1118 /* 3 */ {"??0bad_cast@@QAE@ABQBD@Z",
1119 "public: __thiscall bad_cast::bad_cast(char const * const &)"},
1120 /* 4 */ {"??0bad_cast@@QAE@ABV0@@Z",
1121 "public: __thiscall bad_cast::bad_cast(class bad_cast const &)"},
1122 /* 5 */ {"??0bad_exception@std@@QAE@ABV01@@Z",
1123 "public: __thiscall std::bad_exception::bad_exception(class std::bad_exception const &)",
1124 "public: __thiscall std::bad_exception::bad_exception(class bad_exception::bad_exception const &)"},
1125 /* 6 */ {"??0bad_exception@std@@QAE@PBD@Z",
1126 "public: __thiscall std::bad_exception::bad_exception(char const *)"},
1127 /* 7 */ {"??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@ABV01@@Z",
1128 "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 &)",
1129 "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 &)"},
1130 /* 8 */ {"??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z",
1131 "public: __thiscall std::basic_filebuf<char,struct std::char_traits<char> >::basic_filebuf<char,struct std::char_traits<char> >(struct _iobuf *)"},
1132 /* 9 */ {"??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@@Z",
1133 "public: __thiscall std::basic_filebuf<char,struct std::char_traits<char> >::basic_filebuf<char,struct std::char_traits<char> >(enum std::_Uninitialized)",
1134 "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)"},
1135 /* 10 */ {"??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@ABV01@@Z",
1136 "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 &)",
1137 "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 &)"},
1138 /* 11 */ {"??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z",
1139 "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 *)"},
1140 /* 12 */ {"??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@@Z",
1141 "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)",
1142 "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)"},
1143 /* 13 */ {"??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z",
1144 "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 &)",
1145 "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 &)"},
1146 /* 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",
1147 "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)",
1148 "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)"},
1149 /* 15 */ {"??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z",
1150 "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)"},
1151 /* 16 */ {"??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@ABV01@@Z",
1152 "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 &)",
1153 "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 &)"},
1154 /* 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",
1155 "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)",
1156 "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)"},
1157 /* 18 */ {"??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z",
1158 "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)"},
1159 /* 19 */ {"??0?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QAE@ABV_Locinfo@1@I@Z",
1160 "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)",
1161 "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)"},
1162 /* 20 */ {"??0?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QAE@I@Z",
1163 "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)"},
1164 /* 21 */ {"??0?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QAE@ABV_Locinfo@1@I@Z",
1165 "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)",
1166 "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)"},
1167 /* 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)"},
1168 /* 23 */ {"??0streambuf@@QAE@ABV0@@Z", "public: __thiscall streambuf::streambuf(class streambuf const &)"},
1169 /* 24 */ {"??0strstreambuf@@QAE@ABV0@@Z", "public: __thiscall strstreambuf::strstreambuf(class strstreambuf const &)"},
1170 /* 25 */ {"??0strstreambuf@@QAE@H@Z", "public: __thiscall strstreambuf::strstreambuf(int)"},
1171 /* 26 */ {"??0strstreambuf@@QAE@P6APAXJ@ZP6AXPAX@Z@Z", "public: __thiscall strstreambuf::strstreambuf(void * (__cdecl*)(long),void (__cdecl*)(void *))"},
1172 /* 27 */ {"??0strstreambuf@@QAE@PADH0@Z", "public: __thiscall strstreambuf::strstreambuf(char *,int,char *)"},
1173 /* 28 */ {"??0strstreambuf@@QAE@PAEH0@Z", "public: __thiscall strstreambuf::strstreambuf(unsigned char *,int,unsigned char *)"},
1174 /* 29 */ {"??0strstreambuf@@QAE@XZ", "public: __thiscall strstreambuf::strstreambuf(void)"},
1175 /* 30 */ {"??1__non_rtti_object@std@@UAE@XZ", "public: virtual __thiscall std::__non_rtti_object::~__non_rtti_object(void)"},
1176 /* 31 */ {"??1__non_rtti_object@@UAE@XZ", "public: virtual __thiscall __non_rtti_object::~__non_rtti_object(void)"},
1177 /* 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)"},
1178 /* 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)"},
1179 /* 34 */ {"??4istream_withassign@@QAEAAV0@ABV0@@Z", "public: class istream_withassign & __thiscall istream_withassign::operator=(class istream_withassign const &)"},
1180 /* 35 */ {"??4istream_withassign@@QAEAAVistream@@ABV1@@Z", "public: class istream & __thiscall istream_withassign::operator=(class istream const &)"},
1181 /* 36 */ {"??4istream_withassign@@QAEAAVistream@@PAVstreambuf@@@Z", "public: class istream & __thiscall istream_withassign::operator=(class streambuf *)"},
1182 /* 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 &)"},
1183 /* 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 &)"},
1184 /* 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 &)"},
1185 /* 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 &))"},
1186 /* 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> > *)"},
1187 /* 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 *)"},
1188 /* 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> >'}"},
1189 /* 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> >'}"},
1190 /* 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> >'}"},
1191 /* 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 &)"},
1192 /* 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 &)"},
1193 /* 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)"},
1194 /* 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 "},
1195 /* 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)"},
1196 /* 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 "},
1197 /* 52 */ {"?abs@std@@YAMABV?$complex@M@1@@Z", "float __cdecl std::abs(class std::complex<float> const &)"},
1198 /* 53 */ {"?abs@std@@YANABV?$complex@N@1@@Z", "double __cdecl std::abs(class std::complex<double> const &)"},
1199 /* 54 */ {"?abs@std@@YAOABV?$complex@O@1@@Z", "long double __cdecl std::abs(class std::complex<long double> const &)"},
1200 /* 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"},
1201 /* 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 "},
1202 /* 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 "},
1203 /* 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 "},
1204 /* 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 "},
1205 /* 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 "},
1206 /* 61 */ {"?_query_new_handler@@YAP6AHI@ZXZ", "int (__cdecl*__cdecl _query_new_handler(void))(unsigned int)"},
1207 /* 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)"},
1208 /* 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)"},
1209 /* 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>)"},
1210 /* 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)"},
1211 /* 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>)"},
1212 /* 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)"},
1213 /* 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)"},
1214 /* 69 */ {"?set_new_handler@@YAP6AXXZP6AXXZ@Z", "void (__cdecl*__cdecl set_new_handler(void (__cdecl*)(void)))(void)"},
1215 /* 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 &)"},
1216 /* 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 "},
1217 /* 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 &)"},
1218 /* 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 "},
1219 /* 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 &)"},
1220 /* 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 "},
1221 /* 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 &)"},
1222 /* 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 "},
1223 /* 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 &)"},
1224 /* 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 "},
1225 /* 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 &)"},
1226 /* 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 "},
1227 /* 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 &)"},
1228 /* 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 "},
1229 /* 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 &)"},
1230 /* 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 "},
1231 /* 86 */ {"?_Sync@ios_base@std@@0_NA", "private: static bool std::ios_base::_Sync"},
1232 /* 87 */ {"??_U@YAPAXI@Z", "void * __cdecl operator new[](unsigned int)"},
1233 /* 88 */ {"??_V@YAXPAX@Z", "void __cdecl operator delete[](void *)"},
1234 /* 89 */ {"??X?$_Complex_base@M@std@@QAEAAV01@ABM@Z", "public: class std::_Complex_base<float> & __thiscall std::_Complex_base<float>::operator*=(float const &)"},
1235 /* 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 &)"},
1236 /* 91 */ {"?aaa@@YAHAAUbbb@@@Z", "int __cdecl aaa(struct bbb &)"},
1237 /* 92 */ {"?aaa@@YAHBAUbbb@@@Z", "int __cdecl aaa(struct bbb & volatile)"},
1238 /* 93 */ {"?aaa@@YAHPAUbbb@@@Z", "int __cdecl aaa(struct bbb *)"},
1239 /* 94 */ {"?aaa@@YAHQAUbbb@@@Z", "int __cdecl aaa(struct bbb * const)"},
1240 /* 95 */ {"?aaa@@YAHRAUbbb@@@Z", "int __cdecl aaa(struct bbb * volatile)"},
1241 /* 96 */ {"?aaa@@YAHSAUbbb@@@Z", "int __cdecl aaa(struct bbb * const volatile)"},
1242 /* 97 */ {"??0aa.a@@QAE@XZ", "??0aa.a@@QAE@XZ"},
1243 /* 98 */ {"??0aa$_3a@@QAE@XZ", "public: __thiscall aa$_3a::aa$_3a(void)"},
1244 /* 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)"},
1245 /* 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 *))"},
1246 /* 101 */ {"?$_aaa@Vbbb@@", "_aaa<class bbb>"},
1247 /* 102 */ {"?$aaa@Vbbb@ccc@@Vddd@2@", "aaa<class ccc::bbb,class ccc::ddd>"},
1248 /* 103 */ { "??0?$Foo@P6GHPAX0@Z@@QAE@PAD@Z", "public: __thiscall Foo<int (__stdcall*)(void *,void *)>::Foo<int (__stdcall*)(void *,void *)>(char *)"},
1249 /* 104 */ { "??0?$Foo@P6GHPAX0@Z@@QAE@PAD@Z", "__thiscall Foo<int (__stdcall*)(void *,void *)>::Foo<int (__stdcall*)(void *,void *)>(char *)", NULL, 0x880},
1250 /* 105 */ { "?Qux@Bar@@0PAP6AHPAV1@AAH1PAH@ZA", "private: static int (__cdecl** Bar::Qux)(class Bar *,int &,int &,int *)" },
1251 /* 106 */ { "?Qux@Bar@@0PAP6AHPAV1@AAH1PAH@ZA", "Bar::Qux", NULL, 0x1800},
1252 /* 107 */ {"?$AAA@$DBAB@", "AAA<`template-parameter257'>"},
1253 /* 108 */ {"?$AAA@?C@", "AAA<`template-parameter-2'>"},
1254 /* 109 */ {"?$AAA@PAUBBB@@", "AAA<struct BBB *>"},
1255 /* 110 */ {"??$ccccc@PAVaaa@@@bar@bb@foo@@DGPAV0@PAV0@PAVee@@IPAPAVaaa@@1@Z",
1256 "private: static class bar * __stdcall foo::bb::bar::ccccc<class aaa *>(class bar *,class ee *,unsigned int,class aaa * *,class ee *)",
1257 "??$ccccc@PAVaaa@@@bar@bb@foo@@DGPAV0@PAV0@PAVee@@IPAPAVaaa@@1@Z"},
1258 /* 111 */ {"?f@T@@QAEHQCY1BE@BO@D@Z", "public: int __thiscall T::f(char (volatile * const)[20][30])"},
1259 /* 112 */ {"?f@T@@QAEHQAY2BE@BO@CI@D@Z", "public: int __thiscall T::f(char (* const)[20][30][40])"},
1260 /* 113 */ {"?f@T@@QAEHQAY1BE@BO@$$CBD@Z", "public: int __thiscall T::f(char const (* const)[20][30])"},
1261 /* 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",
1262 "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)"},
1263 /* 115 */ {"?swprintf@@YAHPAGIPBGZZ", "int __cdecl swprintf(unsigned short *,unsigned int,unsigned short const *,...)"},
1264 /* 116 */ {"?vswprintf@@YAHPAGIPBGPAD@Z", "int __cdecl vswprintf(unsigned short *,unsigned int,unsigned short const *,char *)"},
1265 /* 117 */ {"?vswprintf@@YAHPA_WIPB_WPAD@Z", "int __cdecl vswprintf(wchar_t *,unsigned int,wchar_t const *,char *)"},
1266 /* 118 */ {"?swprintf@@YAHPA_WIPB_WZZ", "int __cdecl swprintf(wchar_t *,unsigned int,wchar_t const *,...)"},
1267 /* 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)"},
1268 /* 120 */ {"?_Doraise@bad_cast@std@@MEBAXXZ", "protected: virtual void __cdecl std::bad_cast::_Doraise(void)const __ptr64"},
1269 /* 121 */ {"??$?DM@std@@YA?AV?$complex@M@0@ABMABV10@@Z",
1270 "class std::complex<float> __cdecl std::operator*<float>(float const &,class std::complex<float> const &)",
1271 "??$?DM@std@@YA?AV?$complex@M@0@ABMABV10@@Z"},
1272 /* 122 */ {"?_R2@?BN@???$_Fabs@N@std@@YANAEBV?$complex@N@1@PEAH@Z@4NB",
1273 "double const `double __cdecl std::_Fabs<double>(class std::complex<double> const & __ptr64,int * __ptr64)'::`29'::_R2",
1274 "?_R2@?BN@???$_Fabs@N@std@@YANAEBV?$complex@N@1@PEAH@Z@4NB"},
1275 /* 123 */ {"?vtordisp_thunk@std@@$4PPPPPPPM@3EAA_NXZ",
1276 "[thunk]:public: virtual bool __cdecl std::vtordisp_thunk`vtordisp{4294967292,4}' (void) __ptr64",
1277 "[thunk]:public: virtual bool __cdecl std::vtordisp_thunk`vtordisp{-4,4}' (void) __ptr64"},
1278 /* 124 */ {"??_9CView@@$BBII@AE",
1279 "[thunk]: __thiscall CView::`vcall'{392,{flat}}' }'",
1280 "[thunk]: __thiscall CView::`vcall'{392,{flat}}' "},
1281 /* 125 */ {"?_dispatch@_impl_Engine@SalomeApp@@$R4CE@BA@PPPPPPPM@7AE_NAAVomniCallHandle@@@Z",
1282 "[thunk]:public: virtual bool __thiscall SalomeApp::_impl_Engine::_dispatch`vtordispex{36,16,4294967292,8}' (class omniCallHandle &)",
1283 "?_dispatch@_impl_Engine@SalomeApp@@$R4CE@BA@PPPPPPPM@7AE_NAAVomniCallHandle@@@Z"},
1284 /* 126 */ {"?_Doraise@bad_cast@std@@MEBAXXZ", "protected: virtual void __cdecl std::bad_cast::_Doraise(void)", NULL, 0x60},
1285 /* 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},
1286 /* 128 */ {"??Xstd@@YAAEAV?$complex@M@0@AEAV10@AEBV10@@Z",
1287 "class std::complex<float> & std::operator*=(class std::complex<float> &,class std::complex<float> const &)",
1288 "??Xstd@@YAAEAV?$complex@M@0@AEAV10@AEBV10@@Z", 2},
1289 /* 129 */ {"??$run@XVTask_Render_Preview@@@QtConcurrent@@YA?AV?$QFuture@X@@PEAVTask_Render_Preview@@P82@EAAXXZ@Z",
1290 "class QFuture<void> __cdecl QtConcurrent::run<void,class Task_Render_Preview>(class Task_Render_Preview * __ptr64,void (__cdecl Task_Render_Preview::*)(void) __ptr64)",
1291 "??$run@XVTask_Render_Preview@@@QtConcurrent@@YA?AV?$QFuture@X@@PEAVTask_Render_Preview@@P82@EAAXXZ@Z"},
1292 /* 130 */ {"??_E?$TStrArray@$$BY0BAA@D$0BA@@@UAEPAXI@Z",
1293 "public: virtual void * __thiscall TStrArray<char [256],16>::`vector deleting destructor'(unsigned int)"},
1295 int i, num_test = ARRAY_SIZE(test);
1296 char* name;
1298 for (i = 0; i < num_test; i++)
1300 name = p__unDName(0, test[i].in, 0, malloc, free, test[i].flags);
1301 ok(name != NULL, "%u: unDName failed\n", i);
1302 if (!name) continue;
1303 ok( !strcmp(test[i].out, name) ||
1304 broken(test[i].broken && !strcmp(test[i].broken, name)),
1305 "%u: Got name \"%s\"\n", i, name );
1306 ok( !strcmp(test[i].out, name) ||
1307 broken(test[i].broken && !strcmp(test[i].broken, name)),
1308 "%u: Expected \"%s\"\n", i, test[i].out );
1309 free(name);
1313 START_TEST(cpp)
1315 if (!InitFunctionPtrs())
1316 return;
1318 test_exception();
1319 test_bad_typeid();
1320 test_bad_cast();
1321 test___non_rtti_object();
1322 test_type_info();
1323 test_rtti();
1324 test_demangle_datatype();
1325 test_demangle();