• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===------------------------- dynamic_cast14.cpp -------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #include <cassert>
11 #include "support/timer.hpp"
12 
13 namespace t1
14 {
15 
16 struct A1
17 {
18     char _[43981];
~A1t1::A119     virtual ~A1() {}
20 
getA1t1::A121     A1* getA1() {return this;}
22 };
23 
24 struct A2
25 {
26     char _[34981];
~A2t1::A227     virtual ~A2() {}
28 
getA2t1::A229     A2* getA2() {return this;}
30 };
31 
32 struct A3
33     : public A1,
34       public virtual A2
35 {
36     char _[93481];
~A3t1::A337     virtual ~A3() {}
38 
getA1_3t1::A339     A1* getA1_3() {return A1::getA1();}
getA2t1::A340     A2* getA2() {return A2::getA2();}
getA3t1::A341     A3* getA3() {return this;}
42 };
43 
44 struct A4
45     : public virtual A2,
46       public A1
47 {
48     char _[13489];
~A4t1::A449     virtual ~A4() {}
50 
getA1_4t1::A451     A1* getA1_4() {return A1::getA1();}
getA2t1::A452     A2* getA2() {return A2::getA2();}
getA4t1::A453     A4* getA4() {return this;}
54 };
55 
56 struct A5
57     : public A3,
58       public A4
59 {
60     char _[13489];
~A5t1::A561     virtual ~A5() {}
62 
getA1_3t1::A563     A1* getA1_3() {return A3::getA1();}
getA1_4t1::A564     A1* getA1_4() {return A4::getA1();}
getA2t1::A565     A2* getA2() {return A3::getA2();}
getA3t1::A566     A3* getA3() {return A3::getA3();}
getA4t1::A567     A4* getA4() {return A4::getA4();}
getA5t1::A568     A5* getA5() {return this;}
69 };
70 
71 struct A6
72     : public A1
73 {
74     char _[81349];
~A6t1::A675     virtual ~A6() {}
76 
getA1_6t1::A677     A1* getA1_6() {return A1::getA1();}
getA6t1::A678     A6* getA6() {return this;}
79 };
80 
81 struct A7
82     : public A5,
83       public A6
84 {
85     char _[34819];
~A7t1::A786     virtual ~A7() {}
87 
getA1_3t1::A788     A1* getA1_3() {return A5::getA1_3();}
getA1_4t1::A789     A1* getA1_4() {return A5::getA1_4();}
getA1_6t1::A790     A1* getA1_6() {return A6::getA1_6();}
getA2t1::A791     A2* getA2() {return A5::getA2();}
getA3t1::A792     A3* getA3() {return A5::getA3();}
getA4t1::A793     A4* getA4() {return A5::getA4();}
getA5t1::A794     A5* getA5() {return A5::getA5();}
getA6t1::A795     A6* getA6() {return A6::getA6();}
getA7t1::A796     A7* getA7() {return this;}
97 };
98 
99 struct A8
100     : public A7
101 {
102     char _[3489];
~A8t1::A8103     virtual ~A8() {}
104 
getA1_3t1::A8105     A1* getA1_3() {return A7::getA1_3();}
getA1_4t1::A8106     A1* getA1_4() {return A7::getA1_4();}
getA1_6t1::A8107     A1* getA1_6() {return A7::getA1_6();}
getA2t1::A8108     A2* getA2() {return A7::getA2();}
getA3t1::A8109     A3* getA3() {return A7::getA3();}
getA4t1::A8110     A4* getA4() {return A7::getA4();}
getA5t1::A8111     A5* getA5() {return A7::getA5();}
getA6t1::A8112     A6* getA6() {return A7::getA6();}
getA7t1::A8113     A7* getA7() {return A7::getA7();}
getA8t1::A8114     A8* getA8() {return this;}
115 };
116 
117 struct A9
118     : public A1
119 {
120     char _[3481];
~A9t1::A9121     virtual ~A9() {}
122 
getA1_9t1::A9123     A1* getA1_9() {return A1::getA1();}
getA9t1::A9124     A9* getA9() {return this;}
125 };
126 
127 struct A10
128     : public virtual A8
129 {
130     char _[4831];
~A10t1::A10131     virtual ~A10() {}
132 
getA1_3t1::A10133     A1* getA1_3() {return A8::getA1_3();}
getA1_4t1::A10134     A1* getA1_4() {return A8::getA1_4();}
getA1_6t1::A10135     A1* getA1_6() {return A8::getA1_6();}
getA2t1::A10136     A2* getA2() {return A8::getA2();}
getA3t1::A10137     A3* getA3() {return A8::getA3();}
getA4t1::A10138     A4* getA4() {return A8::getA4();}
getA5t1::A10139     A5* getA5() {return A8::getA5();}
getA6t1::A10140     A6* getA6() {return A8::getA6();}
getA7t1::A10141     A7* getA7() {return A8::getA7();}
getA8t1::A10142     A8* getA8() {return A8::getA8();}
getA10t1::A10143     A10* getA10() {return this;}
144 };
145 
146 struct A11
147     : public virtual A8,
148       public A9
149 {
150     char _[6483];
~A11t1::A11151     virtual ~A11() {}
152 
getA1_3t1::A11153     A1* getA1_3() {return A8::getA1_3();}
getA1_4t1::A11154     A1* getA1_4() {return A8::getA1_4();}
getA1_6t1::A11155     A1* getA1_6() {return A8::getA1_6();}
getA1_9t1::A11156     A1* getA1_9() {return A9::getA1_9();}
getA2t1::A11157     A2* getA2() {return A8::getA2();}
getA3t1::A11158     A3* getA3() {return A8::getA3();}
getA4t1::A11159     A4* getA4() {return A8::getA4();}
getA5t1::A11160     A5* getA5() {return A8::getA5();}
getA6t1::A11161     A6* getA6() {return A8::getA6();}
getA7t1::A11162     A7* getA7() {return A8::getA7();}
getA8t1::A11163     A8* getA8() {return A8::getA8();}
getA9t1::A11164     A9* getA9() {return A9::getA9();}
getA11t1::A11165     A11* getA11() {return this;}
166 };
167 
168 struct A12
169     : public A10,
170       public A11
171 {
172     char _[2283];
~A12t1::A12173     virtual ~A12() {}
174 
getA1_3t1::A12175     A1* getA1_3() {return A10::getA1_3();}
getA1_4t1::A12176     A1* getA1_4() {return A10::getA1_4();}
getA1_6t1::A12177     A1* getA1_6() {return A10::getA1_6();}
getA1_9t1::A12178     A1* getA1_9() {return A11::getA1_9();}
getA2t1::A12179     A2* getA2() {return A10::getA2();}
getA3t1::A12180     A3* getA3() {return A10::getA3();}
getA4t1::A12181     A4* getA4() {return A10::getA4();}
getA5t1::A12182     A5* getA5() {return A10::getA5();}
getA6t1::A12183     A6* getA6() {return A10::getA6();}
getA7t1::A12184     A7* getA7() {return A10::getA7();}
getA8t1::A12185     A8* getA8() {return A10::getA8();}
getA9t1::A12186     A9* getA9() {return A11::getA9();}
getA10t1::A12187     A10* getA10() {return A10::getA10();}
getA11t1::A12188     A11* getA11() {return A11::getA11();}
getA12t1::A12189     A12* getA12() {return this;}
190 };
191 
192 struct A13
193     : public A12
194 {
195     char _[1283];
~A13t1::A13196     virtual ~A13() {}
197 
getA1_3t1::A13198     A1* getA1_3() {return A12::getA1_3();}
getA1_4t1::A13199     A1* getA1_4() {return A12::getA1_4();}
getA1_6t1::A13200     A1* getA1_6() {return A12::getA1_6();}
getA1_9t1::A13201     A1* getA1_9() {return A12::getA1_9();}
getA2t1::A13202     A2* getA2() {return A12::getA2();}
getA3t1::A13203     A3* getA3() {return A12::getA3();}
getA4t1::A13204     A4* getA4() {return A12::getA4();}
getA5t1::A13205     A5* getA5() {return A12::getA5();}
getA6t1::A13206     A6* getA6() {return A12::getA6();}
getA7t1::A13207     A7* getA7() {return A12::getA7();}
getA8t1::A13208     A8* getA8() {return A12::getA8();}
getA9t1::A13209     A9* getA9() {return A12::getA9();}
getA10t1::A13210     A10* getA10() {return A12::getA10();}
getA11t1::A13211     A11* getA11() {return A12::getA11();}
getA12t1::A13212     A12* getA12() {return A12::getA12();}
getA13t1::A13213     A13* getA13() {return this;}
214 };
215 
216 A3 a3;
217 A4 a4;
218 A5 a5;
219 A6 a6;
220 A7 a7;
221 A8 a8;
222 A9 a9;
223 A10 a10;
224 A11 a11;
225 A12 a12;
226 A13 a13;
227 
test()228 void test()
229 {
230     assert(dynamic_cast<A3*>(a3.getA1_3()) == a3.getA3());
231     assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
232 
233     assert(dynamic_cast<A3*>(a4.getA1_4()) == 0);
234     assert(dynamic_cast<A3*>(a4.getA2()) == 0);
235     assert(dynamic_cast<A4*>(a4.getA1_4()) == a4.getA4());
236     assert(dynamic_cast<A4*>(a4.getA2()) == a4.getA4());
237 
238     assert(dynamic_cast<A3*>(a5.getA1_3()) == a5.getA3());
239     assert(dynamic_cast<A3*>(a5.getA2()) == a5.getA3());
240 
241     assert(dynamic_cast<A4*>(a5.getA1_3()) == a5.getA4());
242     assert(dynamic_cast<A4*>(a5.getA1_4()) == a5.getA4());
243     assert(dynamic_cast<A4*>(a5.getA3()) == a5.getA4());
244     assert(dynamic_cast<A4*>(a5.getA3()) == a5.getA4());
245 
246     assert(dynamic_cast<A5*>(a5.getA1_3()) == a5.getA5());
247     assert(dynamic_cast<A5*>(a5.getA1_4()) == a5.getA5());
248     assert(dynamic_cast<A5*>(a5.getA3()) == a5.getA5());
249     assert(dynamic_cast<A5*>(a5.getA3()) == a5.getA5());
250     assert(dynamic_cast<A5*>(a5.getA3()) == a5.getA5());
251     assert(dynamic_cast<A5*>(a5.getA4()) == a5.getA5());
252 
253     assert(dynamic_cast<A3*>(a6.getA1_6()) == 0);
254 
255     assert(dynamic_cast<A4*>(a6.getA1_6()) == 0);
256 
257     assert(dynamic_cast<A5*>(a6.getA1_6()) == 0);
258 
259     assert(dynamic_cast<A6*>(a6.getA1_6()) == a6.getA6());
260 
261     assert(dynamic_cast<A3*>(a7.getA1_3()) == a7.getA3());
262     assert(dynamic_cast<A3*>(a7.getA1_4()) == a7.getA3());
263     assert(dynamic_cast<A3*>(a7.getA2()) == a7.getA3());
264 
265     assert(dynamic_cast<A4*>(a7.getA1_3()) == a7.getA4());
266     assert(dynamic_cast<A4*>(a7.getA1_4()) == a7.getA4());
267     assert(dynamic_cast<A4*>(a7.getA2()) == a7.getA4());
268     assert(dynamic_cast<A4*>(a7.getA3()) == a7.getA4());
269 
270     assert(dynamic_cast<A5*>(a7.getA1_3()) == a7.getA5());
271     assert(dynamic_cast<A5*>(a7.getA1_4()) == a7.getA5());
272     assert(dynamic_cast<A5*>(a7.getA2()) == a7.getA5());
273     assert(dynamic_cast<A5*>(a7.getA3()) == a7.getA5());
274     assert(dynamic_cast<A5*>(a7.getA4()) == a7.getA5());
275 
276     assert(dynamic_cast<A6*>(a7.getA1_3()) == a7.getA6());
277     assert(dynamic_cast<A6*>(a7.getA1_4()) == a7.getA6());
278     assert(dynamic_cast<A6*>(a7.getA1_6()) == a7.getA6());
279     assert(dynamic_cast<A6*>(a7.getA2()) == a7.getA6());
280     assert(dynamic_cast<A6*>(a7.getA3()) == a7.getA6());
281     assert(dynamic_cast<A6*>(a7.getA4()) == a7.getA6());
282     assert(dynamic_cast<A6*>(a7.getA5()) == a7.getA6());
283 
284     assert(dynamic_cast<A7*>(a7.getA1_3()) == a7.getA7());
285     assert(dynamic_cast<A7*>(a7.getA1_4()) == a7.getA7());
286     assert(dynamic_cast<A7*>(a7.getA1_6()) == a7.getA7());
287     assert(dynamic_cast<A7*>(a7.getA2()) == a7.getA7());
288     assert(dynamic_cast<A7*>(a7.getA3()) == a7.getA7());
289     assert(dynamic_cast<A7*>(a7.getA4()) == a7.getA7());
290     assert(dynamic_cast<A7*>(a7.getA5()) == a7.getA7());
291     assert(dynamic_cast<A7*>(a7.getA6()) == a7.getA7());
292 
293     assert(dynamic_cast<A3*>(a8.getA1_3()) == a8.getA3());
294     assert(dynamic_cast<A3*>(a8.getA1_4()) == a8.getA3());
295     assert(dynamic_cast<A3*>(a8.getA2()) == a8.getA3());
296 
297     assert(dynamic_cast<A4*>(a8.getA1_3()) == a8.getA4());
298     assert(dynamic_cast<A4*>(a8.getA1_4()) == a8.getA4());
299     assert(dynamic_cast<A4*>(a8.getA2()) == a8.getA4());
300     assert(dynamic_cast<A4*>(a8.getA3()) == a8.getA4());
301 
302     assert(dynamic_cast<A5*>(a8.getA1_3()) == a8.getA5());
303     assert(dynamic_cast<A5*>(a8.getA1_4()) == a8.getA5());
304     assert(dynamic_cast<A5*>(a8.getA2()) == a8.getA5());
305     assert(dynamic_cast<A5*>(a8.getA3()) == a8.getA5());
306     assert(dynamic_cast<A5*>(a8.getA4()) == a8.getA5());
307 
308     assert(dynamic_cast<A6*>(a8.getA1_3()) == a8.getA6());
309     assert(dynamic_cast<A6*>(a8.getA1_4()) == a8.getA6());
310     assert(dynamic_cast<A6*>(a8.getA1_6()) == a8.getA6());
311     assert(dynamic_cast<A6*>(a8.getA2()) == a8.getA6());
312     assert(dynamic_cast<A6*>(a8.getA3()) == a8.getA6());
313     assert(dynamic_cast<A6*>(a8.getA4()) == a8.getA6());
314     assert(dynamic_cast<A6*>(a8.getA5()) == a8.getA6());
315 
316     assert(dynamic_cast<A7*>(a8.getA1_3()) == a8.getA7());
317     assert(dynamic_cast<A7*>(a8.getA1_4()) == a8.getA7());
318     assert(dynamic_cast<A7*>(a8.getA1_6()) == a8.getA7());
319     assert(dynamic_cast<A7*>(a8.getA2()) == a8.getA7());
320     assert(dynamic_cast<A7*>(a8.getA3()) == a8.getA7());
321     assert(dynamic_cast<A7*>(a8.getA4()) == a8.getA7());
322     assert(dynamic_cast<A7*>(a8.getA5()) == a8.getA7());
323     assert(dynamic_cast<A7*>(a8.getA6()) == a8.getA7());
324 
325     assert(dynamic_cast<A8*>(a8.getA1_3()) == a8.getA8());
326     assert(dynamic_cast<A8*>(a8.getA1_4()) == a8.getA8());
327     assert(dynamic_cast<A8*>(a8.getA1_6()) == a8.getA8());
328     assert(dynamic_cast<A8*>(a8.getA2()) == a8.getA8());
329     assert(dynamic_cast<A8*>(a8.getA3()) == a8.getA8());
330     assert(dynamic_cast<A8*>(a8.getA4()) == a8.getA8());
331     assert(dynamic_cast<A8*>(a8.getA5()) == a8.getA8());
332     assert(dynamic_cast<A8*>(a8.getA6()) == a8.getA8());
333     assert(dynamic_cast<A8*>(a8.getA7()) == a8.getA8());
334 
335     assert(dynamic_cast<A3*>(a9.getA1_9()) == 0);
336 
337     assert(dynamic_cast<A4*>(a9.getA1_9()) == 0);
338 
339     assert(dynamic_cast<A5*>(a9.getA1_9()) == 0);
340 
341     assert(dynamic_cast<A6*>(a9.getA1_9()) == 0);
342 
343     assert(dynamic_cast<A7*>(a9.getA1_9()) == 0);
344 
345     assert(dynamic_cast<A8*>(a9.getA1_9()) == 0);
346 
347     assert(dynamic_cast<A9*>(a9.getA1_9()) == a9.getA9());
348 
349     assert(dynamic_cast<A3*>(a10.getA1_3()) == a10.getA3());
350     assert(dynamic_cast<A3*>(a10.getA1_4()) == a10.getA3());
351     assert(dynamic_cast<A3*>(a10.getA1_6()) == a10.getA3());
352     assert(dynamic_cast<A3*>(a10.getA2()) == a10.getA3());
353 
354     assert(dynamic_cast<A4*>(a10.getA1_3()) == a10.getA4());
355     assert(dynamic_cast<A4*>(a10.getA1_4()) == a10.getA4());
356     assert(dynamic_cast<A4*>(a10.getA1_6()) == a10.getA4());
357     assert(dynamic_cast<A4*>(a10.getA2()) == a10.getA4());
358     assert(dynamic_cast<A4*>(a10.getA3()) == a10.getA4());
359 
360     assert(dynamic_cast<A5*>(a10.getA1_3()) == a10.getA5());
361     assert(dynamic_cast<A5*>(a10.getA1_4()) == a10.getA5());
362     assert(dynamic_cast<A5*>(a10.getA1_6()) == a10.getA5());
363     assert(dynamic_cast<A5*>(a10.getA2()) == a10.getA5());
364     assert(dynamic_cast<A5*>(a10.getA3()) == a10.getA5());
365     assert(dynamic_cast<A5*>(a10.getA4()) == a10.getA5());
366 
367     assert(dynamic_cast<A6*>(a10.getA1_3()) == a10.getA6());
368     assert(dynamic_cast<A6*>(a10.getA1_4()) == a10.getA6());
369     assert(dynamic_cast<A6*>(a10.getA1_6()) == a10.getA6());
370     assert(dynamic_cast<A6*>(a10.getA2()) == a10.getA6());
371     assert(dynamic_cast<A6*>(a10.getA3()) == a10.getA6());
372     assert(dynamic_cast<A6*>(a10.getA4()) == a10.getA6());
373     assert(dynamic_cast<A6*>(a10.getA5()) == a10.getA6());
374 
375     assert(dynamic_cast<A7*>(a10.getA1_3()) == a10.getA7());
376     assert(dynamic_cast<A7*>(a10.getA1_4()) == a10.getA7());
377     assert(dynamic_cast<A7*>(a10.getA1_6()) == a10.getA7());
378     assert(dynamic_cast<A7*>(a10.getA2()) == a10.getA7());
379     assert(dynamic_cast<A7*>(a10.getA3()) == a10.getA7());
380     assert(dynamic_cast<A7*>(a10.getA4()) == a10.getA7());
381     assert(dynamic_cast<A7*>(a10.getA5()) == a10.getA7());
382     assert(dynamic_cast<A7*>(a10.getA6()) == a10.getA7());
383 
384     assert(dynamic_cast<A8*>(a10.getA1_3()) == a10.getA8());
385     assert(dynamic_cast<A8*>(a10.getA1_4()) == a10.getA8());
386     assert(dynamic_cast<A8*>(a10.getA1_6()) == a10.getA8());
387     assert(dynamic_cast<A8*>(a10.getA2()) == a10.getA8());
388     assert(dynamic_cast<A8*>(a10.getA3()) == a10.getA8());
389     assert(dynamic_cast<A8*>(a10.getA4()) == a10.getA8());
390     assert(dynamic_cast<A8*>(a10.getA5()) == a10.getA8());
391     assert(dynamic_cast<A8*>(a10.getA6()) == a10.getA8());
392     assert(dynamic_cast<A8*>(a10.getA7()) == a10.getA8());
393 
394     assert(dynamic_cast<A9*>(a10.getA1_3()) == 0);
395     assert(dynamic_cast<A9*>(a10.getA1_4()) == 0);
396     assert(dynamic_cast<A9*>(a10.getA1_6()) == 0);
397     assert(dynamic_cast<A9*>(a10.getA2()) == 0);
398     assert(dynamic_cast<A9*>(a10.getA3()) == 0);
399     assert(dynamic_cast<A9*>(a10.getA4()) == 0);
400     assert(dynamic_cast<A9*>(a10.getA5()) == 0);
401     assert(dynamic_cast<A9*>(a10.getA6()) == 0);
402     assert(dynamic_cast<A9*>(a10.getA7()) == 0);
403     assert(dynamic_cast<A9*>(a10.getA8()) == 0);
404 
405     assert(dynamic_cast<A10*>(a10.getA1_3()) == a10.getA10());
406     assert(dynamic_cast<A10*>(a10.getA1_4()) == a10.getA10());
407     assert(dynamic_cast<A10*>(a10.getA1_6()) == a10.getA10());
408     assert(dynamic_cast<A10*>(a10.getA2()) == a10.getA10());
409     assert(dynamic_cast<A10*>(a10.getA3()) == a10.getA10());
410     assert(dynamic_cast<A10*>(a10.getA4()) == a10.getA10());
411     assert(dynamic_cast<A10*>(a10.getA5()) == a10.getA10());
412     assert(dynamic_cast<A10*>(a10.getA6()) == a10.getA10());
413     assert(dynamic_cast<A10*>(a10.getA7()) == a10.getA10());
414     assert(dynamic_cast<A10*>(a10.getA8()) == a10.getA10());
415 
416     assert(dynamic_cast<A3*>(a11.getA1_3()) == a11.getA3());
417     assert(dynamic_cast<A3*>(a11.getA1_4()) == a11.getA3());
418     assert(dynamic_cast<A3*>(a11.getA1_6()) == a11.getA3());
419     assert(dynamic_cast<A3*>(a11.getA1_9()) == a11.getA3());
420     assert(dynamic_cast<A3*>(a11.getA2()) == a11.getA3());
421 
422     assert(dynamic_cast<A4*>(a11.getA1_3()) == a11.getA4());
423     assert(dynamic_cast<A4*>(a11.getA1_4()) == a11.getA4());
424     assert(dynamic_cast<A4*>(a11.getA1_6()) == a11.getA4());
425     assert(dynamic_cast<A4*>(a11.getA1_9()) == a11.getA4());
426     assert(dynamic_cast<A4*>(a11.getA2()) == a11.getA4());
427     assert(dynamic_cast<A4*>(a11.getA3()) == a11.getA4());
428 
429     assert(dynamic_cast<A5*>(a11.getA1_3()) == a11.getA5());
430     assert(dynamic_cast<A5*>(a11.getA1_4()) == a11.getA5());
431     assert(dynamic_cast<A5*>(a11.getA1_6()) == a11.getA5());
432     assert(dynamic_cast<A5*>(a11.getA1_9()) == a11.getA5());
433     assert(dynamic_cast<A5*>(a11.getA2()) == a11.getA5());
434     assert(dynamic_cast<A5*>(a11.getA3()) == a11.getA5());
435     assert(dynamic_cast<A5*>(a11.getA4()) == a11.getA5());
436 
437     assert(dynamic_cast<A6*>(a11.getA1_3()) == a11.getA6());
438     assert(dynamic_cast<A6*>(a11.getA1_4()) == a11.getA6());
439     assert(dynamic_cast<A6*>(a11.getA1_6()) == a11.getA6());
440     assert(dynamic_cast<A6*>(a11.getA1_9()) == a11.getA6());
441     assert(dynamic_cast<A6*>(a11.getA2()) == a11.getA6());
442     assert(dynamic_cast<A6*>(a11.getA3()) == a11.getA6());
443     assert(dynamic_cast<A6*>(a11.getA4()) == a11.getA6());
444     assert(dynamic_cast<A6*>(a11.getA5()) == a11.getA6());
445 
446     assert(dynamic_cast<A7*>(a11.getA1_3()) == a11.getA7());
447     assert(dynamic_cast<A7*>(a11.getA1_4()) == a11.getA7());
448     assert(dynamic_cast<A7*>(a11.getA1_6()) == a11.getA7());
449     assert(dynamic_cast<A7*>(a11.getA1_9()) == a11.getA7());
450     assert(dynamic_cast<A7*>(a11.getA2()) == a11.getA7());
451     assert(dynamic_cast<A7*>(a11.getA3()) == a11.getA7());
452     assert(dynamic_cast<A7*>(a11.getA4()) == a11.getA7());
453     assert(dynamic_cast<A7*>(a11.getA5()) == a11.getA7());
454     assert(dynamic_cast<A7*>(a11.getA6()) == a11.getA7());
455 
456     assert(dynamic_cast<A8*>(a11.getA1_3()) == a11.getA8());
457     assert(dynamic_cast<A8*>(a11.getA1_4()) == a11.getA8());
458     assert(dynamic_cast<A8*>(a11.getA1_6()) == a11.getA8());
459     assert(dynamic_cast<A8*>(a11.getA1_9()) == a11.getA8());
460     assert(dynamic_cast<A8*>(a11.getA2()) == a11.getA8());
461     assert(dynamic_cast<A8*>(a11.getA3()) == a11.getA8());
462     assert(dynamic_cast<A8*>(a11.getA4()) == a11.getA8());
463     assert(dynamic_cast<A8*>(a11.getA5()) == a11.getA8());
464     assert(dynamic_cast<A8*>(a11.getA6()) == a11.getA8());
465     assert(dynamic_cast<A8*>(a11.getA7()) == a11.getA8());
466 
467     assert(dynamic_cast<A9*>(a11.getA1_3()) == a11.getA9());
468     assert(dynamic_cast<A9*>(a11.getA1_4()) == a11.getA9());
469     assert(dynamic_cast<A9*>(a11.getA1_6()) == a11.getA9());
470     assert(dynamic_cast<A9*>(a11.getA1_9()) == a11.getA9());
471     assert(dynamic_cast<A9*>(a11.getA2()) == a11.getA9());
472     assert(dynamic_cast<A9*>(a11.getA3()) == a11.getA9());
473     assert(dynamic_cast<A9*>(a11.getA4()) == a11.getA9());
474     assert(dynamic_cast<A9*>(a11.getA5()) == a11.getA9());
475     assert(dynamic_cast<A9*>(a11.getA6()) == a11.getA9());
476     assert(dynamic_cast<A9*>(a11.getA7()) == a11.getA9());
477     assert(dynamic_cast<A9*>(a11.getA8()) == a11.getA9());
478 
479     assert(dynamic_cast<A10*>(a11.getA1_3()) == 0);
480     assert(dynamic_cast<A10*>(a11.getA1_4()) == 0);
481     assert(dynamic_cast<A10*>(a11.getA1_6()) == 0);
482     assert(dynamic_cast<A10*>(a11.getA1_9()) == 0);
483     assert(dynamic_cast<A10*>(a11.getA2()) == 0);
484     assert(dynamic_cast<A10*>(a11.getA3()) == 0);
485     assert(dynamic_cast<A10*>(a11.getA4()) == 0);
486     assert(dynamic_cast<A10*>(a11.getA5()) == 0);
487     assert(dynamic_cast<A10*>(a11.getA6()) == 0);
488     assert(dynamic_cast<A10*>(a11.getA7()) == 0);
489     assert(dynamic_cast<A10*>(a11.getA8()) == 0);
490     assert(dynamic_cast<A10*>(a11.getA9()) == 0);
491 
492     assert(dynamic_cast<A11*>(a11.getA1_3()) == a11.getA11());
493     assert(dynamic_cast<A11*>(a11.getA1_4()) == a11.getA11());
494     assert(dynamic_cast<A11*>(a11.getA1_6()) == a11.getA11());
495     assert(dynamic_cast<A11*>(a11.getA1_9()) == a11.getA11());
496     assert(dynamic_cast<A11*>(a11.getA2()) == a11.getA11());
497     assert(dynamic_cast<A11*>(a11.getA3()) == a11.getA11());
498     assert(dynamic_cast<A11*>(a11.getA4()) == a11.getA11());
499     assert(dynamic_cast<A11*>(a11.getA5()) == a11.getA11());
500     assert(dynamic_cast<A11*>(a11.getA6()) == a11.getA11());
501     assert(dynamic_cast<A11*>(a11.getA7()) == a11.getA11());
502     assert(dynamic_cast<A11*>(a11.getA8()) == a11.getA11());
503     assert(dynamic_cast<A11*>(a11.getA9()) == a11.getA11());
504 
505     assert(dynamic_cast<A3*>(a12.getA1_3()) == a12.getA3());
506     assert(dynamic_cast<A3*>(a12.getA1_4()) == a12.getA3());
507     assert(dynamic_cast<A3*>(a12.getA1_6()) == a12.getA3());
508     assert(dynamic_cast<A3*>(a12.getA1_9()) == a12.getA3());
509     assert(dynamic_cast<A3*>(a12.getA2()) == a12.getA3());
510 
511     assert(dynamic_cast<A4*>(a12.getA1_3()) == a12.getA4());
512     assert(dynamic_cast<A4*>(a12.getA1_4()) == a12.getA4());
513     assert(dynamic_cast<A4*>(a12.getA1_6()) == a12.getA4());
514     assert(dynamic_cast<A4*>(a12.getA1_9()) == a12.getA4());
515     assert(dynamic_cast<A4*>(a12.getA2()) == a12.getA4());
516     assert(dynamic_cast<A4*>(a12.getA3()) == a12.getA4());
517 
518     assert(dynamic_cast<A5*>(a12.getA1_3()) == a12.getA5());
519     assert(dynamic_cast<A5*>(a12.getA1_4()) == a12.getA5());
520     assert(dynamic_cast<A5*>(a12.getA1_6()) == a12.getA5());
521     assert(dynamic_cast<A5*>(a12.getA1_9()) == a12.getA5());
522     assert(dynamic_cast<A5*>(a12.getA2()) == a12.getA5());
523     assert(dynamic_cast<A5*>(a12.getA3()) == a12.getA5());
524     assert(dynamic_cast<A5*>(a12.getA4()) == a12.getA5());
525 
526     assert(dynamic_cast<A6*>(a12.getA1_3()) == a12.getA6());
527     assert(dynamic_cast<A6*>(a12.getA1_4()) == a12.getA6());
528     assert(dynamic_cast<A6*>(a12.getA1_6()) == a12.getA6());
529     assert(dynamic_cast<A6*>(a12.getA1_9()) == a12.getA6());
530     assert(dynamic_cast<A6*>(a12.getA2()) == a12.getA6());
531     assert(dynamic_cast<A6*>(a12.getA3()) == a12.getA6());
532     assert(dynamic_cast<A6*>(a12.getA4()) == a12.getA6());
533     assert(dynamic_cast<A6*>(a12.getA5()) == a12.getA6());
534 
535     assert(dynamic_cast<A7*>(a12.getA1_3()) == a12.getA7());
536     assert(dynamic_cast<A7*>(a12.getA1_4()) == a12.getA7());
537     assert(dynamic_cast<A7*>(a12.getA1_6()) == a12.getA7());
538     assert(dynamic_cast<A7*>(a12.getA1_9()) == a12.getA7());
539     assert(dynamic_cast<A7*>(a12.getA2()) == a12.getA7());
540     assert(dynamic_cast<A7*>(a12.getA3()) == a12.getA7());
541     assert(dynamic_cast<A7*>(a12.getA4()) == a12.getA7());
542     assert(dynamic_cast<A7*>(a12.getA5()) == a12.getA7());
543     assert(dynamic_cast<A7*>(a12.getA6()) == a12.getA7());
544 
545     assert(dynamic_cast<A8*>(a12.getA1_3()) == a12.getA8());
546     assert(dynamic_cast<A8*>(a12.getA1_4()) == a12.getA8());
547     assert(dynamic_cast<A8*>(a12.getA1_6()) == a12.getA8());
548     assert(dynamic_cast<A8*>(a12.getA1_9()) == a12.getA8());
549     assert(dynamic_cast<A8*>(a12.getA2()) == a12.getA8());
550     assert(dynamic_cast<A8*>(a12.getA3()) == a12.getA8());
551     assert(dynamic_cast<A8*>(a12.getA4()) == a12.getA8());
552     assert(dynamic_cast<A8*>(a12.getA5()) == a12.getA8());
553     assert(dynamic_cast<A8*>(a12.getA6()) == a12.getA8());
554     assert(dynamic_cast<A8*>(a12.getA7()) == a12.getA8());
555 
556     assert(dynamic_cast<A9*>(a12.getA1_3()) == a12.getA9());
557     assert(dynamic_cast<A9*>(a12.getA1_4()) == a12.getA9());
558     assert(dynamic_cast<A9*>(a12.getA1_6()) == a12.getA9());
559     assert(dynamic_cast<A9*>(a12.getA1_9()) == a12.getA9());
560     assert(dynamic_cast<A9*>(a12.getA2()) == a12.getA9());
561     assert(dynamic_cast<A9*>(a12.getA3()) == a12.getA9());
562     assert(dynamic_cast<A9*>(a12.getA4()) == a12.getA9());
563     assert(dynamic_cast<A9*>(a12.getA5()) == a12.getA9());
564     assert(dynamic_cast<A9*>(a12.getA6()) == a12.getA9());
565     assert(dynamic_cast<A9*>(a12.getA7()) == a12.getA9());
566     assert(dynamic_cast<A9*>(a12.getA8()) == a12.getA9());
567 
568     assert(dynamic_cast<A10*>(a12.getA1_3()) == a12.getA10());
569     assert(dynamic_cast<A10*>(a12.getA1_4()) == a12.getA10());
570     assert(dynamic_cast<A10*>(a12.getA1_6()) == a12.getA10());
571     assert(dynamic_cast<A10*>(a12.getA1_9()) == a12.getA10());
572     assert(dynamic_cast<A10*>(a12.getA2()) == a12.getA10());
573     assert(dynamic_cast<A10*>(a12.getA3()) == a12.getA10());
574     assert(dynamic_cast<A10*>(a12.getA4()) == a12.getA10());
575     assert(dynamic_cast<A10*>(a12.getA5()) == a12.getA10());
576     assert(dynamic_cast<A10*>(a12.getA6()) == a12.getA10());
577     assert(dynamic_cast<A10*>(a12.getA7()) == a12.getA10());
578     assert(dynamic_cast<A10*>(a12.getA8()) == a12.getA10());
579     assert(dynamic_cast<A10*>(a12.getA9()) == a12.getA10());
580 
581     assert(dynamic_cast<A11*>(a12.getA1_3()) == a12.getA11());
582     assert(dynamic_cast<A11*>(a12.getA1_4()) == a12.getA11());
583     assert(dynamic_cast<A11*>(a12.getA1_6()) == a12.getA11());
584     assert(dynamic_cast<A11*>(a12.getA1_9()) == a12.getA11());
585     assert(dynamic_cast<A11*>(a12.getA2()) == a12.getA11());
586     assert(dynamic_cast<A11*>(a12.getA3()) == a12.getA11());
587     assert(dynamic_cast<A11*>(a12.getA4()) == a12.getA11());
588     assert(dynamic_cast<A11*>(a12.getA5()) == a12.getA11());
589     assert(dynamic_cast<A11*>(a12.getA6()) == a12.getA11());
590     assert(dynamic_cast<A11*>(a12.getA7()) == a12.getA11());
591     assert(dynamic_cast<A11*>(a12.getA8()) == a12.getA11());
592     assert(dynamic_cast<A11*>(a12.getA9()) == a12.getA11());
593     assert(dynamic_cast<A11*>(a12.getA10()) == a12.getA11());
594 
595     assert(dynamic_cast<A12*>(a12.getA1_3()) == a12.getA12());
596     assert(dynamic_cast<A12*>(a12.getA1_4()) == a12.getA12());
597     assert(dynamic_cast<A12*>(a12.getA1_6()) == a12.getA12());
598     assert(dynamic_cast<A12*>(a12.getA1_9()) == a12.getA12());
599     assert(dynamic_cast<A12*>(a12.getA2()) == a12.getA12());
600     assert(dynamic_cast<A12*>(a12.getA3()) == a12.getA12());
601     assert(dynamic_cast<A12*>(a12.getA4()) == a12.getA12());
602     assert(dynamic_cast<A12*>(a12.getA5()) == a12.getA12());
603     assert(dynamic_cast<A12*>(a12.getA6()) == a12.getA12());
604     assert(dynamic_cast<A12*>(a12.getA7()) == a12.getA12());
605     assert(dynamic_cast<A12*>(a12.getA8()) == a12.getA12());
606     assert(dynamic_cast<A12*>(a12.getA9()) == a12.getA12());
607     assert(dynamic_cast<A12*>(a12.getA10()) == a12.getA12());
608     assert(dynamic_cast<A12*>(a12.getA11()) == a12.getA12());
609 
610     assert(dynamic_cast<A3*>(a13.getA1_3()) == a13.getA3());
611     assert(dynamic_cast<A3*>(a13.getA1_4()) == a13.getA3());
612     assert(dynamic_cast<A3*>(a13.getA1_6()) == a13.getA3());
613     assert(dynamic_cast<A3*>(a13.getA1_9()) == a13.getA3());
614     assert(dynamic_cast<A3*>(a13.getA2()) == a13.getA3());
615 
616     assert(dynamic_cast<A4*>(a13.getA1_3()) == a13.getA4());
617     assert(dynamic_cast<A4*>(a13.getA1_4()) == a13.getA4());
618     assert(dynamic_cast<A4*>(a13.getA1_6()) == a13.getA4());
619     assert(dynamic_cast<A4*>(a13.getA1_9()) == a13.getA4());
620     assert(dynamic_cast<A4*>(a13.getA2()) == a13.getA4());
621     assert(dynamic_cast<A4*>(a13.getA3()) == a13.getA4());
622 
623     assert(dynamic_cast<A5*>(a13.getA1_3()) == a13.getA5());
624     assert(dynamic_cast<A5*>(a13.getA1_4()) == a13.getA5());
625     assert(dynamic_cast<A5*>(a13.getA1_6()) == a13.getA5());
626     assert(dynamic_cast<A5*>(a13.getA1_9()) == a13.getA5());
627     assert(dynamic_cast<A5*>(a13.getA2()) == a13.getA5());
628     assert(dynamic_cast<A5*>(a13.getA3()) == a13.getA5());
629     assert(dynamic_cast<A5*>(a13.getA4()) == a13.getA5());
630 
631     assert(dynamic_cast<A6*>(a13.getA1_3()) == a13.getA6());
632     assert(dynamic_cast<A6*>(a13.getA1_4()) == a13.getA6());
633     assert(dynamic_cast<A6*>(a13.getA1_6()) == a13.getA6());
634     assert(dynamic_cast<A6*>(a13.getA1_9()) == a13.getA6());
635     assert(dynamic_cast<A6*>(a13.getA2()) == a13.getA6());
636     assert(dynamic_cast<A6*>(a13.getA3()) == a13.getA6());
637     assert(dynamic_cast<A6*>(a13.getA4()) == a13.getA6());
638     assert(dynamic_cast<A6*>(a13.getA5()) == a13.getA6());
639 
640     assert(dynamic_cast<A7*>(a13.getA1_3()) == a13.getA7());
641     assert(dynamic_cast<A7*>(a13.getA1_4()) == a13.getA7());
642     assert(dynamic_cast<A7*>(a13.getA1_6()) == a13.getA7());
643     assert(dynamic_cast<A7*>(a13.getA1_9()) == a13.getA7());
644     assert(dynamic_cast<A7*>(a13.getA2()) == a13.getA7());
645     assert(dynamic_cast<A7*>(a13.getA3()) == a13.getA7());
646     assert(dynamic_cast<A7*>(a13.getA4()) == a13.getA7());
647     assert(dynamic_cast<A7*>(a13.getA5()) == a13.getA7());
648     assert(dynamic_cast<A7*>(a13.getA6()) == a13.getA7());
649 
650     assert(dynamic_cast<A8*>(a13.getA1_3()) == a13.getA8());
651     assert(dynamic_cast<A8*>(a13.getA1_4()) == a13.getA8());
652     assert(dynamic_cast<A8*>(a13.getA1_6()) == a13.getA8());
653     assert(dynamic_cast<A8*>(a13.getA1_9()) == a13.getA8());
654     assert(dynamic_cast<A8*>(a13.getA2()) == a13.getA8());
655     assert(dynamic_cast<A8*>(a13.getA3()) == a13.getA8());
656     assert(dynamic_cast<A8*>(a13.getA4()) == a13.getA8());
657     assert(dynamic_cast<A8*>(a13.getA5()) == a13.getA8());
658     assert(dynamic_cast<A8*>(a13.getA6()) == a13.getA8());
659     assert(dynamic_cast<A8*>(a13.getA7()) == a13.getA8());
660 
661     assert(dynamic_cast<A9*>(a13.getA1_3()) == a13.getA9());
662     assert(dynamic_cast<A9*>(a13.getA1_4()) == a13.getA9());
663     assert(dynamic_cast<A9*>(a13.getA1_6()) == a13.getA9());
664     assert(dynamic_cast<A9*>(a13.getA1_9()) == a13.getA9());
665     assert(dynamic_cast<A9*>(a13.getA2()) == a13.getA9());
666     assert(dynamic_cast<A9*>(a13.getA3()) == a13.getA9());
667     assert(dynamic_cast<A9*>(a13.getA4()) == a13.getA9());
668     assert(dynamic_cast<A9*>(a13.getA5()) == a13.getA9());
669     assert(dynamic_cast<A9*>(a13.getA6()) == a13.getA9());
670     assert(dynamic_cast<A9*>(a13.getA7()) == a13.getA9());
671     assert(dynamic_cast<A9*>(a13.getA8()) == a13.getA9());
672 
673     assert(dynamic_cast<A10*>(a13.getA1_3()) == a13.getA10());
674     assert(dynamic_cast<A10*>(a13.getA1_4()) == a13.getA10());
675     assert(dynamic_cast<A10*>(a13.getA1_6()) == a13.getA10());
676     assert(dynamic_cast<A10*>(a13.getA1_9()) == a13.getA10());
677     assert(dynamic_cast<A10*>(a13.getA2()) == a13.getA10());
678     assert(dynamic_cast<A10*>(a13.getA3()) == a13.getA10());
679     assert(dynamic_cast<A10*>(a13.getA4()) == a13.getA10());
680     assert(dynamic_cast<A10*>(a13.getA5()) == a13.getA10());
681     assert(dynamic_cast<A10*>(a13.getA6()) == a13.getA10());
682     assert(dynamic_cast<A10*>(a13.getA7()) == a13.getA10());
683     assert(dynamic_cast<A10*>(a13.getA8()) == a13.getA10());
684     assert(dynamic_cast<A10*>(a13.getA9()) == a13.getA10());
685 
686     assert(dynamic_cast<A11*>(a13.getA1_3()) == a13.getA11());
687     assert(dynamic_cast<A11*>(a13.getA1_4()) == a13.getA11());
688     assert(dynamic_cast<A11*>(a13.getA1_6()) == a13.getA11());
689     assert(dynamic_cast<A11*>(a13.getA1_9()) == a13.getA11());
690     assert(dynamic_cast<A11*>(a13.getA2()) == a13.getA11());
691     assert(dynamic_cast<A11*>(a13.getA3()) == a13.getA11());
692     assert(dynamic_cast<A11*>(a13.getA4()) == a13.getA11());
693     assert(dynamic_cast<A11*>(a13.getA5()) == a13.getA11());
694     assert(dynamic_cast<A11*>(a13.getA6()) == a13.getA11());
695     assert(dynamic_cast<A11*>(a13.getA7()) == a13.getA11());
696     assert(dynamic_cast<A11*>(a13.getA8()) == a13.getA11());
697     assert(dynamic_cast<A11*>(a13.getA9()) == a13.getA11());
698     assert(dynamic_cast<A11*>(a13.getA10()) == a13.getA11());
699 
700     assert(dynamic_cast<A12*>(a13.getA1_3()) == a13.getA12());
701     assert(dynamic_cast<A12*>(a13.getA1_4()) == a13.getA12());
702     assert(dynamic_cast<A12*>(a13.getA1_6()) == a13.getA12());
703     assert(dynamic_cast<A12*>(a13.getA1_9()) == a13.getA12());
704     assert(dynamic_cast<A12*>(a13.getA2()) == a13.getA12());
705     assert(dynamic_cast<A12*>(a13.getA3()) == a13.getA12());
706     assert(dynamic_cast<A12*>(a13.getA4()) == a13.getA12());
707     assert(dynamic_cast<A12*>(a13.getA5()) == a13.getA12());
708     assert(dynamic_cast<A12*>(a13.getA6()) == a13.getA12());
709     assert(dynamic_cast<A12*>(a13.getA7()) == a13.getA12());
710     assert(dynamic_cast<A12*>(a13.getA8()) == a13.getA12());
711     assert(dynamic_cast<A12*>(a13.getA9()) == a13.getA12());
712     assert(dynamic_cast<A12*>(a13.getA10()) == a13.getA12());
713     assert(dynamic_cast<A12*>(a13.getA11()) == a13.getA12());
714 
715     assert(dynamic_cast<A13*>(a13.getA1_3()) == a13.getA13());
716     assert(dynamic_cast<A13*>(a13.getA1_4()) == a13.getA13());
717     assert(dynamic_cast<A13*>(a13.getA1_6()) == a13.getA13());
718     assert(dynamic_cast<A13*>(a13.getA1_9()) == a13.getA13());
719     assert(dynamic_cast<A13*>(a13.getA2()) == a13.getA13());
720     assert(dynamic_cast<A13*>(a13.getA3()) == a13.getA13());
721     assert(dynamic_cast<A13*>(a13.getA4()) == a13.getA13());
722     assert(dynamic_cast<A13*>(a13.getA5()) == a13.getA13());
723     assert(dynamic_cast<A13*>(a13.getA6()) == a13.getA13());
724     assert(dynamic_cast<A13*>(a13.getA7()) == a13.getA13());
725     assert(dynamic_cast<A13*>(a13.getA8()) == a13.getA13());
726     assert(dynamic_cast<A13*>(a13.getA9()) == a13.getA13());
727     assert(dynamic_cast<A13*>(a13.getA10()) == a13.getA13());
728     assert(dynamic_cast<A13*>(a13.getA11()) == a13.getA13());
729     assert(dynamic_cast<A13*>(a13.getA12()) == a13.getA13());
730 }
731 
732 }  // t1
733 
734 namespace t2
735 {
736 
737 struct A1
738 {
739     char _[43981];
~A1t2::A1740     virtual ~A1() {}
741 
getA1t2::A1742     A1* getA1() {return this;}
743 };
744 
745 struct A2
746 {
747     char _[34981];
~A2t2::A2748     virtual ~A2() {}
749 
getA2t2::A2750     A2* getA2() {return this;}
751 };
752 
753 struct A3
754     : protected A1,
755       public virtual A2
756 {
757     char _[93481];
~A3t2::A3758     virtual ~A3() {}
759 
getA1_3t2::A3760     A1* getA1_3() {return A1::getA1();}
getA2t2::A3761     A2* getA2() {return A2::getA2();}
getA3t2::A3762     A3* getA3() {return this;}
763 };
764 
765 struct A4
766     : public virtual A2,
767       public A1
768 {
769     char _[13489];
~A4t2::A4770     virtual ~A4() {}
771 
getA1_4t2::A4772     A1* getA1_4() {return A1::getA1();}
getA2t2::A4773     A2* getA2() {return A2::getA2();}
getA4t2::A4774     A4* getA4() {return this;}
775 };
776 
777 struct A5
778     : public A3,
779       public A4
780 {
781     char _[13489];
~A5t2::A5782     virtual ~A5() {}
783 
getA1_3t2::A5784     A1* getA1_3() {return A3::getA1();}
getA1_4t2::A5785     A1* getA1_4() {return A4::getA1();}
getA2t2::A5786     A2* getA2() {return A3::getA2();}
getA3t2::A5787     A3* getA3() {return A3::getA3();}
getA4t2::A5788     A4* getA4() {return A4::getA4();}
getA5t2::A5789     A5* getA5() {return this;}
790 };
791 
792 struct A6
793     : public A1
794 {
795     char _[81349];
~A6t2::A6796     virtual ~A6() {}
797 
getA1_6t2::A6798     A1* getA1_6() {return A1::getA1();}
getA6t2::A6799     A6* getA6() {return this;}
800 };
801 
802 struct A7
803     : public A5,
804       public A6
805 {
806     char _[34819];
~A7t2::A7807     virtual ~A7() {}
808 
getA1_3t2::A7809     A1* getA1_3() {return A5::getA1_3();}
getA1_4t2::A7810     A1* getA1_4() {return A5::getA1_4();}
getA1_6t2::A7811     A1* getA1_6() {return A6::getA1_6();}
getA2t2::A7812     A2* getA2() {return A5::getA2();}
getA3t2::A7813     A3* getA3() {return A5::getA3();}
getA4t2::A7814     A4* getA4() {return A5::getA4();}
getA5t2::A7815     A5* getA5() {return A5::getA5();}
getA6t2::A7816     A6* getA6() {return A6::getA6();}
getA7t2::A7817     A7* getA7() {return this;}
818 };
819 
820 struct A8
821     : public A7
822 {
823     char _[3489];
~A8t2::A8824     virtual ~A8() {}
825 
getA1_3t2::A8826     A1* getA1_3() {return A7::getA1_3();}
getA1_4t2::A8827     A1* getA1_4() {return A7::getA1_4();}
getA1_6t2::A8828     A1* getA1_6() {return A7::getA1_6();}
getA2t2::A8829     A2* getA2() {return A7::getA2();}
getA3t2::A8830     A3* getA3() {return A7::getA3();}
getA4t2::A8831     A4* getA4() {return A7::getA4();}
getA5t2::A8832     A5* getA5() {return A7::getA5();}
getA6t2::A8833     A6* getA6() {return A7::getA6();}
getA7t2::A8834     A7* getA7() {return A7::getA7();}
getA8t2::A8835     A8* getA8() {return this;}
836 };
837 
838 struct A9
839     : public A1
840 {
841     char _[3481];
~A9t2::A9842     virtual ~A9() {}
843 
getA1_9t2::A9844     A1* getA1_9() {return A1::getA1();}
getA9t2::A9845     A9* getA9() {return this;}
846 };
847 
848 struct A10
849     : public virtual A8
850 {
851     char _[4831];
~A10t2::A10852     virtual ~A10() {}
853 
getA1_3t2::A10854     A1* getA1_3() {return A8::getA1_3();}
getA1_4t2::A10855     A1* getA1_4() {return A8::getA1_4();}
getA1_6t2::A10856     A1* getA1_6() {return A8::getA1_6();}
getA2t2::A10857     A2* getA2() {return A8::getA2();}
getA3t2::A10858     A3* getA3() {return A8::getA3();}
getA4t2::A10859     A4* getA4() {return A8::getA4();}
getA5t2::A10860     A5* getA5() {return A8::getA5();}
getA6t2::A10861     A6* getA6() {return A8::getA6();}
getA7t2::A10862     A7* getA7() {return A8::getA7();}
getA8t2::A10863     A8* getA8() {return A8::getA8();}
getA10t2::A10864     A10* getA10() {return this;}
865 };
866 
867 struct A11
868     : public virtual A8,
869       public A9
870 {
871     char _[6483];
~A11t2::A11872     virtual ~A11() {}
873 
getA1_3t2::A11874     A1* getA1_3() {return A8::getA1_3();}
getA1_4t2::A11875     A1* getA1_4() {return A8::getA1_4();}
getA1_6t2::A11876     A1* getA1_6() {return A8::getA1_6();}
getA1_9t2::A11877     A1* getA1_9() {return A9::getA1_9();}
getA2t2::A11878     A2* getA2() {return A8::getA2();}
getA3t2::A11879     A3* getA3() {return A8::getA3();}
getA4t2::A11880     A4* getA4() {return A8::getA4();}
getA5t2::A11881     A5* getA5() {return A8::getA5();}
getA6t2::A11882     A6* getA6() {return A8::getA6();}
getA7t2::A11883     A7* getA7() {return A8::getA7();}
getA8t2::A11884     A8* getA8() {return A8::getA8();}
getA9t2::A11885     A9* getA9() {return A9::getA9();}
getA11t2::A11886     A11* getA11() {return this;}
887 };
888 
889 struct A12
890     : public A10,
891       public A11
892 {
893     char _[2283];
~A12t2::A12894     virtual ~A12() {}
895 
getA1_3t2::A12896     A1* getA1_3() {return A10::getA1_3();}
getA1_4t2::A12897     A1* getA1_4() {return A10::getA1_4();}
getA1_6t2::A12898     A1* getA1_6() {return A10::getA1_6();}
getA1_9t2::A12899     A1* getA1_9() {return A11::getA1_9();}
getA2t2::A12900     A2* getA2() {return A10::getA2();}
getA3t2::A12901     A3* getA3() {return A10::getA3();}
getA4t2::A12902     A4* getA4() {return A10::getA4();}
getA5t2::A12903     A5* getA5() {return A10::getA5();}
getA6t2::A12904     A6* getA6() {return A10::getA6();}
getA7t2::A12905     A7* getA7() {return A10::getA7();}
getA8t2::A12906     A8* getA8() {return A10::getA8();}
getA9t2::A12907     A9* getA9() {return A11::getA9();}
getA10t2::A12908     A10* getA10() {return A10::getA10();}
getA11t2::A12909     A11* getA11() {return A11::getA11();}
getA12t2::A12910     A12* getA12() {return this;}
911 };
912 
913 struct A13
914     : public A12
915 {
916     char _[1283];
~A13t2::A13917     virtual ~A13() {}
918 
getA1_3t2::A13919     A1* getA1_3() {return A12::getA1_3();}
getA1_4t2::A13920     A1* getA1_4() {return A12::getA1_4();}
getA1_6t2::A13921     A1* getA1_6() {return A12::getA1_6();}
getA1_9t2::A13922     A1* getA1_9() {return A12::getA1_9();}
getA2t2::A13923     A2* getA2() {return A12::getA2();}
getA3t2::A13924     A3* getA3() {return A12::getA3();}
getA4t2::A13925     A4* getA4() {return A12::getA4();}
getA5t2::A13926     A5* getA5() {return A12::getA5();}
getA6t2::A13927     A6* getA6() {return A12::getA6();}
getA7t2::A13928     A7* getA7() {return A12::getA7();}
getA8t2::A13929     A8* getA8() {return A12::getA8();}
getA9t2::A13930     A9* getA9() {return A12::getA9();}
getA10t2::A13931     A10* getA10() {return A12::getA10();}
getA11t2::A13932     A11* getA11() {return A12::getA11();}
getA12t2::A13933     A12* getA12() {return A12::getA12();}
getA13t2::A13934     A13* getA13() {return this;}
935 };
936 
937 A3 a3;
938 A4 a4;
939 A5 a5;
940 A6 a6;
941 A7 a7;
942 A8 a8;
943 A9 a9;
944 A10 a10;
945 A11 a11;
946 A12 a12;
947 A13 a13;
948 
test()949 void test()
950 {
951     assert(dynamic_cast<A3*>(a3.getA1_3()) == 0);
952     assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
953 
954     assert(dynamic_cast<A3*>(a4.getA1_4()) == 0);
955     assert(dynamic_cast<A3*>(a4.getA2()) == 0);
956     assert(dynamic_cast<A4*>(a4.getA1_4()) == a4.getA4());
957     assert(dynamic_cast<A4*>(a4.getA2()) == a4.getA4());
958 
959     assert(dynamic_cast<A3*>(a5.getA1_3()) == 0);
960     assert(dynamic_cast<A3*>(a5.getA2()) == a5.getA3());
961 
962     assert(dynamic_cast<A4*>(a5.getA1_3()) == 0);
963     assert(dynamic_cast<A4*>(a5.getA1_4()) == a5.getA4());
964     assert(dynamic_cast<A4*>(a5.getA3()) == a5.getA4());
965     assert(dynamic_cast<A4*>(a5.getA3()) == a5.getA4());
966 
967     assert(dynamic_cast<A5*>(a5.getA1_3()) == 0);
968     assert(dynamic_cast<A5*>(a5.getA1_4()) == a5.getA5());
969     assert(dynamic_cast<A5*>(a5.getA3()) == a5.getA5());
970     assert(dynamic_cast<A5*>(a5.getA3()) == a5.getA5());
971     assert(dynamic_cast<A5*>(a5.getA3()) == a5.getA5());
972     assert(dynamic_cast<A5*>(a5.getA4()) == a5.getA5());
973 
974     assert(dynamic_cast<A3*>(a6.getA1_6()) == 0);
975 
976     assert(dynamic_cast<A4*>(a6.getA1_6()) == 0);
977 
978     assert(dynamic_cast<A5*>(a6.getA1_6()) == 0);
979 
980     assert(dynamic_cast<A6*>(a6.getA1_6()) == a6.getA6());
981 
982     assert(dynamic_cast<A3*>(a7.getA1_3()) == 0);
983     assert(dynamic_cast<A3*>(a7.getA1_4()) == a7.getA3());
984     assert(dynamic_cast<A3*>(a7.getA2()) == a7.getA3());
985 
986     assert(dynamic_cast<A4*>(a7.getA1_3()) == 0);
987     assert(dynamic_cast<A4*>(a7.getA1_4()) == a7.getA4());
988     assert(dynamic_cast<A4*>(a7.getA2()) == a7.getA4());
989     assert(dynamic_cast<A4*>(a7.getA3()) == a7.getA4());
990 
991     assert(dynamic_cast<A5*>(a7.getA1_3()) == 0);
992     assert(dynamic_cast<A5*>(a7.getA1_4()) == a7.getA5());
993     assert(dynamic_cast<A5*>(a7.getA2()) == a7.getA5());
994     assert(dynamic_cast<A5*>(a7.getA3()) == a7.getA5());
995     assert(dynamic_cast<A5*>(a7.getA4()) == a7.getA5());
996 
997     assert(dynamic_cast<A6*>(a7.getA1_3()) == 0);
998     assert(dynamic_cast<A6*>(a7.getA1_4()) == a7.getA6());
999     assert(dynamic_cast<A6*>(a7.getA1_6()) == a7.getA6());
1000     assert(dynamic_cast<A6*>(a7.getA2()) == a7.getA6());
1001     assert(dynamic_cast<A6*>(a7.getA3()) == a7.getA6());
1002     assert(dynamic_cast<A6*>(a7.getA4()) == a7.getA6());
1003     assert(dynamic_cast<A6*>(a7.getA5()) == a7.getA6());
1004 
1005     assert(dynamic_cast<A7*>(a7.getA1_3()) == 0);
1006     assert(dynamic_cast<A7*>(a7.getA1_4()) == a7.getA7());
1007     assert(dynamic_cast<A7*>(a7.getA1_6()) == a7.getA7());
1008     assert(dynamic_cast<A7*>(a7.getA2()) == a7.getA7());
1009     assert(dynamic_cast<A7*>(a7.getA3()) == a7.getA7());
1010     assert(dynamic_cast<A7*>(a7.getA4()) == a7.getA7());
1011     assert(dynamic_cast<A7*>(a7.getA5()) == a7.getA7());
1012     assert(dynamic_cast<A7*>(a7.getA6()) == a7.getA7());
1013 
1014     assert(dynamic_cast<A3*>(a8.getA1_3()) == 0);
1015     assert(dynamic_cast<A3*>(a8.getA1_4()) == a8.getA3());
1016     assert(dynamic_cast<A3*>(a8.getA2()) == a8.getA3());
1017 
1018     assert(dynamic_cast<A4*>(a8.getA1_3()) == 0);
1019     assert(dynamic_cast<A4*>(a8.getA1_4()) == a8.getA4());
1020     assert(dynamic_cast<A4*>(a8.getA2()) == a8.getA4());
1021     assert(dynamic_cast<A4*>(a8.getA3()) == a8.getA4());
1022 
1023     assert(dynamic_cast<A5*>(a8.getA1_3()) == 0);
1024     assert(dynamic_cast<A5*>(a8.getA1_4()) == a8.getA5());
1025     assert(dynamic_cast<A5*>(a8.getA2()) == a8.getA5());
1026     assert(dynamic_cast<A5*>(a8.getA3()) == a8.getA5());
1027     assert(dynamic_cast<A5*>(a8.getA4()) == a8.getA5());
1028 
1029     assert(dynamic_cast<A6*>(a8.getA1_3()) == 0);
1030     assert(dynamic_cast<A6*>(a8.getA1_4()) == a8.getA6());
1031     assert(dynamic_cast<A6*>(a8.getA1_6()) == a8.getA6());
1032     assert(dynamic_cast<A6*>(a8.getA2()) == a8.getA6());
1033     assert(dynamic_cast<A6*>(a8.getA3()) == a8.getA6());
1034     assert(dynamic_cast<A6*>(a8.getA4()) == a8.getA6());
1035     assert(dynamic_cast<A6*>(a8.getA5()) == a8.getA6());
1036 
1037     assert(dynamic_cast<A7*>(a8.getA1_3()) == 0);
1038     assert(dynamic_cast<A7*>(a8.getA1_4()) == a8.getA7());
1039     assert(dynamic_cast<A7*>(a8.getA1_6()) == a8.getA7());
1040     assert(dynamic_cast<A7*>(a8.getA2()) == a8.getA7());
1041     assert(dynamic_cast<A7*>(a8.getA3()) == a8.getA7());
1042     assert(dynamic_cast<A7*>(a8.getA4()) == a8.getA7());
1043     assert(dynamic_cast<A7*>(a8.getA5()) == a8.getA7());
1044     assert(dynamic_cast<A7*>(a8.getA6()) == a8.getA7());
1045 
1046     assert(dynamic_cast<A8*>(a8.getA1_3()) == 0);
1047     assert(dynamic_cast<A8*>(a8.getA1_4()) == a8.getA8());
1048     assert(dynamic_cast<A8*>(a8.getA1_6()) == a8.getA8());
1049     assert(dynamic_cast<A8*>(a8.getA2()) == a8.getA8());
1050     assert(dynamic_cast<A8*>(a8.getA3()) == a8.getA8());
1051     assert(dynamic_cast<A8*>(a8.getA4()) == a8.getA8());
1052     assert(dynamic_cast<A8*>(a8.getA5()) == a8.getA8());
1053     assert(dynamic_cast<A8*>(a8.getA6()) == a8.getA8());
1054     assert(dynamic_cast<A8*>(a8.getA7()) == a8.getA8());
1055 
1056     assert(dynamic_cast<A3*>(a9.getA1_9()) == 0);
1057 
1058     assert(dynamic_cast<A4*>(a9.getA1_9()) == 0);
1059 
1060     assert(dynamic_cast<A5*>(a9.getA1_9()) == 0);
1061 
1062     assert(dynamic_cast<A6*>(a9.getA1_9()) == 0);
1063 
1064     assert(dynamic_cast<A7*>(a9.getA1_9()) == 0);
1065 
1066     assert(dynamic_cast<A8*>(a9.getA1_9()) == 0);
1067 
1068     assert(dynamic_cast<A9*>(a9.getA1_9()) == a9.getA9());
1069 
1070     assert(dynamic_cast<A3*>(a10.getA1_3()) == 0);
1071     assert(dynamic_cast<A3*>(a10.getA1_4()) == a10.getA3());
1072     assert(dynamic_cast<A3*>(a10.getA1_6()) == a10.getA3());
1073     assert(dynamic_cast<A3*>(a10.getA2()) == a10.getA3());
1074 
1075     assert(dynamic_cast<A4*>(a10.getA1_3()) == 0);
1076     assert(dynamic_cast<A4*>(a10.getA1_4()) == a10.getA4());
1077     assert(dynamic_cast<A4*>(a10.getA1_6()) == a10.getA4());
1078     assert(dynamic_cast<A4*>(a10.getA2()) == a10.getA4());
1079     assert(dynamic_cast<A4*>(a10.getA3()) == a10.getA4());
1080 
1081     assert(dynamic_cast<A5*>(a10.getA1_3()) == 0);
1082     assert(dynamic_cast<A5*>(a10.getA1_4()) == a10.getA5());
1083     assert(dynamic_cast<A5*>(a10.getA1_6()) == a10.getA5());
1084     assert(dynamic_cast<A5*>(a10.getA2()) == a10.getA5());
1085     assert(dynamic_cast<A5*>(a10.getA3()) == a10.getA5());
1086     assert(dynamic_cast<A5*>(a10.getA4()) == a10.getA5());
1087 
1088     assert(dynamic_cast<A6*>(a10.getA1_3()) == 0);
1089     assert(dynamic_cast<A6*>(a10.getA1_4()) == a10.getA6());
1090     assert(dynamic_cast<A6*>(a10.getA1_6()) == a10.getA6());
1091     assert(dynamic_cast<A6*>(a10.getA2()) == a10.getA6());
1092     assert(dynamic_cast<A6*>(a10.getA3()) == a10.getA6());
1093     assert(dynamic_cast<A6*>(a10.getA4()) == a10.getA6());
1094     assert(dynamic_cast<A6*>(a10.getA5()) == a10.getA6());
1095 
1096     assert(dynamic_cast<A7*>(a10.getA1_3()) == 0);
1097     assert(dynamic_cast<A7*>(a10.getA1_4()) == a10.getA7());
1098     assert(dynamic_cast<A7*>(a10.getA1_6()) == a10.getA7());
1099     assert(dynamic_cast<A7*>(a10.getA2()) == a10.getA7());
1100     assert(dynamic_cast<A7*>(a10.getA3()) == a10.getA7());
1101     assert(dynamic_cast<A7*>(a10.getA4()) == a10.getA7());
1102     assert(dynamic_cast<A7*>(a10.getA5()) == a10.getA7());
1103     assert(dynamic_cast<A7*>(a10.getA6()) == a10.getA7());
1104 
1105     assert(dynamic_cast<A8*>(a10.getA1_3()) == 0);
1106     assert(dynamic_cast<A8*>(a10.getA1_4()) == a10.getA8());
1107     assert(dynamic_cast<A8*>(a10.getA1_6()) == a10.getA8());
1108     assert(dynamic_cast<A8*>(a10.getA2()) == a10.getA8());
1109     assert(dynamic_cast<A8*>(a10.getA3()) == a10.getA8());
1110     assert(dynamic_cast<A8*>(a10.getA4()) == a10.getA8());
1111     assert(dynamic_cast<A8*>(a10.getA5()) == a10.getA8());
1112     assert(dynamic_cast<A8*>(a10.getA6()) == a10.getA8());
1113     assert(dynamic_cast<A8*>(a10.getA7()) == a10.getA8());
1114 
1115     assert(dynamic_cast<A9*>(a10.getA1_3()) == 0);
1116     assert(dynamic_cast<A9*>(a10.getA1_4()) == 0);
1117     assert(dynamic_cast<A9*>(a10.getA1_6()) == 0);
1118     assert(dynamic_cast<A9*>(a10.getA2()) == 0);
1119     assert(dynamic_cast<A9*>(a10.getA3()) == 0);
1120     assert(dynamic_cast<A9*>(a10.getA4()) == 0);
1121     assert(dynamic_cast<A9*>(a10.getA5()) == 0);
1122     assert(dynamic_cast<A9*>(a10.getA6()) == 0);
1123     assert(dynamic_cast<A9*>(a10.getA7()) == 0);
1124     assert(dynamic_cast<A9*>(a10.getA8()) == 0);
1125 
1126     assert(dynamic_cast<A10*>(a10.getA1_3()) == 0);
1127     assert(dynamic_cast<A10*>(a10.getA1_4()) == a10.getA10());
1128     assert(dynamic_cast<A10*>(a10.getA1_6()) == a10.getA10());
1129     assert(dynamic_cast<A10*>(a10.getA2()) == a10.getA10());
1130     assert(dynamic_cast<A10*>(a10.getA3()) == a10.getA10());
1131     assert(dynamic_cast<A10*>(a10.getA4()) == a10.getA10());
1132     assert(dynamic_cast<A10*>(a10.getA5()) == a10.getA10());
1133     assert(dynamic_cast<A10*>(a10.getA6()) == a10.getA10());
1134     assert(dynamic_cast<A10*>(a10.getA7()) == a10.getA10());
1135     assert(dynamic_cast<A10*>(a10.getA8()) == a10.getA10());
1136 
1137     assert(dynamic_cast<A3*>(a11.getA1_3()) == 0);
1138     assert(dynamic_cast<A3*>(a11.getA1_4()) == a11.getA3());
1139     assert(dynamic_cast<A3*>(a11.getA1_6()) == a11.getA3());
1140     assert(dynamic_cast<A3*>(a11.getA1_9()) == a11.getA3());
1141     assert(dynamic_cast<A3*>(a11.getA2()) == a11.getA3());
1142 
1143     assert(dynamic_cast<A4*>(a11.getA1_3()) == 0);
1144     assert(dynamic_cast<A4*>(a11.getA1_4()) == a11.getA4());
1145     assert(dynamic_cast<A4*>(a11.getA1_6()) == a11.getA4());
1146     assert(dynamic_cast<A4*>(a11.getA1_9()) == a11.getA4());
1147     assert(dynamic_cast<A4*>(a11.getA2()) == a11.getA4());
1148     assert(dynamic_cast<A4*>(a11.getA3()) == a11.getA4());
1149 
1150     assert(dynamic_cast<A5*>(a11.getA1_3()) == 0);
1151     assert(dynamic_cast<A5*>(a11.getA1_4()) == a11.getA5());
1152     assert(dynamic_cast<A5*>(a11.getA1_6()) == a11.getA5());
1153     assert(dynamic_cast<A5*>(a11.getA1_9()) == a11.getA5());
1154     assert(dynamic_cast<A5*>(a11.getA2()) == a11.getA5());
1155     assert(dynamic_cast<A5*>(a11.getA3()) == a11.getA5());
1156     assert(dynamic_cast<A5*>(a11.getA4()) == a11.getA5());
1157 
1158     assert(dynamic_cast<A6*>(a11.getA1_3()) == 0);
1159     assert(dynamic_cast<A6*>(a11.getA1_4()) == a11.getA6());
1160     assert(dynamic_cast<A6*>(a11.getA1_6()) == a11.getA6());
1161     assert(dynamic_cast<A6*>(a11.getA1_9()) == a11.getA6());
1162     assert(dynamic_cast<A6*>(a11.getA2()) == a11.getA6());
1163     assert(dynamic_cast<A6*>(a11.getA3()) == a11.getA6());
1164     assert(dynamic_cast<A6*>(a11.getA4()) == a11.getA6());
1165     assert(dynamic_cast<A6*>(a11.getA5()) == a11.getA6());
1166 
1167     assert(dynamic_cast<A7*>(a11.getA1_3()) == 0);
1168     assert(dynamic_cast<A7*>(a11.getA1_4()) == a11.getA7());
1169     assert(dynamic_cast<A7*>(a11.getA1_6()) == a11.getA7());
1170     assert(dynamic_cast<A7*>(a11.getA1_9()) == a11.getA7());
1171     assert(dynamic_cast<A7*>(a11.getA2()) == a11.getA7());
1172     assert(dynamic_cast<A7*>(a11.getA3()) == a11.getA7());
1173     assert(dynamic_cast<A7*>(a11.getA4()) == a11.getA7());
1174     assert(dynamic_cast<A7*>(a11.getA5()) == a11.getA7());
1175     assert(dynamic_cast<A7*>(a11.getA6()) == a11.getA7());
1176 
1177     assert(dynamic_cast<A8*>(a11.getA1_3()) == 0);
1178     assert(dynamic_cast<A8*>(a11.getA1_4()) == a11.getA8());
1179     assert(dynamic_cast<A8*>(a11.getA1_6()) == a11.getA8());
1180     assert(dynamic_cast<A8*>(a11.getA1_9()) == a11.getA8());
1181     assert(dynamic_cast<A8*>(a11.getA2()) == a11.getA8());
1182     assert(dynamic_cast<A8*>(a11.getA3()) == a11.getA8());
1183     assert(dynamic_cast<A8*>(a11.getA4()) == a11.getA8());
1184     assert(dynamic_cast<A8*>(a11.getA5()) == a11.getA8());
1185     assert(dynamic_cast<A8*>(a11.getA6()) == a11.getA8());
1186     assert(dynamic_cast<A8*>(a11.getA7()) == a11.getA8());
1187 
1188     assert(dynamic_cast<A9*>(a11.getA1_3()) == 0);
1189     assert(dynamic_cast<A9*>(a11.getA1_4()) == a11.getA9());
1190     assert(dynamic_cast<A9*>(a11.getA1_6()) == a11.getA9());
1191     assert(dynamic_cast<A9*>(a11.getA1_9()) == a11.getA9());
1192     assert(dynamic_cast<A9*>(a11.getA2()) == a11.getA9());
1193     assert(dynamic_cast<A9*>(a11.getA3()) == a11.getA9());
1194     assert(dynamic_cast<A9*>(a11.getA4()) == a11.getA9());
1195     assert(dynamic_cast<A9*>(a11.getA5()) == a11.getA9());
1196     assert(dynamic_cast<A9*>(a11.getA6()) == a11.getA9());
1197     assert(dynamic_cast<A9*>(a11.getA7()) == a11.getA9());
1198     assert(dynamic_cast<A9*>(a11.getA8()) == a11.getA9());
1199 
1200     assert(dynamic_cast<A10*>(a11.getA1_3()) == 0);
1201     assert(dynamic_cast<A10*>(a11.getA1_4()) == 0);
1202     assert(dynamic_cast<A10*>(a11.getA1_6()) == 0);
1203     assert(dynamic_cast<A10*>(a11.getA1_9()) == 0);
1204     assert(dynamic_cast<A10*>(a11.getA2()) == 0);
1205     assert(dynamic_cast<A10*>(a11.getA3()) == 0);
1206     assert(dynamic_cast<A10*>(a11.getA4()) == 0);
1207     assert(dynamic_cast<A10*>(a11.getA5()) == 0);
1208     assert(dynamic_cast<A10*>(a11.getA6()) == 0);
1209     assert(dynamic_cast<A10*>(a11.getA7()) == 0);
1210     assert(dynamic_cast<A10*>(a11.getA8()) == 0);
1211     assert(dynamic_cast<A10*>(a11.getA9()) == 0);
1212 
1213     assert(dynamic_cast<A11*>(a11.getA1_3()) == 0);
1214     assert(dynamic_cast<A11*>(a11.getA1_4()) == a11.getA11());
1215     assert(dynamic_cast<A11*>(a11.getA1_6()) == a11.getA11());
1216     assert(dynamic_cast<A11*>(a11.getA1_9()) == a11.getA11());
1217     assert(dynamic_cast<A11*>(a11.getA2()) == a11.getA11());
1218     assert(dynamic_cast<A11*>(a11.getA3()) == a11.getA11());
1219     assert(dynamic_cast<A11*>(a11.getA4()) == a11.getA11());
1220     assert(dynamic_cast<A11*>(a11.getA5()) == a11.getA11());
1221     assert(dynamic_cast<A11*>(a11.getA6()) == a11.getA11());
1222     assert(dynamic_cast<A11*>(a11.getA7()) == a11.getA11());
1223     assert(dynamic_cast<A11*>(a11.getA8()) == a11.getA11());
1224     assert(dynamic_cast<A11*>(a11.getA9()) == a11.getA11());
1225 
1226     assert(dynamic_cast<A3*>(a12.getA1_3()) == 0);
1227     assert(dynamic_cast<A3*>(a12.getA1_4()) == a12.getA3());
1228     assert(dynamic_cast<A3*>(a12.getA1_6()) == a12.getA3());
1229     assert(dynamic_cast<A3*>(a12.getA1_9()) == a12.getA3());
1230     assert(dynamic_cast<A3*>(a12.getA2()) == a12.getA3());
1231 
1232     assert(dynamic_cast<A4*>(a12.getA1_3()) == 0);
1233     assert(dynamic_cast<A4*>(a12.getA1_4()) == a12.getA4());
1234     assert(dynamic_cast<A4*>(a12.getA1_6()) == a12.getA4());
1235     assert(dynamic_cast<A4*>(a12.getA1_9()) == a12.getA4());
1236     assert(dynamic_cast<A4*>(a12.getA2()) == a12.getA4());
1237     assert(dynamic_cast<A4*>(a12.getA3()) == a12.getA4());
1238 
1239     assert(dynamic_cast<A5*>(a12.getA1_3()) == 0);
1240     assert(dynamic_cast<A5*>(a12.getA1_4()) == a12.getA5());
1241     assert(dynamic_cast<A5*>(a12.getA1_6()) == a12.getA5());
1242     assert(dynamic_cast<A5*>(a12.getA1_9()) == a12.getA5());
1243     assert(dynamic_cast<A5*>(a12.getA2()) == a12.getA5());
1244     assert(dynamic_cast<A5*>(a12.getA3()) == a12.getA5());
1245     assert(dynamic_cast<A5*>(a12.getA4()) == a12.getA5());
1246 
1247     assert(dynamic_cast<A6*>(a12.getA1_3()) == 0);
1248     assert(dynamic_cast<A6*>(a12.getA1_4()) == a12.getA6());
1249     assert(dynamic_cast<A6*>(a12.getA1_6()) == a12.getA6());
1250     assert(dynamic_cast<A6*>(a12.getA1_9()) == a12.getA6());
1251     assert(dynamic_cast<A6*>(a12.getA2()) == a12.getA6());
1252     assert(dynamic_cast<A6*>(a12.getA3()) == a12.getA6());
1253     assert(dynamic_cast<A6*>(a12.getA4()) == a12.getA6());
1254     assert(dynamic_cast<A6*>(a12.getA5()) == a12.getA6());
1255 
1256     assert(dynamic_cast<A7*>(a12.getA1_3()) == 0);
1257     assert(dynamic_cast<A7*>(a12.getA1_4()) == a12.getA7());
1258     assert(dynamic_cast<A7*>(a12.getA1_6()) == a12.getA7());
1259     assert(dynamic_cast<A7*>(a12.getA1_9()) == a12.getA7());
1260     assert(dynamic_cast<A7*>(a12.getA2()) == a12.getA7());
1261     assert(dynamic_cast<A7*>(a12.getA3()) == a12.getA7());
1262     assert(dynamic_cast<A7*>(a12.getA4()) == a12.getA7());
1263     assert(dynamic_cast<A7*>(a12.getA5()) == a12.getA7());
1264     assert(dynamic_cast<A7*>(a12.getA6()) == a12.getA7());
1265 
1266     assert(dynamic_cast<A8*>(a12.getA1_3()) == 0);
1267     assert(dynamic_cast<A8*>(a12.getA1_4()) == a12.getA8());
1268     assert(dynamic_cast<A8*>(a12.getA1_6()) == a12.getA8());
1269     assert(dynamic_cast<A8*>(a12.getA1_9()) == a12.getA8());
1270     assert(dynamic_cast<A8*>(a12.getA2()) == a12.getA8());
1271     assert(dynamic_cast<A8*>(a12.getA3()) == a12.getA8());
1272     assert(dynamic_cast<A8*>(a12.getA4()) == a12.getA8());
1273     assert(dynamic_cast<A8*>(a12.getA5()) == a12.getA8());
1274     assert(dynamic_cast<A8*>(a12.getA6()) == a12.getA8());
1275     assert(dynamic_cast<A8*>(a12.getA7()) == a12.getA8());
1276 
1277     assert(dynamic_cast<A9*>(a12.getA1_3()) == 0);
1278     assert(dynamic_cast<A9*>(a12.getA1_4()) == a12.getA9());
1279     assert(dynamic_cast<A9*>(a12.getA1_6()) == a12.getA9());
1280     assert(dynamic_cast<A9*>(a12.getA1_9()) == a12.getA9());
1281     assert(dynamic_cast<A9*>(a12.getA2()) == a12.getA9());
1282     assert(dynamic_cast<A9*>(a12.getA3()) == a12.getA9());
1283     assert(dynamic_cast<A9*>(a12.getA4()) == a12.getA9());
1284     assert(dynamic_cast<A9*>(a12.getA5()) == a12.getA9());
1285     assert(dynamic_cast<A9*>(a12.getA6()) == a12.getA9());
1286     assert(dynamic_cast<A9*>(a12.getA7()) == a12.getA9());
1287     assert(dynamic_cast<A9*>(a12.getA8()) == a12.getA9());
1288 
1289     assert(dynamic_cast<A10*>(a12.getA1_3()) == 0);
1290     assert(dynamic_cast<A10*>(a12.getA1_4()) == a12.getA10());
1291     assert(dynamic_cast<A10*>(a12.getA1_6()) == a12.getA10());
1292     assert(dynamic_cast<A10*>(a12.getA1_9()) == a12.getA10());
1293     assert(dynamic_cast<A10*>(a12.getA2()) == a12.getA10());
1294     assert(dynamic_cast<A10*>(a12.getA3()) == a12.getA10());
1295     assert(dynamic_cast<A10*>(a12.getA4()) == a12.getA10());
1296     assert(dynamic_cast<A10*>(a12.getA5()) == a12.getA10());
1297     assert(dynamic_cast<A10*>(a12.getA6()) == a12.getA10());
1298     assert(dynamic_cast<A10*>(a12.getA7()) == a12.getA10());
1299     assert(dynamic_cast<A10*>(a12.getA8()) == a12.getA10());
1300     assert(dynamic_cast<A10*>(a12.getA9()) == a12.getA10());
1301 
1302     assert(dynamic_cast<A11*>(a12.getA1_3()) == 0);
1303     assert(dynamic_cast<A11*>(a12.getA1_4()) == a12.getA11());
1304     assert(dynamic_cast<A11*>(a12.getA1_6()) == a12.getA11());
1305     assert(dynamic_cast<A11*>(a12.getA1_9()) == a12.getA11());
1306     assert(dynamic_cast<A11*>(a12.getA2()) == a12.getA11());
1307     assert(dynamic_cast<A11*>(a12.getA3()) == a12.getA11());
1308     assert(dynamic_cast<A11*>(a12.getA4()) == a12.getA11());
1309     assert(dynamic_cast<A11*>(a12.getA5()) == a12.getA11());
1310     assert(dynamic_cast<A11*>(a12.getA6()) == a12.getA11());
1311     assert(dynamic_cast<A11*>(a12.getA7()) == a12.getA11());
1312     assert(dynamic_cast<A11*>(a12.getA8()) == a12.getA11());
1313     assert(dynamic_cast<A11*>(a12.getA9()) == a12.getA11());
1314     assert(dynamic_cast<A11*>(a12.getA10()) == a12.getA11());
1315 
1316     assert(dynamic_cast<A12*>(a12.getA1_3()) == 0);
1317     assert(dynamic_cast<A12*>(a12.getA1_4()) == a12.getA12());
1318     assert(dynamic_cast<A12*>(a12.getA1_6()) == a12.getA12());
1319     assert(dynamic_cast<A12*>(a12.getA1_9()) == a12.getA12());
1320     assert(dynamic_cast<A12*>(a12.getA2()) == a12.getA12());
1321     assert(dynamic_cast<A12*>(a12.getA3()) == a12.getA12());
1322     assert(dynamic_cast<A12*>(a12.getA4()) == a12.getA12());
1323     assert(dynamic_cast<A12*>(a12.getA5()) == a12.getA12());
1324     assert(dynamic_cast<A12*>(a12.getA6()) == a12.getA12());
1325     assert(dynamic_cast<A12*>(a12.getA7()) == a12.getA12());
1326     assert(dynamic_cast<A12*>(a12.getA8()) == a12.getA12());
1327     assert(dynamic_cast<A12*>(a12.getA9()) == a12.getA12());
1328     assert(dynamic_cast<A12*>(a12.getA10()) == a12.getA12());
1329     assert(dynamic_cast<A12*>(a12.getA11()) == a12.getA12());
1330 
1331     assert(dynamic_cast<A3*>(a13.getA1_3()) == 0);
1332     assert(dynamic_cast<A3*>(a13.getA1_4()) == a13.getA3());
1333     assert(dynamic_cast<A3*>(a13.getA1_6()) == a13.getA3());
1334     assert(dynamic_cast<A3*>(a13.getA1_9()) == a13.getA3());
1335     assert(dynamic_cast<A3*>(a13.getA2()) == a13.getA3());
1336 
1337     assert(dynamic_cast<A4*>(a13.getA1_3()) == 0);
1338     assert(dynamic_cast<A4*>(a13.getA1_4()) == a13.getA4());
1339     assert(dynamic_cast<A4*>(a13.getA1_6()) == a13.getA4());
1340     assert(dynamic_cast<A4*>(a13.getA1_9()) == a13.getA4());
1341     assert(dynamic_cast<A4*>(a13.getA2()) == a13.getA4());
1342     assert(dynamic_cast<A4*>(a13.getA3()) == a13.getA4());
1343 
1344     assert(dynamic_cast<A5*>(a13.getA1_3()) == 0);
1345     assert(dynamic_cast<A5*>(a13.getA1_4()) == a13.getA5());
1346     assert(dynamic_cast<A5*>(a13.getA1_6()) == a13.getA5());
1347     assert(dynamic_cast<A5*>(a13.getA1_9()) == a13.getA5());
1348     assert(dynamic_cast<A5*>(a13.getA2()) == a13.getA5());
1349     assert(dynamic_cast<A5*>(a13.getA3()) == a13.getA5());
1350     assert(dynamic_cast<A5*>(a13.getA4()) == a13.getA5());
1351 
1352     assert(dynamic_cast<A6*>(a13.getA1_3()) == 0);
1353     assert(dynamic_cast<A6*>(a13.getA1_4()) == a13.getA6());
1354     assert(dynamic_cast<A6*>(a13.getA1_6()) == a13.getA6());
1355     assert(dynamic_cast<A6*>(a13.getA1_9()) == a13.getA6());
1356     assert(dynamic_cast<A6*>(a13.getA2()) == a13.getA6());
1357     assert(dynamic_cast<A6*>(a13.getA3()) == a13.getA6());
1358     assert(dynamic_cast<A6*>(a13.getA4()) == a13.getA6());
1359     assert(dynamic_cast<A6*>(a13.getA5()) == a13.getA6());
1360 
1361     assert(dynamic_cast<A7*>(a13.getA1_3()) == 0);
1362     assert(dynamic_cast<A7*>(a13.getA1_4()) == a13.getA7());
1363     assert(dynamic_cast<A7*>(a13.getA1_6()) == a13.getA7());
1364     assert(dynamic_cast<A7*>(a13.getA1_9()) == a13.getA7());
1365     assert(dynamic_cast<A7*>(a13.getA2()) == a13.getA7());
1366     assert(dynamic_cast<A7*>(a13.getA3()) == a13.getA7());
1367     assert(dynamic_cast<A7*>(a13.getA4()) == a13.getA7());
1368     assert(dynamic_cast<A7*>(a13.getA5()) == a13.getA7());
1369     assert(dynamic_cast<A7*>(a13.getA6()) == a13.getA7());
1370 
1371     assert(dynamic_cast<A8*>(a13.getA1_3()) == 0);
1372     assert(dynamic_cast<A8*>(a13.getA1_4()) == a13.getA8());
1373     assert(dynamic_cast<A8*>(a13.getA1_6()) == a13.getA8());
1374     assert(dynamic_cast<A8*>(a13.getA1_9()) == a13.getA8());
1375     assert(dynamic_cast<A8*>(a13.getA2()) == a13.getA8());
1376     assert(dynamic_cast<A8*>(a13.getA3()) == a13.getA8());
1377     assert(dynamic_cast<A8*>(a13.getA4()) == a13.getA8());
1378     assert(dynamic_cast<A8*>(a13.getA5()) == a13.getA8());
1379     assert(dynamic_cast<A8*>(a13.getA6()) == a13.getA8());
1380     assert(dynamic_cast<A8*>(a13.getA7()) == a13.getA8());
1381 
1382     assert(dynamic_cast<A9*>(a13.getA1_3()) == 0);
1383     assert(dynamic_cast<A9*>(a13.getA1_4()) == a13.getA9());
1384     assert(dynamic_cast<A9*>(a13.getA1_6()) == a13.getA9());
1385     assert(dynamic_cast<A9*>(a13.getA1_9()) == a13.getA9());
1386     assert(dynamic_cast<A9*>(a13.getA2()) == a13.getA9());
1387     assert(dynamic_cast<A9*>(a13.getA3()) == a13.getA9());
1388     assert(dynamic_cast<A9*>(a13.getA4()) == a13.getA9());
1389     assert(dynamic_cast<A9*>(a13.getA5()) == a13.getA9());
1390     assert(dynamic_cast<A9*>(a13.getA6()) == a13.getA9());
1391     assert(dynamic_cast<A9*>(a13.getA7()) == a13.getA9());
1392     assert(dynamic_cast<A9*>(a13.getA8()) == a13.getA9());
1393 
1394     assert(dynamic_cast<A10*>(a13.getA1_3()) == 0);
1395     assert(dynamic_cast<A10*>(a13.getA1_4()) == a13.getA10());
1396     assert(dynamic_cast<A10*>(a13.getA1_6()) == a13.getA10());
1397     assert(dynamic_cast<A10*>(a13.getA1_9()) == a13.getA10());
1398     assert(dynamic_cast<A10*>(a13.getA2()) == a13.getA10());
1399     assert(dynamic_cast<A10*>(a13.getA3()) == a13.getA10());
1400     assert(dynamic_cast<A10*>(a13.getA4()) == a13.getA10());
1401     assert(dynamic_cast<A10*>(a13.getA5()) == a13.getA10());
1402     assert(dynamic_cast<A10*>(a13.getA6()) == a13.getA10());
1403     assert(dynamic_cast<A10*>(a13.getA7()) == a13.getA10());
1404     assert(dynamic_cast<A10*>(a13.getA8()) == a13.getA10());
1405     assert(dynamic_cast<A10*>(a13.getA9()) == a13.getA10());
1406 
1407     assert(dynamic_cast<A11*>(a13.getA1_3()) == 0);
1408     assert(dynamic_cast<A11*>(a13.getA1_4()) == a13.getA11());
1409     assert(dynamic_cast<A11*>(a13.getA1_6()) == a13.getA11());
1410     assert(dynamic_cast<A11*>(a13.getA1_9()) == a13.getA11());
1411     assert(dynamic_cast<A11*>(a13.getA2()) == a13.getA11());
1412     assert(dynamic_cast<A11*>(a13.getA3()) == a13.getA11());
1413     assert(dynamic_cast<A11*>(a13.getA4()) == a13.getA11());
1414     assert(dynamic_cast<A11*>(a13.getA5()) == a13.getA11());
1415     assert(dynamic_cast<A11*>(a13.getA6()) == a13.getA11());
1416     assert(dynamic_cast<A11*>(a13.getA7()) == a13.getA11());
1417     assert(dynamic_cast<A11*>(a13.getA8()) == a13.getA11());
1418     assert(dynamic_cast<A11*>(a13.getA9()) == a13.getA11());
1419     assert(dynamic_cast<A11*>(a13.getA10()) == a13.getA11());
1420 
1421     assert(dynamic_cast<A12*>(a13.getA1_3()) == 0);
1422     assert(dynamic_cast<A12*>(a13.getA1_4()) == a13.getA12());
1423     assert(dynamic_cast<A12*>(a13.getA1_6()) == a13.getA12());
1424     assert(dynamic_cast<A12*>(a13.getA1_9()) == a13.getA12());
1425     assert(dynamic_cast<A12*>(a13.getA2()) == a13.getA12());
1426     assert(dynamic_cast<A12*>(a13.getA3()) == a13.getA12());
1427     assert(dynamic_cast<A12*>(a13.getA4()) == a13.getA12());
1428     assert(dynamic_cast<A12*>(a13.getA5()) == a13.getA12());
1429     assert(dynamic_cast<A12*>(a13.getA6()) == a13.getA12());
1430     assert(dynamic_cast<A12*>(a13.getA7()) == a13.getA12());
1431     assert(dynamic_cast<A12*>(a13.getA8()) == a13.getA12());
1432     assert(dynamic_cast<A12*>(a13.getA9()) == a13.getA12());
1433     assert(dynamic_cast<A12*>(a13.getA10()) == a13.getA12());
1434     assert(dynamic_cast<A12*>(a13.getA11()) == a13.getA12());
1435 
1436     assert(dynamic_cast<A13*>(a13.getA1_3()) == 0);
1437     assert(dynamic_cast<A13*>(a13.getA1_4()) == a13.getA13());
1438     assert(dynamic_cast<A13*>(a13.getA1_6()) == a13.getA13());
1439     assert(dynamic_cast<A13*>(a13.getA1_9()) == a13.getA13());
1440     assert(dynamic_cast<A13*>(a13.getA2()) == a13.getA13());
1441     assert(dynamic_cast<A13*>(a13.getA3()) == a13.getA13());
1442     assert(dynamic_cast<A13*>(a13.getA4()) == a13.getA13());
1443     assert(dynamic_cast<A13*>(a13.getA5()) == a13.getA13());
1444     assert(dynamic_cast<A13*>(a13.getA6()) == a13.getA13());
1445     assert(dynamic_cast<A13*>(a13.getA7()) == a13.getA13());
1446     assert(dynamic_cast<A13*>(a13.getA8()) == a13.getA13());
1447     assert(dynamic_cast<A13*>(a13.getA9()) == a13.getA13());
1448     assert(dynamic_cast<A13*>(a13.getA10()) == a13.getA13());
1449     assert(dynamic_cast<A13*>(a13.getA11()) == a13.getA13());
1450     assert(dynamic_cast<A13*>(a13.getA12()) == a13.getA13());
1451 }
1452 
1453 }  // t2
1454 
1455 namespace t3
1456 {
1457 
1458 struct A1
1459 {
1460     char _[43981];
~A1t3::A11461     virtual ~A1() {}
1462 
getA1t3::A11463     A1* getA1() {return this;}
1464 };
1465 
1466 struct A2
1467 {
1468     char _[34981];
~A2t3::A21469     virtual ~A2() {}
1470 
getA2t3::A21471     A2* getA2() {return this;}
1472 };
1473 
1474 struct A3
1475     : public A1,
1476       protected virtual A2
1477 {
1478     char _[93481];
~A3t3::A31479     virtual ~A3() {}
1480 
getA1_3t3::A31481     A1* getA1_3() {return A1::getA1();}
getA2t3::A31482     A2* getA2() {return A2::getA2();}
getA3t3::A31483     A3* getA3() {return this;}
1484 };
1485 
1486 struct A4
1487     : public virtual A2,
1488       public A1
1489 {
1490     char _[13489];
~A4t3::A41491     virtual ~A4() {}
1492 
getA1_4t3::A41493     A1* getA1_4() {return A1::getA1();}
getA2t3::A41494     A2* getA2() {return A2::getA2();}
getA4t3::A41495     A4* getA4() {return this;}
1496 };
1497 
1498 struct A5
1499     : public A3,
1500       public A4
1501 {
1502     char _[13489];
~A5t3::A51503     virtual ~A5() {}
1504 
getA1_3t3::A51505     A1* getA1_3() {return A3::getA1();}
getA1_4t3::A51506     A1* getA1_4() {return A4::getA1();}
getA2t3::A51507     A2* getA2() {return A3::getA2();}
getA3t3::A51508     A3* getA3() {return A3::getA3();}
getA4t3::A51509     A4* getA4() {return A4::getA4();}
getA5t3::A51510     A5* getA5() {return this;}
1511 };
1512 
1513 struct A6
1514     : public A1
1515 {
1516     char _[81349];
~A6t3::A61517     virtual ~A6() {}
1518 
getA1_6t3::A61519     A1* getA1_6() {return A1::getA1();}
getA6t3::A61520     A6* getA6() {return this;}
1521 };
1522 
1523 struct A7
1524     : public A5,
1525       public A6
1526 {
1527     char _[34819];
~A7t3::A71528     virtual ~A7() {}
1529 
getA1_3t3::A71530     A1* getA1_3() {return A5::getA1_3();}
getA1_4t3::A71531     A1* getA1_4() {return A5::getA1_4();}
getA1_6t3::A71532     A1* getA1_6() {return A6::getA1_6();}
getA2t3::A71533     A2* getA2() {return A5::getA2();}
getA3t3::A71534     A3* getA3() {return A5::getA3();}
getA4t3::A71535     A4* getA4() {return A5::getA4();}
getA5t3::A71536     A5* getA5() {return A5::getA5();}
getA6t3::A71537     A6* getA6() {return A6::getA6();}
getA7t3::A71538     A7* getA7() {return this;}
1539 };
1540 
1541 struct A8
1542     : public A7
1543 {
1544     char _[3489];
~A8t3::A81545     virtual ~A8() {}
1546 
getA1_3t3::A81547     A1* getA1_3() {return A7::getA1_3();}
getA1_4t3::A81548     A1* getA1_4() {return A7::getA1_4();}
getA1_6t3::A81549     A1* getA1_6() {return A7::getA1_6();}
getA2t3::A81550     A2* getA2() {return A7::getA2();}
getA3t3::A81551     A3* getA3() {return A7::getA3();}
getA4t3::A81552     A4* getA4() {return A7::getA4();}
getA5t3::A81553     A5* getA5() {return A7::getA5();}
getA6t3::A81554     A6* getA6() {return A7::getA6();}
getA7t3::A81555     A7* getA7() {return A7::getA7();}
getA8t3::A81556     A8* getA8() {return this;}
1557 };
1558 
1559 struct A9
1560     : public A1
1561 {
1562     char _[3481];
~A9t3::A91563     virtual ~A9() {}
1564 
getA1_9t3::A91565     A1* getA1_9() {return A1::getA1();}
getA9t3::A91566     A9* getA9() {return this;}
1567 };
1568 
1569 struct A10
1570     : public virtual A8
1571 {
1572     char _[4831];
~A10t3::A101573     virtual ~A10() {}
1574 
getA1_3t3::A101575     A1* getA1_3() {return A8::getA1_3();}
getA1_4t3::A101576     A1* getA1_4() {return A8::getA1_4();}
getA1_6t3::A101577     A1* getA1_6() {return A8::getA1_6();}
getA2t3::A101578     A2* getA2() {return A8::getA2();}
getA3t3::A101579     A3* getA3() {return A8::getA3();}
getA4t3::A101580     A4* getA4() {return A8::getA4();}
getA5t3::A101581     A5* getA5() {return A8::getA5();}
getA6t3::A101582     A6* getA6() {return A8::getA6();}
getA7t3::A101583     A7* getA7() {return A8::getA7();}
getA8t3::A101584     A8* getA8() {return A8::getA8();}
getA10t3::A101585     A10* getA10() {return this;}
1586 };
1587 
1588 struct A11
1589     : public virtual A8,
1590       public A9
1591 {
1592     char _[6483];
~A11t3::A111593     virtual ~A11() {}
1594 
getA1_3t3::A111595     A1* getA1_3() {return A8::getA1_3();}
getA1_4t3::A111596     A1* getA1_4() {return A8::getA1_4();}
getA1_6t3::A111597     A1* getA1_6() {return A8::getA1_6();}
getA1_9t3::A111598     A1* getA1_9() {return A9::getA1_9();}
getA2t3::A111599     A2* getA2() {return A8::getA2();}
getA3t3::A111600     A3* getA3() {return A8::getA3();}
getA4t3::A111601     A4* getA4() {return A8::getA4();}
getA5t3::A111602     A5* getA5() {return A8::getA5();}
getA6t3::A111603     A6* getA6() {return A8::getA6();}
getA7t3::A111604     A7* getA7() {return A8::getA7();}
getA8t3::A111605     A8* getA8() {return A8::getA8();}
getA9t3::A111606     A9* getA9() {return A9::getA9();}
getA11t3::A111607     A11* getA11() {return this;}
1608 };
1609 
1610 struct A12
1611     : public A10,
1612       public A11
1613 {
1614     char _[2283];
~A12t3::A121615     virtual ~A12() {}
1616 
getA1_3t3::A121617     A1* getA1_3() {return A10::getA1_3();}
getA1_4t3::A121618     A1* getA1_4() {return A10::getA1_4();}
getA1_6t3::A121619     A1* getA1_6() {return A10::getA1_6();}
getA1_9t3::A121620     A1* getA1_9() {return A11::getA1_9();}
getA2t3::A121621     A2* getA2() {return A10::getA2();}
getA3t3::A121622     A3* getA3() {return A10::getA3();}
getA4t3::A121623     A4* getA4() {return A10::getA4();}
getA5t3::A121624     A5* getA5() {return A10::getA5();}
getA6t3::A121625     A6* getA6() {return A10::getA6();}
getA7t3::A121626     A7* getA7() {return A10::getA7();}
getA8t3::A121627     A8* getA8() {return A10::getA8();}
getA9t3::A121628     A9* getA9() {return A11::getA9();}
getA10t3::A121629     A10* getA10() {return A10::getA10();}
getA11t3::A121630     A11* getA11() {return A11::getA11();}
getA12t3::A121631     A12* getA12() {return this;}
1632 };
1633 
1634 struct A13
1635     : public A12
1636 {
1637     char _[1283];
~A13t3::A131638     virtual ~A13() {}
1639 
getA1_3t3::A131640     A1* getA1_3() {return A12::getA1_3();}
getA1_4t3::A131641     A1* getA1_4() {return A12::getA1_4();}
getA1_6t3::A131642     A1* getA1_6() {return A12::getA1_6();}
getA1_9t3::A131643     A1* getA1_9() {return A12::getA1_9();}
getA2t3::A131644     A2* getA2() {return A12::getA2();}
getA3t3::A131645     A3* getA3() {return A12::getA3();}
getA4t3::A131646     A4* getA4() {return A12::getA4();}
getA5t3::A131647     A5* getA5() {return A12::getA5();}
getA6t3::A131648     A6* getA6() {return A12::getA6();}
getA7t3::A131649     A7* getA7() {return A12::getA7();}
getA8t3::A131650     A8* getA8() {return A12::getA8();}
getA9t3::A131651     A9* getA9() {return A12::getA9();}
getA10t3::A131652     A10* getA10() {return A12::getA10();}
getA11t3::A131653     A11* getA11() {return A12::getA11();}
getA12t3::A131654     A12* getA12() {return A12::getA12();}
getA13t3::A131655     A13* getA13() {return this;}
1656 };
1657 
1658 A3 a3;
1659 A4 a4;
1660 A5 a5;
1661 A6 a6;
1662 A7 a7;
1663 A8 a8;
1664 A9 a9;
1665 A10 a10;
1666 A11 a11;
1667 A12 a12;
1668 A13 a13;
1669 
test()1670 void test()
1671 {
1672     assert(dynamic_cast<A3*>(a3.getA1_3()) == a3.getA3());
1673     assert(dynamic_cast<A3*>(a3.getA2()) == 0);
1674 
1675     assert(dynamic_cast<A3*>(a4.getA1_4()) == 0);
1676     assert(dynamic_cast<A3*>(a4.getA2()) == 0);
1677     assert(dynamic_cast<A4*>(a4.getA1_4()) == a4.getA4());
1678     assert(dynamic_cast<A4*>(a4.getA2()) == a4.getA4());
1679 
1680     assert(dynamic_cast<A3*>(a5.getA1_3()) == a5.getA3());
1681     assert(dynamic_cast<A3*>(a5.getA2()) == a5.getA3());
1682 
1683     assert(dynamic_cast<A4*>(a5.getA1_3()) == a5.getA4());
1684     assert(dynamic_cast<A4*>(a5.getA1_4()) == a5.getA4());
1685     assert(dynamic_cast<A4*>(a5.getA3()) == a5.getA4());
1686     assert(dynamic_cast<A4*>(a5.getA3()) == a5.getA4());
1687 
1688     assert(dynamic_cast<A5*>(a5.getA1_3()) == a5.getA5());
1689     assert(dynamic_cast<A5*>(a5.getA1_4()) == a5.getA5());
1690     assert(dynamic_cast<A5*>(a5.getA3()) == a5.getA5());
1691     assert(dynamic_cast<A5*>(a5.getA3()) == a5.getA5());
1692     assert(dynamic_cast<A5*>(a5.getA3()) == a5.getA5());
1693     assert(dynamic_cast<A5*>(a5.getA4()) == a5.getA5());
1694 
1695     assert(dynamic_cast<A3*>(a6.getA1_6()) == 0);
1696 
1697     assert(dynamic_cast<A4*>(a6.getA1_6()) == 0);
1698 
1699     assert(dynamic_cast<A5*>(a6.getA1_6()) == 0);
1700 
1701     assert(dynamic_cast<A6*>(a6.getA1_6()) == a6.getA6());
1702 
1703     assert(dynamic_cast<A3*>(a7.getA1_3()) == a7.getA3());
1704     assert(dynamic_cast<A3*>(a7.getA1_4()) == a7.getA3());
1705     assert(dynamic_cast<A3*>(a7.getA2()) == a7.getA3());
1706 
1707     assert(dynamic_cast<A4*>(a7.getA1_3()) == a7.getA4());
1708     assert(dynamic_cast<A4*>(a7.getA1_4()) == a7.getA4());
1709     assert(dynamic_cast<A4*>(a7.getA2()) == a7.getA4());
1710     assert(dynamic_cast<A4*>(a7.getA3()) == a7.getA4());
1711 
1712     assert(dynamic_cast<A5*>(a7.getA1_3()) == a7.getA5());
1713     assert(dynamic_cast<A5*>(a7.getA1_4()) == a7.getA5());
1714     assert(dynamic_cast<A5*>(a7.getA2()) == a7.getA5());
1715     assert(dynamic_cast<A5*>(a7.getA3()) == a7.getA5());
1716     assert(dynamic_cast<A5*>(a7.getA4()) == a7.getA5());
1717 
1718     assert(dynamic_cast<A6*>(a7.getA1_3()) == a7.getA6());
1719     assert(dynamic_cast<A6*>(a7.getA1_4()) == a7.getA6());
1720     assert(dynamic_cast<A6*>(a7.getA1_6()) == a7.getA6());
1721     assert(dynamic_cast<A6*>(a7.getA2()) == a7.getA6());
1722     assert(dynamic_cast<A6*>(a7.getA3()) == a7.getA6());
1723     assert(dynamic_cast<A6*>(a7.getA4()) == a7.getA6());
1724     assert(dynamic_cast<A6*>(a7.getA5()) == a7.getA6());
1725 
1726     assert(dynamic_cast<A7*>(a7.getA1_3()) == a7.getA7());
1727     assert(dynamic_cast<A7*>(a7.getA1_4()) == a7.getA7());
1728     assert(dynamic_cast<A7*>(a7.getA1_6()) == a7.getA7());
1729     assert(dynamic_cast<A7*>(a7.getA2()) == a7.getA7());
1730     assert(dynamic_cast<A7*>(a7.getA3()) == a7.getA7());
1731     assert(dynamic_cast<A7*>(a7.getA4()) == a7.getA7());
1732     assert(dynamic_cast<A7*>(a7.getA5()) == a7.getA7());
1733     assert(dynamic_cast<A7*>(a7.getA6()) == a7.getA7());
1734 
1735     assert(dynamic_cast<A3*>(a8.getA1_3()) == a8.getA3());
1736     assert(dynamic_cast<A3*>(a8.getA1_4()) == a8.getA3());
1737     assert(dynamic_cast<A3*>(a8.getA2()) == a8.getA3());
1738 
1739     assert(dynamic_cast<A4*>(a8.getA1_3()) == a8.getA4());
1740     assert(dynamic_cast<A4*>(a8.getA1_4()) == a8.getA4());
1741     assert(dynamic_cast<A4*>(a8.getA2()) == a8.getA4());
1742     assert(dynamic_cast<A4*>(a8.getA3()) == a8.getA4());
1743 
1744     assert(dynamic_cast<A5*>(a8.getA1_3()) == a8.getA5());
1745     assert(dynamic_cast<A5*>(a8.getA1_4()) == a8.getA5());
1746     assert(dynamic_cast<A5*>(a8.getA2()) == a8.getA5());
1747     assert(dynamic_cast<A5*>(a8.getA3()) == a8.getA5());
1748     assert(dynamic_cast<A5*>(a8.getA4()) == a8.getA5());
1749 
1750     assert(dynamic_cast<A6*>(a8.getA1_3()) == a8.getA6());
1751     assert(dynamic_cast<A6*>(a8.getA1_4()) == a8.getA6());
1752     assert(dynamic_cast<A6*>(a8.getA1_6()) == a8.getA6());
1753     assert(dynamic_cast<A6*>(a8.getA2()) == a8.getA6());
1754     assert(dynamic_cast<A6*>(a8.getA3()) == a8.getA6());
1755     assert(dynamic_cast<A6*>(a8.getA4()) == a8.getA6());
1756     assert(dynamic_cast<A6*>(a8.getA5()) == a8.getA6());
1757 
1758     assert(dynamic_cast<A7*>(a8.getA1_3()) == a8.getA7());
1759     assert(dynamic_cast<A7*>(a8.getA1_4()) == a8.getA7());
1760     assert(dynamic_cast<A7*>(a8.getA1_6()) == a8.getA7());
1761     assert(dynamic_cast<A7*>(a8.getA2()) == a8.getA7());
1762     assert(dynamic_cast<A7*>(a8.getA3()) == a8.getA7());
1763     assert(dynamic_cast<A7*>(a8.getA4()) == a8.getA7());
1764     assert(dynamic_cast<A7*>(a8.getA5()) == a8.getA7());
1765     assert(dynamic_cast<A7*>(a8.getA6()) == a8.getA7());
1766 
1767     assert(dynamic_cast<A8*>(a8.getA1_3()) == a8.getA8());
1768     assert(dynamic_cast<A8*>(a8.getA1_4()) == a8.getA8());
1769     assert(dynamic_cast<A8*>(a8.getA1_6()) == a8.getA8());
1770     assert(dynamic_cast<A8*>(a8.getA2()) == a8.getA8());
1771     assert(dynamic_cast<A8*>(a8.getA3()) == a8.getA8());
1772     assert(dynamic_cast<A8*>(a8.getA4()) == a8.getA8());
1773     assert(dynamic_cast<A8*>(a8.getA5()) == a8.getA8());
1774     assert(dynamic_cast<A8*>(a8.getA6()) == a8.getA8());
1775     assert(dynamic_cast<A8*>(a8.getA7()) == a8.getA8());
1776 
1777     assert(dynamic_cast<A3*>(a9.getA1_9()) == 0);
1778 
1779     assert(dynamic_cast<A4*>(a9.getA1_9()) == 0);
1780 
1781     assert(dynamic_cast<A5*>(a9.getA1_9()) == 0);
1782 
1783     assert(dynamic_cast<A6*>(a9.getA1_9()) == 0);
1784 
1785     assert(dynamic_cast<A7*>(a9.getA1_9()) == 0);
1786 
1787     assert(dynamic_cast<A8*>(a9.getA1_9()) == 0);
1788 
1789     assert(dynamic_cast<A9*>(a9.getA1_9()) == a9.getA9());
1790 
1791     assert(dynamic_cast<A3*>(a10.getA1_3()) == a10.getA3());
1792     assert(dynamic_cast<A3*>(a10.getA1_4()) == a10.getA3());
1793     assert(dynamic_cast<A3*>(a10.getA1_6()) == a10.getA3());
1794     assert(dynamic_cast<A3*>(a10.getA2()) == a10.getA3());
1795 
1796     assert(dynamic_cast<A4*>(a10.getA1_3()) == a10.getA4());
1797     assert(dynamic_cast<A4*>(a10.getA1_4()) == a10.getA4());
1798     assert(dynamic_cast<A4*>(a10.getA1_6()) == a10.getA4());
1799     assert(dynamic_cast<A4*>(a10.getA2()) == a10.getA4());
1800     assert(dynamic_cast<A4*>(a10.getA3()) == a10.getA4());
1801 
1802     assert(dynamic_cast<A5*>(a10.getA1_3()) == a10.getA5());
1803     assert(dynamic_cast<A5*>(a10.getA1_4()) == a10.getA5());
1804     assert(dynamic_cast<A5*>(a10.getA1_6()) == a10.getA5());
1805     assert(dynamic_cast<A5*>(a10.getA2()) == a10.getA5());
1806     assert(dynamic_cast<A5*>(a10.getA3()) == a10.getA5());
1807     assert(dynamic_cast<A5*>(a10.getA4()) == a10.getA5());
1808 
1809     assert(dynamic_cast<A6*>(a10.getA1_3()) == a10.getA6());
1810     assert(dynamic_cast<A6*>(a10.getA1_4()) == a10.getA6());
1811     assert(dynamic_cast<A6*>(a10.getA1_6()) == a10.getA6());
1812     assert(dynamic_cast<A6*>(a10.getA2()) == a10.getA6());
1813     assert(dynamic_cast<A6*>(a10.getA3()) == a10.getA6());
1814     assert(dynamic_cast<A6*>(a10.getA4()) == a10.getA6());
1815     assert(dynamic_cast<A6*>(a10.getA5()) == a10.getA6());
1816 
1817     assert(dynamic_cast<A7*>(a10.getA1_3()) == a10.getA7());
1818     assert(dynamic_cast<A7*>(a10.getA1_4()) == a10.getA7());
1819     assert(dynamic_cast<A7*>(a10.getA1_6()) == a10.getA7());
1820     assert(dynamic_cast<A7*>(a10.getA2()) == a10.getA7());
1821     assert(dynamic_cast<A7*>(a10.getA3()) == a10.getA7());
1822     assert(dynamic_cast<A7*>(a10.getA4()) == a10.getA7());
1823     assert(dynamic_cast<A7*>(a10.getA5()) == a10.getA7());
1824     assert(dynamic_cast<A7*>(a10.getA6()) == a10.getA7());
1825 
1826     assert(dynamic_cast<A8*>(a10.getA1_3()) == a10.getA8());
1827     assert(dynamic_cast<A8*>(a10.getA1_4()) == a10.getA8());
1828     assert(dynamic_cast<A8*>(a10.getA1_6()) == a10.getA8());
1829     assert(dynamic_cast<A8*>(a10.getA2()) == a10.getA8());
1830     assert(dynamic_cast<A8*>(a10.getA3()) == a10.getA8());
1831     assert(dynamic_cast<A8*>(a10.getA4()) == a10.getA8());
1832     assert(dynamic_cast<A8*>(a10.getA5()) == a10.getA8());
1833     assert(dynamic_cast<A8*>(a10.getA6()) == a10.getA8());
1834     assert(dynamic_cast<A8*>(a10.getA7()) == a10.getA8());
1835 
1836     assert(dynamic_cast<A9*>(a10.getA1_3()) == 0);
1837     assert(dynamic_cast<A9*>(a10.getA1_4()) == 0);
1838     assert(dynamic_cast<A9*>(a10.getA1_6()) == 0);
1839     assert(dynamic_cast<A9*>(a10.getA2()) == 0);
1840     assert(dynamic_cast<A9*>(a10.getA3()) == 0);
1841     assert(dynamic_cast<A9*>(a10.getA4()) == 0);
1842     assert(dynamic_cast<A9*>(a10.getA5()) == 0);
1843     assert(dynamic_cast<A9*>(a10.getA6()) == 0);
1844     assert(dynamic_cast<A9*>(a10.getA7()) == 0);
1845     assert(dynamic_cast<A9*>(a10.getA8()) == 0);
1846 
1847     assert(dynamic_cast<A10*>(a10.getA1_3()) == a10.getA10());
1848     assert(dynamic_cast<A10*>(a10.getA1_4()) == a10.getA10());
1849     assert(dynamic_cast<A10*>(a10.getA1_6()) == a10.getA10());
1850     assert(dynamic_cast<A10*>(a10.getA2()) == a10.getA10());
1851     assert(dynamic_cast<A10*>(a10.getA3()) == a10.getA10());
1852     assert(dynamic_cast<A10*>(a10.getA4()) == a10.getA10());
1853     assert(dynamic_cast<A10*>(a10.getA5()) == a10.getA10());
1854     assert(dynamic_cast<A10*>(a10.getA6()) == a10.getA10());
1855     assert(dynamic_cast<A10*>(a10.getA7()) == a10.getA10());
1856     assert(dynamic_cast<A10*>(a10.getA8()) == a10.getA10());
1857 
1858     assert(dynamic_cast<A3*>(a11.getA1_3()) == a11.getA3());
1859     assert(dynamic_cast<A3*>(a11.getA1_4()) == a11.getA3());
1860     assert(dynamic_cast<A3*>(a11.getA1_6()) == a11.getA3());
1861     assert(dynamic_cast<A3*>(a11.getA1_9()) == a11.getA3());
1862     assert(dynamic_cast<A3*>(a11.getA2()) == a11.getA3());
1863 
1864     assert(dynamic_cast<A4*>(a11.getA1_3()) == a11.getA4());
1865     assert(dynamic_cast<A4*>(a11.getA1_4()) == a11.getA4());
1866     assert(dynamic_cast<A4*>(a11.getA1_6()) == a11.getA4());
1867     assert(dynamic_cast<A4*>(a11.getA1_9()) == a11.getA4());
1868     assert(dynamic_cast<A4*>(a11.getA2()) == a11.getA4());
1869     assert(dynamic_cast<A4*>(a11.getA3()) == a11.getA4());
1870 
1871     assert(dynamic_cast<A5*>(a11.getA1_3()) == a11.getA5());
1872     assert(dynamic_cast<A5*>(a11.getA1_4()) == a11.getA5());
1873     assert(dynamic_cast<A5*>(a11.getA1_6()) == a11.getA5());
1874     assert(dynamic_cast<A5*>(a11.getA1_9()) == a11.getA5());
1875     assert(dynamic_cast<A5*>(a11.getA2()) == a11.getA5());
1876     assert(dynamic_cast<A5*>(a11.getA3()) == a11.getA5());
1877     assert(dynamic_cast<A5*>(a11.getA4()) == a11.getA5());
1878 
1879     assert(dynamic_cast<A6*>(a11.getA1_3()) == a11.getA6());
1880     assert(dynamic_cast<A6*>(a11.getA1_4()) == a11.getA6());
1881     assert(dynamic_cast<A6*>(a11.getA1_6()) == a11.getA6());
1882     assert(dynamic_cast<A6*>(a11.getA1_9()) == a11.getA6());
1883     assert(dynamic_cast<A6*>(a11.getA2()) == a11.getA6());
1884     assert(dynamic_cast<A6*>(a11.getA3()) == a11.getA6());
1885     assert(dynamic_cast<A6*>(a11.getA4()) == a11.getA6());
1886     assert(dynamic_cast<A6*>(a11.getA5()) == a11.getA6());
1887 
1888     assert(dynamic_cast<A7*>(a11.getA1_3()) == a11.getA7());
1889     assert(dynamic_cast<A7*>(a11.getA1_4()) == a11.getA7());
1890     assert(dynamic_cast<A7*>(a11.getA1_6()) == a11.getA7());
1891     assert(dynamic_cast<A7*>(a11.getA1_9()) == a11.getA7());
1892     assert(dynamic_cast<A7*>(a11.getA2()) == a11.getA7());
1893     assert(dynamic_cast<A7*>(a11.getA3()) == a11.getA7());
1894     assert(dynamic_cast<A7*>(a11.getA4()) == a11.getA7());
1895     assert(dynamic_cast<A7*>(a11.getA5()) == a11.getA7());
1896     assert(dynamic_cast<A7*>(a11.getA6()) == a11.getA7());
1897 
1898     assert(dynamic_cast<A8*>(a11.getA1_3()) == a11.getA8());
1899     assert(dynamic_cast<A8*>(a11.getA1_4()) == a11.getA8());
1900     assert(dynamic_cast<A8*>(a11.getA1_6()) == a11.getA8());
1901     assert(dynamic_cast<A8*>(a11.getA1_9()) == a11.getA8());
1902     assert(dynamic_cast<A8*>(a11.getA2()) == a11.getA8());
1903     assert(dynamic_cast<A8*>(a11.getA3()) == a11.getA8());
1904     assert(dynamic_cast<A8*>(a11.getA4()) == a11.getA8());
1905     assert(dynamic_cast<A8*>(a11.getA5()) == a11.getA8());
1906     assert(dynamic_cast<A8*>(a11.getA6()) == a11.getA8());
1907     assert(dynamic_cast<A8*>(a11.getA7()) == a11.getA8());
1908 
1909     assert(dynamic_cast<A9*>(a11.getA1_3()) == a11.getA9());
1910     assert(dynamic_cast<A9*>(a11.getA1_4()) == a11.getA9());
1911     assert(dynamic_cast<A9*>(a11.getA1_6()) == a11.getA9());
1912     assert(dynamic_cast<A9*>(a11.getA1_9()) == a11.getA9());
1913     assert(dynamic_cast<A9*>(a11.getA2()) == a11.getA9());
1914     assert(dynamic_cast<A9*>(a11.getA3()) == a11.getA9());
1915     assert(dynamic_cast<A9*>(a11.getA4()) == a11.getA9());
1916     assert(dynamic_cast<A9*>(a11.getA5()) == a11.getA9());
1917     assert(dynamic_cast<A9*>(a11.getA6()) == a11.getA9());
1918     assert(dynamic_cast<A9*>(a11.getA7()) == a11.getA9());
1919     assert(dynamic_cast<A9*>(a11.getA8()) == a11.getA9());
1920 
1921     assert(dynamic_cast<A10*>(a11.getA1_3()) == 0);
1922     assert(dynamic_cast<A10*>(a11.getA1_4()) == 0);
1923     assert(dynamic_cast<A10*>(a11.getA1_6()) == 0);
1924     assert(dynamic_cast<A10*>(a11.getA1_9()) == 0);
1925     assert(dynamic_cast<A10*>(a11.getA2()) == 0);
1926     assert(dynamic_cast<A10*>(a11.getA3()) == 0);
1927     assert(dynamic_cast<A10*>(a11.getA4()) == 0);
1928     assert(dynamic_cast<A10*>(a11.getA5()) == 0);
1929     assert(dynamic_cast<A10*>(a11.getA6()) == 0);
1930     assert(dynamic_cast<A10*>(a11.getA7()) == 0);
1931     assert(dynamic_cast<A10*>(a11.getA8()) == 0);
1932     assert(dynamic_cast<A10*>(a11.getA9()) == 0);
1933 
1934     assert(dynamic_cast<A11*>(a11.getA1_3()) == a11.getA11());
1935     assert(dynamic_cast<A11*>(a11.getA1_4()) == a11.getA11());
1936     assert(dynamic_cast<A11*>(a11.getA1_6()) == a11.getA11());
1937     assert(dynamic_cast<A11*>(a11.getA1_9()) == a11.getA11());
1938     assert(dynamic_cast<A11*>(a11.getA2()) == a11.getA11());
1939     assert(dynamic_cast<A11*>(a11.getA3()) == a11.getA11());
1940     assert(dynamic_cast<A11*>(a11.getA4()) == a11.getA11());
1941     assert(dynamic_cast<A11*>(a11.getA5()) == a11.getA11());
1942     assert(dynamic_cast<A11*>(a11.getA6()) == a11.getA11());
1943     assert(dynamic_cast<A11*>(a11.getA7()) == a11.getA11());
1944     assert(dynamic_cast<A11*>(a11.getA8()) == a11.getA11());
1945     assert(dynamic_cast<A11*>(a11.getA9()) == a11.getA11());
1946 
1947     assert(dynamic_cast<A3*>(a12.getA1_3()) == a12.getA3());
1948     assert(dynamic_cast<A3*>(a12.getA1_4()) == a12.getA3());
1949     assert(dynamic_cast<A3*>(a12.getA1_6()) == a12.getA3());
1950     assert(dynamic_cast<A3*>(a12.getA1_9()) == a12.getA3());
1951     assert(dynamic_cast<A3*>(a12.getA2()) == a12.getA3());
1952 
1953     assert(dynamic_cast<A4*>(a12.getA1_3()) == a12.getA4());
1954     assert(dynamic_cast<A4*>(a12.getA1_4()) == a12.getA4());
1955     assert(dynamic_cast<A4*>(a12.getA1_6()) == a12.getA4());
1956     assert(dynamic_cast<A4*>(a12.getA1_9()) == a12.getA4());
1957     assert(dynamic_cast<A4*>(a12.getA2()) == a12.getA4());
1958     assert(dynamic_cast<A4*>(a12.getA3()) == a12.getA4());
1959 
1960     assert(dynamic_cast<A5*>(a12.getA1_3()) == a12.getA5());
1961     assert(dynamic_cast<A5*>(a12.getA1_4()) == a12.getA5());
1962     assert(dynamic_cast<A5*>(a12.getA1_6()) == a12.getA5());
1963     assert(dynamic_cast<A5*>(a12.getA1_9()) == a12.getA5());
1964     assert(dynamic_cast<A5*>(a12.getA2()) == a12.getA5());
1965     assert(dynamic_cast<A5*>(a12.getA3()) == a12.getA5());
1966     assert(dynamic_cast<A5*>(a12.getA4()) == a12.getA5());
1967 
1968     assert(dynamic_cast<A6*>(a12.getA1_3()) == a12.getA6());
1969     assert(dynamic_cast<A6*>(a12.getA1_4()) == a12.getA6());
1970     assert(dynamic_cast<A6*>(a12.getA1_6()) == a12.getA6());
1971     assert(dynamic_cast<A6*>(a12.getA1_9()) == a12.getA6());
1972     assert(dynamic_cast<A6*>(a12.getA2()) == a12.getA6());
1973     assert(dynamic_cast<A6*>(a12.getA3()) == a12.getA6());
1974     assert(dynamic_cast<A6*>(a12.getA4()) == a12.getA6());
1975     assert(dynamic_cast<A6*>(a12.getA5()) == a12.getA6());
1976 
1977     assert(dynamic_cast<A7*>(a12.getA1_3()) == a12.getA7());
1978     assert(dynamic_cast<A7*>(a12.getA1_4()) == a12.getA7());
1979     assert(dynamic_cast<A7*>(a12.getA1_6()) == a12.getA7());
1980     assert(dynamic_cast<A7*>(a12.getA1_9()) == a12.getA7());
1981     assert(dynamic_cast<A7*>(a12.getA2()) == a12.getA7());
1982     assert(dynamic_cast<A7*>(a12.getA3()) == a12.getA7());
1983     assert(dynamic_cast<A7*>(a12.getA4()) == a12.getA7());
1984     assert(dynamic_cast<A7*>(a12.getA5()) == a12.getA7());
1985     assert(dynamic_cast<A7*>(a12.getA6()) == a12.getA7());
1986 
1987     assert(dynamic_cast<A8*>(a12.getA1_3()) == a12.getA8());
1988     assert(dynamic_cast<A8*>(a12.getA1_4()) == a12.getA8());
1989     assert(dynamic_cast<A8*>(a12.getA1_6()) == a12.getA8());
1990     assert(dynamic_cast<A8*>(a12.getA1_9()) == a12.getA8());
1991     assert(dynamic_cast<A8*>(a12.getA2()) == a12.getA8());
1992     assert(dynamic_cast<A8*>(a12.getA3()) == a12.getA8());
1993     assert(dynamic_cast<A8*>(a12.getA4()) == a12.getA8());
1994     assert(dynamic_cast<A8*>(a12.getA5()) == a12.getA8());
1995     assert(dynamic_cast<A8*>(a12.getA6()) == a12.getA8());
1996     assert(dynamic_cast<A8*>(a12.getA7()) == a12.getA8());
1997 
1998     assert(dynamic_cast<A9*>(a12.getA1_3()) == a12.getA9());
1999     assert(dynamic_cast<A9*>(a12.getA1_4()) == a12.getA9());
2000     assert(dynamic_cast<A9*>(a12.getA1_6()) == a12.getA9());
2001     assert(dynamic_cast<A9*>(a12.getA1_9()) == a12.getA9());
2002     assert(dynamic_cast<A9*>(a12.getA2()) == a12.getA9());
2003     assert(dynamic_cast<A9*>(a12.getA3()) == a12.getA9());
2004     assert(dynamic_cast<A9*>(a12.getA4()) == a12.getA9());
2005     assert(dynamic_cast<A9*>(a12.getA5()) == a12.getA9());
2006     assert(dynamic_cast<A9*>(a12.getA6()) == a12.getA9());
2007     assert(dynamic_cast<A9*>(a12.getA7()) == a12.getA9());
2008     assert(dynamic_cast<A9*>(a12.getA8()) == a12.getA9());
2009 
2010     assert(dynamic_cast<A10*>(a12.getA1_3()) == a12.getA10());
2011     assert(dynamic_cast<A10*>(a12.getA1_4()) == a12.getA10());
2012     assert(dynamic_cast<A10*>(a12.getA1_6()) == a12.getA10());
2013     assert(dynamic_cast<A10*>(a12.getA1_9()) == a12.getA10());
2014     assert(dynamic_cast<A10*>(a12.getA2()) == a12.getA10());
2015     assert(dynamic_cast<A10*>(a12.getA3()) == a12.getA10());
2016     assert(dynamic_cast<A10*>(a12.getA4()) == a12.getA10());
2017     assert(dynamic_cast<A10*>(a12.getA5()) == a12.getA10());
2018     assert(dynamic_cast<A10*>(a12.getA6()) == a12.getA10());
2019     assert(dynamic_cast<A10*>(a12.getA7()) == a12.getA10());
2020     assert(dynamic_cast<A10*>(a12.getA8()) == a12.getA10());
2021     assert(dynamic_cast<A10*>(a12.getA9()) == a12.getA10());
2022 
2023     assert(dynamic_cast<A11*>(a12.getA1_3()) == a12.getA11());
2024     assert(dynamic_cast<A11*>(a12.getA1_4()) == a12.getA11());
2025     assert(dynamic_cast<A11*>(a12.getA1_6()) == a12.getA11());
2026     assert(dynamic_cast<A11*>(a12.getA1_9()) == a12.getA11());
2027     assert(dynamic_cast<A11*>(a12.getA2()) == a12.getA11());
2028     assert(dynamic_cast<A11*>(a12.getA3()) == a12.getA11());
2029     assert(dynamic_cast<A11*>(a12.getA4()) == a12.getA11());
2030     assert(dynamic_cast<A11*>(a12.getA5()) == a12.getA11());
2031     assert(dynamic_cast<A11*>(a12.getA6()) == a12.getA11());
2032     assert(dynamic_cast<A11*>(a12.getA7()) == a12.getA11());
2033     assert(dynamic_cast<A11*>(a12.getA8()) == a12.getA11());
2034     assert(dynamic_cast<A11*>(a12.getA9()) == a12.getA11());
2035     assert(dynamic_cast<A11*>(a12.getA10()) == a12.getA11());
2036 
2037     assert(dynamic_cast<A12*>(a12.getA1_3()) == a12.getA12());
2038     assert(dynamic_cast<A12*>(a12.getA1_4()) == a12.getA12());
2039     assert(dynamic_cast<A12*>(a12.getA1_6()) == a12.getA12());
2040     assert(dynamic_cast<A12*>(a12.getA1_9()) == a12.getA12());
2041     assert(dynamic_cast<A12*>(a12.getA2()) == a12.getA12());
2042     assert(dynamic_cast<A12*>(a12.getA3()) == a12.getA12());
2043     assert(dynamic_cast<A12*>(a12.getA4()) == a12.getA12());
2044     assert(dynamic_cast<A12*>(a12.getA5()) == a12.getA12());
2045     assert(dynamic_cast<A12*>(a12.getA6()) == a12.getA12());
2046     assert(dynamic_cast<A12*>(a12.getA7()) == a12.getA12());
2047     assert(dynamic_cast<A12*>(a12.getA8()) == a12.getA12());
2048     assert(dynamic_cast<A12*>(a12.getA9()) == a12.getA12());
2049     assert(dynamic_cast<A12*>(a12.getA10()) == a12.getA12());
2050     assert(dynamic_cast<A12*>(a12.getA11()) == a12.getA12());
2051 
2052     assert(dynamic_cast<A3*>(a13.getA1_3()) == a13.getA3());
2053     assert(dynamic_cast<A3*>(a13.getA1_4()) == a13.getA3());
2054     assert(dynamic_cast<A3*>(a13.getA1_6()) == a13.getA3());
2055     assert(dynamic_cast<A3*>(a13.getA1_9()) == a13.getA3());
2056     assert(dynamic_cast<A3*>(a13.getA2()) == a13.getA3());
2057 
2058     assert(dynamic_cast<A4*>(a13.getA1_3()) == a13.getA4());
2059     assert(dynamic_cast<A4*>(a13.getA1_4()) == a13.getA4());
2060     assert(dynamic_cast<A4*>(a13.getA1_6()) == a13.getA4());
2061     assert(dynamic_cast<A4*>(a13.getA1_9()) == a13.getA4());
2062     assert(dynamic_cast<A4*>(a13.getA2()) == a13.getA4());
2063     assert(dynamic_cast<A4*>(a13.getA3()) == a13.getA4());
2064 
2065     assert(dynamic_cast<A5*>(a13.getA1_3()) == a13.getA5());
2066     assert(dynamic_cast<A5*>(a13.getA1_4()) == a13.getA5());
2067     assert(dynamic_cast<A5*>(a13.getA1_6()) == a13.getA5());
2068     assert(dynamic_cast<A5*>(a13.getA1_9()) == a13.getA5());
2069     assert(dynamic_cast<A5*>(a13.getA2()) == a13.getA5());
2070     assert(dynamic_cast<A5*>(a13.getA3()) == a13.getA5());
2071     assert(dynamic_cast<A5*>(a13.getA4()) == a13.getA5());
2072 
2073     assert(dynamic_cast<A6*>(a13.getA1_3()) == a13.getA6());
2074     assert(dynamic_cast<A6*>(a13.getA1_4()) == a13.getA6());
2075     assert(dynamic_cast<A6*>(a13.getA1_6()) == a13.getA6());
2076     assert(dynamic_cast<A6*>(a13.getA1_9()) == a13.getA6());
2077     assert(dynamic_cast<A6*>(a13.getA2()) == a13.getA6());
2078     assert(dynamic_cast<A6*>(a13.getA3()) == a13.getA6());
2079     assert(dynamic_cast<A6*>(a13.getA4()) == a13.getA6());
2080     assert(dynamic_cast<A6*>(a13.getA5()) == a13.getA6());
2081 
2082     assert(dynamic_cast<A7*>(a13.getA1_3()) == a13.getA7());
2083     assert(dynamic_cast<A7*>(a13.getA1_4()) == a13.getA7());
2084     assert(dynamic_cast<A7*>(a13.getA1_6()) == a13.getA7());
2085     assert(dynamic_cast<A7*>(a13.getA1_9()) == a13.getA7());
2086     assert(dynamic_cast<A7*>(a13.getA2()) == a13.getA7());
2087     assert(dynamic_cast<A7*>(a13.getA3()) == a13.getA7());
2088     assert(dynamic_cast<A7*>(a13.getA4()) == a13.getA7());
2089     assert(dynamic_cast<A7*>(a13.getA5()) == a13.getA7());
2090     assert(dynamic_cast<A7*>(a13.getA6()) == a13.getA7());
2091 
2092     assert(dynamic_cast<A8*>(a13.getA1_3()) == a13.getA8());
2093     assert(dynamic_cast<A8*>(a13.getA1_4()) == a13.getA8());
2094     assert(dynamic_cast<A8*>(a13.getA1_6()) == a13.getA8());
2095     assert(dynamic_cast<A8*>(a13.getA1_9()) == a13.getA8());
2096     assert(dynamic_cast<A8*>(a13.getA2()) == a13.getA8());
2097     assert(dynamic_cast<A8*>(a13.getA3()) == a13.getA8());
2098     assert(dynamic_cast<A8*>(a13.getA4()) == a13.getA8());
2099     assert(dynamic_cast<A8*>(a13.getA5()) == a13.getA8());
2100     assert(dynamic_cast<A8*>(a13.getA6()) == a13.getA8());
2101     assert(dynamic_cast<A8*>(a13.getA7()) == a13.getA8());
2102 
2103     assert(dynamic_cast<A9*>(a13.getA1_3()) == a13.getA9());
2104     assert(dynamic_cast<A9*>(a13.getA1_4()) == a13.getA9());
2105     assert(dynamic_cast<A9*>(a13.getA1_6()) == a13.getA9());
2106     assert(dynamic_cast<A9*>(a13.getA1_9()) == a13.getA9());
2107     assert(dynamic_cast<A9*>(a13.getA2()) == a13.getA9());
2108     assert(dynamic_cast<A9*>(a13.getA3()) == a13.getA9());
2109     assert(dynamic_cast<A9*>(a13.getA4()) == a13.getA9());
2110     assert(dynamic_cast<A9*>(a13.getA5()) == a13.getA9());
2111     assert(dynamic_cast<A9*>(a13.getA6()) == a13.getA9());
2112     assert(dynamic_cast<A9*>(a13.getA7()) == a13.getA9());
2113     assert(dynamic_cast<A9*>(a13.getA8()) == a13.getA9());
2114 
2115     assert(dynamic_cast<A10*>(a13.getA1_3()) == a13.getA10());
2116     assert(dynamic_cast<A10*>(a13.getA1_4()) == a13.getA10());
2117     assert(dynamic_cast<A10*>(a13.getA1_6()) == a13.getA10());
2118     assert(dynamic_cast<A10*>(a13.getA1_9()) == a13.getA10());
2119     assert(dynamic_cast<A10*>(a13.getA2()) == a13.getA10());
2120     assert(dynamic_cast<A10*>(a13.getA3()) == a13.getA10());
2121     assert(dynamic_cast<A10*>(a13.getA4()) == a13.getA10());
2122     assert(dynamic_cast<A10*>(a13.getA5()) == a13.getA10());
2123     assert(dynamic_cast<A10*>(a13.getA6()) == a13.getA10());
2124     assert(dynamic_cast<A10*>(a13.getA7()) == a13.getA10());
2125     assert(dynamic_cast<A10*>(a13.getA8()) == a13.getA10());
2126     assert(dynamic_cast<A10*>(a13.getA9()) == a13.getA10());
2127 
2128     assert(dynamic_cast<A11*>(a13.getA1_3()) == a13.getA11());
2129     assert(dynamic_cast<A11*>(a13.getA1_4()) == a13.getA11());
2130     assert(dynamic_cast<A11*>(a13.getA1_6()) == a13.getA11());
2131     assert(dynamic_cast<A11*>(a13.getA1_9()) == a13.getA11());
2132     assert(dynamic_cast<A11*>(a13.getA2()) == a13.getA11());
2133     assert(dynamic_cast<A11*>(a13.getA3()) == a13.getA11());
2134     assert(dynamic_cast<A11*>(a13.getA4()) == a13.getA11());
2135     assert(dynamic_cast<A11*>(a13.getA5()) == a13.getA11());
2136     assert(dynamic_cast<A11*>(a13.getA6()) == a13.getA11());
2137     assert(dynamic_cast<A11*>(a13.getA7()) == a13.getA11());
2138     assert(dynamic_cast<A11*>(a13.getA8()) == a13.getA11());
2139     assert(dynamic_cast<A11*>(a13.getA9()) == a13.getA11());
2140     assert(dynamic_cast<A11*>(a13.getA10()) == a13.getA11());
2141 
2142     assert(dynamic_cast<A12*>(a13.getA1_3()) == a13.getA12());
2143     assert(dynamic_cast<A12*>(a13.getA1_4()) == a13.getA12());
2144     assert(dynamic_cast<A12*>(a13.getA1_6()) == a13.getA12());
2145     assert(dynamic_cast<A12*>(a13.getA1_9()) == a13.getA12());
2146     assert(dynamic_cast<A12*>(a13.getA2()) == a13.getA12());
2147     assert(dynamic_cast<A12*>(a13.getA3()) == a13.getA12());
2148     assert(dynamic_cast<A12*>(a13.getA4()) == a13.getA12());
2149     assert(dynamic_cast<A12*>(a13.getA5()) == a13.getA12());
2150     assert(dynamic_cast<A12*>(a13.getA6()) == a13.getA12());
2151     assert(dynamic_cast<A12*>(a13.getA7()) == a13.getA12());
2152     assert(dynamic_cast<A12*>(a13.getA8()) == a13.getA12());
2153     assert(dynamic_cast<A12*>(a13.getA9()) == a13.getA12());
2154     assert(dynamic_cast<A12*>(a13.getA10()) == a13.getA12());
2155     assert(dynamic_cast<A12*>(a13.getA11()) == a13.getA12());
2156 
2157     assert(dynamic_cast<A13*>(a13.getA1_3()) == a13.getA13());
2158     assert(dynamic_cast<A13*>(a13.getA1_4()) == a13.getA13());
2159     assert(dynamic_cast<A13*>(a13.getA1_6()) == a13.getA13());
2160     assert(dynamic_cast<A13*>(a13.getA1_9()) == a13.getA13());
2161     assert(dynamic_cast<A13*>(a13.getA2()) == a13.getA13());
2162     assert(dynamic_cast<A13*>(a13.getA3()) == a13.getA13());
2163     assert(dynamic_cast<A13*>(a13.getA4()) == a13.getA13());
2164     assert(dynamic_cast<A13*>(a13.getA5()) == a13.getA13());
2165     assert(dynamic_cast<A13*>(a13.getA6()) == a13.getA13());
2166     assert(dynamic_cast<A13*>(a13.getA7()) == a13.getA13());
2167     assert(dynamic_cast<A13*>(a13.getA8()) == a13.getA13());
2168     assert(dynamic_cast<A13*>(a13.getA9()) == a13.getA13());
2169     assert(dynamic_cast<A13*>(a13.getA10()) == a13.getA13());
2170     assert(dynamic_cast<A13*>(a13.getA11()) == a13.getA13());
2171     assert(dynamic_cast<A13*>(a13.getA12()) == a13.getA13());
2172 }
2173 
2174 }  // t3
2175 
main()2176 int main()
2177 {
2178     timer t;
2179     t1::test();
2180     t2::test();
2181     t3::test();
2182 }
2183