blob: 5eeabfac164f96469299f6ddab15c44b2ee2ccd8 [file] [log] [blame]
Mike Stump49520942009-08-11 04:03:59 +00001// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -O0 -S %s -o %t-64.s &&
Mike Stump06758d02009-08-04 20:37:29 +00002// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s &&
Mike Stump49520942009-08-11 04:03:59 +00003
Mike Stump599837a2009-11-06 00:18:25 +00004// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -emit-llvm %s -o %t-64.ll &&
5// RUN: FileCheck -check-prefix LPLL64 --input-file=%t-64.ll %s &&
Mike Stump49520942009-08-11 04:03:59 +00006
Mike Stump06758d02009-08-04 20:37:29 +00007// RUN: true
Mike Stump3dee6ef2009-07-30 00:22:38 +00008
Mike Stump104ffaa2009-08-04 21:58:42 +00009struct B {
10 virtual void bar1();
11 virtual void bar2();
Mike Stump2effeca2009-08-06 00:38:46 +000012 int b;
Mike Stump104ffaa2009-08-04 21:58:42 +000013};
Mike Stump6f376332009-08-05 22:37:18 +000014void B::bar1() { }
15void B::bar2() { }
16
17struct C {
18 virtual void bee1();
19 virtual void bee2();
20};
21void C::bee1() { }
22void C::bee2() { }
Mike Stump104ffaa2009-08-04 21:58:42 +000023
Mike Stump2effeca2009-08-06 00:38:46 +000024struct D {
25 virtual void boo();
26};
27void D::boo() { }
Mike Stump104ffaa2009-08-04 21:58:42 +000028
Mike Stumpc5708d92009-08-06 14:12:47 +000029struct D1 {
30 virtual void bar();
Mike Stump02cf1e22009-08-06 23:48:32 +000031 virtual void bar2();
32 virtual void bar3();
33 virtual void bar4();
34 virtual void bar5();
Mike Stumpc5708d92009-08-06 14:12:47 +000035 void *d1;
36};
37void D1::bar() { }
38
39class F : virtual public D1, virtual public D {
40public:
41 virtual void foo();
42 void *f;
43};
44void F::foo() { }
45
46int j;
Mike Stump941e3f32009-11-05 05:01:19 +000047void *vp;
Mike Stumpc5708d92009-08-06 14:12:47 +000048void test2() {
49 F f;
50 static int sz = (char *)(&f.f) - (char *)(&f);
Mike Stump941e3f32009-11-05 05:01:19 +000051 vp = &sz;
Mike Stumpc5708d92009-08-06 14:12:47 +000052 j = sz;
Mike Stump37148f42009-08-06 14:16:19 +000053 // FIXME: These should result in a frontend constant a la fold, no run time
54 // initializer
Mike Stump599837a2009-11-06 00:18:25 +000055 // CHECK-LPLL64: define void @_Z5test2v()
56 // CHECK-LPLL64: = getelementptr inbounds %class.F* %f, i32 0, i32 1
Mike Stumpc5708d92009-08-06 14:12:47 +000057}
Mike Stump8a12b562009-08-06 15:50:11 +000058
Mike Stumpc5708d92009-08-06 14:12:47 +000059static_assert(sizeof(F) == sizeof(void*)*4, "invalid vbase size");
60
Mike Stump2effeca2009-08-06 00:38:46 +000061struct E {
62 int e;
63};
64
65static_assert (sizeof (C) == (sizeof(void *)), "vtable pointer layout");
66
Mike Stumpeb19fa92009-08-06 13:41:24 +000067class A : public E, public B, public C {
Mike Stump3dee6ef2009-07-30 00:22:38 +000068public:
Mike Stump06758d02009-08-04 20:37:29 +000069 virtual void foo1();
70 virtual void foo2();
71 A() { }
Mike Stump2effeca2009-08-06 00:38:46 +000072 int a;
73} *ap;
Mike Stump6f376332009-08-05 22:37:18 +000074void A::foo1() { }
75void A::foo2() { }
Mike Stump3dee6ef2009-07-30 00:22:38 +000076
Mike Stump06758d02009-08-04 20:37:29 +000077int main() {
78 A a;
Mike Stump26899b02009-08-05 22:48:36 +000079 B b;
Mike Stump2effeca2009-08-06 00:38:46 +000080 ap->e = 1;
81 ap->b = 2;
Mike Stump06758d02009-08-04 20:37:29 +000082}
83
Mike Stump2effeca2009-08-06 00:38:46 +000084// CHECK-LP64: main:
85// CHECK-LP64: movl $1, 12(%rax)
86// CHECK-LP64: movl $2, 8(%rax)
87
Mike Stumpf0070db2009-08-26 20:46:33 +000088struct test12_A {
89 virtual void foo0() { }
90 virtual void foo();
91} *test12_pa;
92
93struct test12_B : public test12_A {
94 virtual void foo() { }
95} *test12_pb;
96
97struct test12_D : public test12_B {
98} *test12_pd;
99void test12_foo() {
100 test12_pa->foo0();
101 test12_pb->foo0();
102 test12_pd->foo0();
103 test12_pa->foo();
104 test12_pb->foo();
105 test12_pd->foo();
106 test12_pa->test12_A::foo();
107}
108
Mike Stump599837a2009-11-06 00:18:25 +0000109// CHECK-LPLL64:define void @_Z10test12_foov() nounwind {
110// CHECK-LPLL64: call void %2(%class.test14* %tmp)
111// CHECK-LPLL64: call void %5(%class.test14* %tmp1)
112// CHECK-LPLL64: call void %8(%class.test14* %tmp3)
113// CHECK-LPLL64: call void %11(%class.test14* %tmp5)
114// CHECK-LPLL64: call void %14(%class.test14* %tmp7)
115// CHECK-LPLL64: call void %17(%class.test14* %tmp9)
116// CHECK-LPLL64: call void @_ZN8test12_A3fooEv(%class.test14* %tmp11)
Mike Stump49520942009-08-11 04:03:59 +0000117
Mike Stump941e3f32009-11-05 05:01:19 +0000118
Mike Stump94d0bce2009-08-13 00:34:14 +0000119struct test6_B2 { virtual void funcB2(); char b[1000]; };
120struct test6_B1 : virtual test6_B2 { virtual void funcB1(); };
121
122struct test6_D : test6_B2, virtual test6_B1 {
123};
124
Mike Stump94d0bce2009-08-13 00:34:14 +0000125// CHECK-LP64: .zerofill __DATA, __common, _d6, 2024, 4
126
Mike Stump78846782009-08-13 23:33:29 +0000127struct test7_B2 { virtual void funcB2(); };
128struct test7_B1 : virtual test7_B2 { virtual void funcB1(); };
129
130struct test7_D : test7_B2, virtual test7_B1 {
131};
132
Mike Stump78846782009-08-13 23:33:29 +0000133// CHECK-LP64: .zerofill __DATA, __common, _d7, 16, 3
Mike Stump94d0bce2009-08-13 00:34:14 +0000134
135
Mike Stump49520942009-08-11 04:03:59 +0000136struct test3_B3 { virtual void funcB3(); };
137struct test3_B2 : virtual test3_B3 { virtual void funcB2(); };
138struct test3_B1 : virtual test3_B2 { virtual void funcB1(); };
139
Mike Stumpf0070db2009-08-26 20:46:33 +0000140struct test3_D : virtual test3_B1 {
Mike Stump49520942009-08-11 04:03:59 +0000141 virtual void funcD() { }
142};
143
Mike Stump49520942009-08-11 04:03:59 +0000144// CHECK-LP64:__ZTV7test3_D:
Mike Stump4ec04c42009-08-16 02:40:14 +0000145// CHECK-LP64-NEXT: .space 8
146// CHECK-LP64-NEXT: .space 8
147// CHECK-LP64-NEXT: .space 8
148// CHECK-LP64-NEXT: .space 8
149// CHECK-LP64-NEXT: .space 8
150// CHECK-LP64-NEXT: .space 8
151// CHECK-LP64-NEXT: .space 8
Mike Stump666a91e2009-08-21 18:05:02 +0000152// CHECK-LP64-NEXT: .quad __ZTI7test3_D
Mike Stump4ec04c42009-08-16 02:40:14 +0000153// CHECK-LP64-NEXT: .quad __ZN8test3_B36funcB3Ev
154// CHECK-LP64-NEXT: .quad __ZN8test3_B26funcB2Ev
155// CHECK-LP64-NEXT: .quad __ZN8test3_B16funcB1Ev
156// CHECK-LP64-NEXT: .quad __ZN7test3_D5funcDEv
Mike Stump49520942009-08-11 04:03:59 +0000157
Mike Stump34fae9c2009-08-12 18:50:26 +0000158struct test4_D : virtual B, virtual C {
159};
160
Mike Stump34fae9c2009-08-12 18:50:26 +0000161// CHECK-LP64:__ZTV7test4_D:
Mike Stump4ec04c42009-08-16 02:40:14 +0000162// CHECK-LP64-NEXT: .space 8
163// CHECK-LP64-NEXT: .quad 8
164// CHECK-LP64-NEXT: .space 8
165// CHECK-LP64-NEXT: .space 8
166// CHECK-LP64-NEXT: .space 8
167// CHECK-LP64-NEXT: .quad __ZTI7test4_D
168// CHECK-LP64-NEXT: .quad __ZN1C4bee1Ev
169// CHECK-LP64-NEXT: .quad __ZN1C4bee2Ev
170// CHECK-LP64-NEXT: .space 8
171// CHECK-LP64-NEXT: .space 8
172// CHECK-LP64-NEXT: .quad 18446744073709551608
173// CHECK-LP64-NEXT: .quad __ZTI7test4_D
174// CHECK-LP64-NEXT: .quad __ZN1B4bar1Ev
175// CHECK-LP64-NEXT: .quad __ZN1B4bar2Ev
Mike Stump34fae9c2009-08-12 18:50:26 +0000176
Mike Stump49520942009-08-11 04:03:59 +0000177
Mike Stumpd76264e2009-08-12 21:50:08 +0000178struct test5_B3 { virtual void funcB3(); };
179struct test5_B2 : virtual test5_B3 { virtual void funcB2(); };
180struct test5_B1 : virtual test5_B2 { virtual void funcB1(); };
181
182struct test5_B23 { virtual void funcB23(); };
183struct test5_B22 : virtual test5_B23 { virtual void funcB22(); };
184struct test5_B21 : virtual test5_B22 { virtual void funcB21(); };
185
186
187struct B232 { virtual void funcB232(); };
188struct B231 { virtual void funcB231(); };
189
190struct test5_B33 { virtual void funcB33(); };
191struct test5_B32 : virtual test5_B33, virtual B232 { virtual void funcB32(); };
192struct test5_B31 : virtual test5_B32, virtual B231 { virtual void funcB31(); };
193
194struct test5_D : virtual test5_B1, virtual test5_B21, virtual test5_B31 {
195 virtual void funcD() { }
196};
197
Mike Stumpd76264e2009-08-12 21:50:08 +0000198// CHECK-LP64:__ZTV7test5_D:
Mike Stump4ec04c42009-08-16 02:40:14 +0000199// CHECK-LP64-NEXT: .quad 32
200// CHECK-LP64-NEXT: .quad 24
Mike Stumpfe3010d2009-08-16 19:04:13 +0000201// CHECK-LP64-NEXT: .quad 16
202// CHECK-LP64-NEXT: .quad 16
203// CHECK-LP64-NEXT: .quad 16
204// CHECK-LP64-NEXT: .quad 8
205// CHECK-LP64-NEXT: .quad 8
206// CHECK-LP64-NEXT: .quad 8
207// CHECK-LP64-NEXT: .space 8
Mike Stump4ec04c42009-08-16 02:40:14 +0000208// CHECK-LP64-NEXT: .space 8
209// CHECK-LP64-NEXT: .space 8
210// CHECK-LP64-NEXT: .space 8
211// CHECK-LP64-NEXT: .space 8
212// CHECK-LP64-NEXT: .space 8
213// CHECK-LP64-NEXT: .space 8
Mike Stumpb9837442009-08-20 07:22:17 +0000214// CHECK-LP64-NEXT: .quad __ZTI7test5_D
Mike Stump4ec04c42009-08-16 02:40:14 +0000215// CHECK-LP64-NEXT: .quad __ZN8test5_B36funcB3Ev
216// CHECK-LP64-NEXT: .quad __ZN8test5_B26funcB2Ev
217// CHECK-LP64-NEXT: .quad __ZN8test5_B16funcB1Ev
218// CHECK-LP64-NEXT: .quad __ZN7test5_D5funcDEv
Mike Stump4ec04c42009-08-16 02:40:14 +0000219// CHECK-LP64-NEXT: .space 8
220// CHECK-LP64-NEXT: .space 8
221// CHECK-LP64-NEXT: .space 8
222// CHECK-LP64-NEXT: .space 8
Mike Stump15a24e02009-08-28 23:22:54 +0000223// CHECK-LP64-NEXT: .space 8
Mike Stumpbf3fe202009-08-27 01:09:45 +0000224// CHECK-LP64-NEXT: .quad 18446744073709551608
Mike Stumpfe3010d2009-08-16 19:04:13 +0000225// CHECK-LP64-NEXT: .quad __ZTI7test5_D
Mike Stump4ec04c42009-08-16 02:40:14 +0000226// CHECK-LP64-NEXT: .quad __ZN9test5_B237funcB23Ev
227// CHECK-LP64-NEXT: .quad __ZN9test5_B227funcB22Ev
228// CHECK-LP64-NEXT: .quad __ZN9test5_B217funcB21Ev
Mike Stump74be00b2009-09-01 22:01:25 +0000229// CHECK-LP64-NEXT: .space 8
Mike Stump6a9612f2009-10-31 20:06:59 +0000230// CHECK-LP64-NEXT: .quad 16
231// CHECK-LP64-NEXT: .space 8
232// CHECK-LP64-NEXT: .space 8
233// CHECK-LP64-NEXT: .quad 8
Mike Stump4ec04c42009-08-16 02:40:14 +0000234// CHECK-LP64-NEXT: .space 8
235// CHECK-LP64-NEXT: .space 8
Mike Stump74be00b2009-09-01 22:01:25 +0000236// CHECK-LP64-NEXT: .quad 18446744073709551600
Mike Stumpfe3010d2009-08-16 19:04:13 +0000237// CHECK-LP64-NEXT: .quad __ZTI7test5_D
Mike Stump4ec04c42009-08-16 02:40:14 +0000238// CHECK-LP64-NEXT: .quad __ZN9test5_B337funcB33Ev
239// CHECK-LP64-NEXT: .quad __ZN9test5_B327funcB32Ev
240// CHECK-LP64-NEXT: .quad __ZN9test5_B317funcB31Ev
241// CHECK-LP64-NEXT: .space 8
242// CHECK-LP64-NEXT: .quad 18446744073709551592
243// CHECK-LP64-NEXT: .quad __ZTI7test5_D
244// CHECK-LP64-NEXT: .quad __ZN4B2328funcB232Ev
245// CHECK-LP64-NEXT: .space 8
Mike Stumpb9837442009-08-20 07:22:17 +0000246// CHECK-LP64-NEXT: .quad 18446744073709551584
Mike Stump4ec04c42009-08-16 02:40:14 +0000247// CHECK-LP64-NEXT: .quad __ZTI7test5_D
248// CHECK-LP64-NEXT: .quad __ZN4B2318funcB231Ev
Mike Stumpd76264e2009-08-12 21:50:08 +0000249
Mike Stump276b9f12009-08-16 01:46:26 +0000250struct test8_B1 {
251 virtual void ftest8_B1() { }
252};
253struct test8_B2aa {
254 virtual void ftest8_B2aa() { }
255 int i;
256};
257struct test8_B2ab {
258 virtual void ftest8_B2ab() { }
259 int i;
260};
261struct test8_B2a : virtual test8_B2aa, virtual test8_B2ab {
262 virtual void ftest8_B2a() { }
263};
264struct test8_B2b {
265 virtual void ftest8_B2b() { }
266};
267struct test8_B2 : test8_B2a, test8_B2b {
268 virtual void ftest8_B2() { }
269};
270struct test8_B3 {
271 virtual void ftest8_B3() { }
272};
273class test8_D : test8_B1, test8_B2, test8_B3 {
Mike Stump09765ec2009-08-19 02:53:08 +0000274};
Mike Stump276b9f12009-08-16 01:46:26 +0000275
Mike Stump276b9f12009-08-16 01:46:26 +0000276// CHECK-LP64:__ZTV7test8_D:
Mike Stump4ec04c42009-08-16 02:40:14 +0000277// CHECK-LP64-NEXT: .quad 48
278// CHECK-LP64-NEXT: .quad 32
279// CHECK-LP64-NEXT: .space 8
Mike Stumpb46c92d2009-08-19 02:06:38 +0000280// CHECK-LP64-NEXT: .quad __ZTI7test8_D
Mike Stump4ec04c42009-08-16 02:40:14 +0000281// CHECK-LP64-NEXT: .quad __ZN8test8_B19ftest8_B1Ev
282// CHECK-LP64-NEXT: .quad 40
283// CHECK-LP64-NEXT: .quad 24
Mike Stump7fa0d932009-08-20 02:11:48 +0000284// CHECK-LP64-NEXT: .quad 18446744073709551608
Mike Stump4ec04c42009-08-16 02:40:14 +0000285// CHECK-LP64-NEXT: .quad __ZTI7test8_D
286// CHECK-LP64-NEXT: .quad __ZN9test8_B2a10ftest8_B2aEv
287// CHECK-LP64-NEXT: .quad __ZN8test8_B29ftest8_B2Ev
Mike Stumpb46c92d2009-08-19 02:06:38 +0000288// CHECK-LP64-NEXT: .quad 18446744073709551600
Mike Stump4ec04c42009-08-16 02:40:14 +0000289// CHECK-LP64-NEXT: .quad __ZTI7test8_D
290// CHECK-LP64-NEXT: .quad __ZN9test8_B2b10ftest8_B2bEv
Mike Stumpb46c92d2009-08-19 02:06:38 +0000291// CHECK-LP64-NEXT: .quad 18446744073709551592
Mike Stump4ec04c42009-08-16 02:40:14 +0000292// CHECK-LP64-NEXT: .quad __ZTI7test8_D
293// CHECK-LP64-NEXT: .quad __ZN8test8_B39ftest8_B3Ev
294// CHECK-LP64-NEXT: .space 8
295// CHECK-LP64-NEXT: .quad 18446744073709551584
296// CHECK-LP64-NEXT: .quad __ZTI7test8_D
297// CHECK-LP64-NEXT: .quad __ZN10test8_B2aa11ftest8_B2aaEv
298// CHECK-LP64-NEXT: .space 8
299// CHECK-LP64-NEXT: .quad 18446744073709551568
300// CHECK-LP64-NEXT: .quad __ZTI7test8_D
301// CHECK-LP64-NEXT: .quad __ZN10test8_B2ab11ftest8_B2abEv
Mike Stumpd76264e2009-08-12 21:50:08 +0000302
Mike Stump49520942009-08-11 04:03:59 +0000303
Mike Stump09765ec2009-08-19 02:53:08 +0000304struct test9_B3 { virtual void funcB3(); int i; };
305struct test9_B2 : virtual test9_B3 { virtual void funcB2(); int i; };
306struct test9_B1 : virtual test9_B2 { virtual void funcB1(); int i; };
307
308struct test9_B23 { virtual void funcB23(); int i; };
309struct test9_B22 : virtual test9_B23 { virtual void funcB22(); int i; };
310struct test9_B21 : virtual test9_B22 { virtual void funcB21(); int i; };
311
312
313struct test9_B232 { virtual void funcB232(); int i; };
314struct test9_B231 { virtual void funcB231(); int i; };
315
316struct test9_B33 { virtual void funcB33(); int i; };
317struct test9_B32 : virtual test9_B33, virtual test9_B232 { virtual void funcB32(); int i; };
318struct test9_B31 : virtual test9_B32, virtual test9_B231 { virtual void funcB31(); int i; };
319
320struct test9_D : virtual test9_B1, virtual test9_B21, virtual test9_B31 {
321 virtual void funcD() { }
322};
323
324// CHECK-LP64: __ZTV7test9_D:
325// CHECK-LP64-NEXT: .quad 168
326// CHECK-LP64-NEXT: .quad 152
327// CHECK-LP64-NEXT: .quad 136
328// CHECK-LP64-NEXT: .quad 120
329// CHECK-LP64-NEXT: .quad 104
330// CHECK-LP64-NEXT: .quad 88
331// CHECK-LP64-NEXT: .quad 72
332// CHECK-LP64-NEXT: .quad 56
333// CHECK-LP64-NEXT: .quad 40
334// CHECK-LP64-NEXT: .quad 24
335// CHECK-LP64-NEXT: .quad 8
336// CHECK-LP64-NEXT: .space 8
337// CHECK-LP64-NEXT: .quad __ZTI7test9_D
338// CHECK-LP64-NEXT: .quad __ZN7test9_D5funcDEv
339// CHECK-LP64-NEXT: .space 8
340// CHECK-LP64-NEXT: .quad 32
341// CHECK-LP64-NEXT: .quad 16
342// CHECK-LP64-NEXT: .quad 18446744073709551608
343// CHECK-LP64-NEXT: .quad __ZTI7test9_D
344// CHECK-LP64-NEXT: .quad __ZN8test9_B16funcB1Ev
345// CHECK-LP64-NEXT: .space 8
346// CHECK-LP64-NEXT: .quad 16
347// CHECK-LP64-NEXT: .quad 18446744073709551592
348// CHECK-LP64-NEXT: .quad __ZTI7test9_D
349// CHECK-LP64-NEXT: .quad __ZN8test9_B26funcB2Ev
350// CHECK-LP64-NEXT: .space 8
351// CHECK-LP64-NEXT: .quad 18446744073709551576
352// CHECK-LP64-NEXT: .quad __ZTI7test9_D
353// CHECK-LP64-NEXT: .quad __ZN8test9_B36funcB3Ev
354// CHECK-LP64-NEXT: .space 8
355// CHECK-LP64-NEXT: .quad 32
356// CHECK-LP64-NEXT: .quad 16
357// CHECK-LP64-NEXT: .quad 18446744073709551560
358// CHECK-LP64-NEXT: .quad __ZTI7test9_D
359// CHECK-LP64-NEXT: .quad __ZN9test9_B217funcB21Ev
360// CHECK-LP64-NEXT: .space 8
361// CHECK-LP64-NEXT: .quad 16
362// CHECK-LP64-NEXT: .quad 18446744073709551544
363// CHECK-LP64-NEXT: .quad __ZTI7test9_D
364// CHECK-LP64-NEXT: .quad __ZN9test9_B227funcB22Ev
365// CHECK-LP64-NEXT: .space 8
366// CHECK-LP64-NEXT: .quad 18446744073709551528
367// CHECK-LP64-NEXT: .quad __ZTI7test9_D
368// CHECK-LP64-NEXT: .quad __ZN9test9_B237funcB23Ev
369// CHECK-LP64-NEXT: .space 8
370// CHECK-LP64-NEXT: .quad 64
371// CHECK-LP64-NEXT: .quad 48
372// CHECK-LP64-NEXT: .quad 32
373// CHECK-LP64-NEXT: .quad 16
374// CHECK-LP64-NEXT: .quad 18446744073709551512
375// CHECK-LP64-NEXT: .quad __ZTI7test9_D
376// CHECK-LP64-NEXT: .quad __ZN9test9_B317funcB31Ev
377// CHECK-LP64-NEXT: .space 8
378// CHECK-LP64-NEXT: .quad 32
379// CHECK-LP64-NEXT: .quad 16
380// CHECK-LP64-NEXT: .quad 18446744073709551496
381// CHECK-LP64-NEXT: .quad __ZTI7test9_D
382// CHECK-LP64-NEXT: .quad __ZN9test9_B327funcB32Ev
383// CHECK-LP64-NEXT: .space 8
384// CHECK-LP64-NEXT: .quad 18446744073709551480
385// CHECK-LP64-NEXT: .quad __ZTI7test9_D
386// CHECK-LP64-NEXT: .quad __ZN9test9_B337funcB33Ev
387// CHECK-LP64-NEXT: .space 8
388// CHECK-LP64-NEXT: .quad 18446744073709551464
389// CHECK-LP64-NEXT: .quad __ZTI7test9_D
390// CHECK-LP64-NEXT: .quad __ZN10test9_B2328funcB232Ev
391// CHECK-LP64-NEXT: .space 8
392// CHECK-LP64-NEXT: .quad 18446744073709551448
393// CHECK-LP64-NEXT: .quad __ZTI7test9_D
394// CHECK-LP64-NEXT: .quad __ZN10test9_B2318funcB231Ev
395
Mike Stump09765ec2009-08-19 02:53:08 +0000396
Mike Stumpb9837442009-08-20 07:22:17 +0000397struct test10_O { int i; };
398
399struct test10_B1 : virtual test10_O {
400 virtual void ftest10_B1() { }
401};
402
403struct test10_B2aa : virtual test10_O {
404 int i;
405};
406struct test10_B2ab : virtual test10_O {
407 int i;
408};
409struct test10_B2a : virtual test10_B2aa, virtual test10_B2ab,virtual test10_O {
410 virtual void ftest10_B2a() { }
411};
412struct test10_B2b : virtual test10_O {
413 virtual void ftest10_B2b() { }
414};
415struct test10_B2 : test10_B2a {
416 virtual void ftest10_B2() { }
417};
418class test10_D : test10_B1, test10_B2 {
419
420 void ftest10_B2aa() { }
421};
422
423// CHECK-LP64:__ZTV8test10_D:
424// CHECK-LP64-NEXT: .quad 40
425// CHECK-LP64-NEXT: .quad 24
426// CHECK-LP64-NEXT: .quad 16
427// CHECK-LP64-NEXT: .space 8
428// CHECK-LP64-NEXT: .quad __ZTI8test10_D
429// CHECK-LP64-NEXT: .quad __ZN9test10_B110ftest10_B1Ev
430// CHECK-LP64-NEXT: .quad 32
431// CHECK-LP64-NEXT: .quad 8
432// CHECK-LP64-NEXT: .quad 16
433// CHECK-LP64-NEXT: .quad 18446744073709551608
434// CHECK-LP64-NEXT: .quad __ZTI8test10_D
435// CHECK-LP64-NEXT: .quad __ZN10test10_B2a11ftest10_B2aEv
436// CHECK-LP64-NEXT: .quad __ZN9test10_B210ftest10_B2Ev
437// CHECK-LP64-NEXT: .quad 18446744073709551608
438// CHECK-LP64-NEXT: .quad 18446744073709551592
439// CHECK-LP64-NEXT: .quad __ZTI8test10_D
440// CHECK-LP64-NEXT: .quad 18446744073709551592
441// CHECK-LP64-NEXT: .quad 18446744073709551576
442// CHECK-LP64-NEXT: .quad __ZTI8test10_D
443
Mike Stumpb9837442009-08-20 07:22:17 +0000444
Mike Stumpb9871a22009-08-21 01:45:00 +0000445struct test11_B {
446 virtual void B1() { }
447 virtual void D() { }
448 virtual void B2() { }
449};
450
451struct test11_D : test11_B {
452 virtual void D1() { }
453 virtual void D() { }
454 virtual void D2() { }
455};
456
Mike Stumpb9871a22009-08-21 01:45:00 +0000457// CHECK-LP64:__ZTV8test11_D:
458// CHECK-LP64-NEXT: .space 8
459// CHECK-LP64-NEXT: .quad __ZTI8test11_D
460// CHECK-LP64-NEXT: .quad __ZN8test11_B2B1Ev
461// CHECK-LP64-NEXT: .quad __ZN8test11_D1DEv
462// CHECK-LP64-NEXT: .quad __ZN8test11_B2B2Ev
463// CHECK-LP64-NEXT: .quad __ZN8test11_D2D1Ev
464// CHECK-LP64-NEXT: .quad __ZN8test11_D2D2Ev
Mike Stumpb9837442009-08-20 07:22:17 +0000465
Mike Stumpdec025b2009-09-07 04:27:52 +0000466struct test13_B {
467 virtual void B1() { }
468 virtual void D() { }
469 virtual void Da();
470 virtual void Db() { }
471 virtual void Dc() { }
472 virtual void B2() { }
473 int i;
474};
475
476
477struct test13_NV1 {
478 virtual void fooNV1() { }
479 virtual void D() { }
480};
481
482
483struct test13_B2 : /* test13_NV1, */ virtual test13_B {
484 virtual void B2a() { }
485 virtual void B2() { }
486 virtual void D() { }
487 virtual void Da();
488 virtual void Dd() { }
489 virtual void B2b() { }
490 int i;
491};
492
493
494struct test13_D : test13_NV1, virtual test13_B2 {
495 virtual void D1() { }
496 virtual void D() { }
497 virtual void Db() { }
498 virtual void Dd() { }
499 virtual void D2() { }
500 virtual void fooNV1() { }
Mike Stumpd9878a12009-10-13 10:55:21 +0000501};
Mike Stumpdec025b2009-09-07 04:27:52 +0000502
503// CHECK-LP64:__ZTV8test13_D:
504// CHECK-LP64-NEXT: .quad 24
505// CHECK-LP64-NEXT: .quad 8
506// CHECK-LP64-NEXT: .space 8
507// CHECK-LP64-NEXT: .quad __ZTI8test13_D
508// CHECK-LP64-NEXT: .quad __ZN8test13_D6fooNV1Ev
509// CHECK-LP64-NEXT: .quad __ZN8test13_D1DEv
510// CHECK-LP64-NEXT: .quad __ZN8test13_D2D1Ev
511// CHECK-LP64-NEXT: .quad __ZN8test13_D2DbEv
512// CHECK-LP64-NEXT: .quad __ZN8test13_D2DdEv
513// CHECK-LP64-NEXT: .quad __ZN8test13_D2D2Ev
514// CHECK-LP64-NEXT: .space 8
515// CHECK-LP64-NEXT: .quad 18446744073709551608
516// CHECK-LP64-NEXT: .space 8
517// CHECK-LP64-NEXT: .quad 18446744073709551608
518// CHECK-LP64-NEXT: .space 8
519// CHECK-LP64-NEXT: .space 8
520// CHECK-LP64-NEXT: .quad 16
521// CHECK-LP64-NEXT: .quad 18446744073709551608
522// CHECK-LP64-NEXT: .quad __ZTI8test13_D
523// CHECK-LP64-NEXT: .quad __ZN9test13_B23B2aEv
524// CHECK-LP64-NEXT: .quad __ZN9test13_B22B2Ev
525// CHECK-LP64-NEXT: .quad __ZTv0_n48_N8test13_D1DEv
526// CHECK-LP64-NEXT: .quad __ZN9test13_B22DaEv
527// CHECK-LP64-NEXT: .quad __ZTv0_n64_N8test13_D2DdEv
528// CHECK-LP64-NEXT: .quad __ZN9test13_B23B2bEv
529// CHECK-LP64-NEXT: .quad 18446744073709551600
530// CHECK-LP64-NEXT: .space 8
531// CHECK-LP64-NEXT: .quad 18446744073709551592
532// CHECK-LP64-NEXT: .quad 18446744073709551600
533// CHECK-LP64-NEXT: .quad 18446744073709551592
534// CHECK-LP64-NEXT: .space 8
535// CHECK-LP64-NEXT: .quad 18446744073709551592
536// CHECK-LP64-NEXT: .quad __ZTI8test13_D
537// CHECK-LP64-NEXT: .quad __ZN8test13_B2B1Ev
538// CHECK-LP64-NEXT: .quad __ZTv0_n32_N8test13_D1DEv
539// CHECK-LP64-NEXT: .quad __ZTv0_n40_N9test13_B22DaEv
540// CHECK-LP64-NEXT: .quad __ZTv0_n48_N8test13_D2DbEv
541// CHECK-LP64-NEXT: .quad __ZN8test13_B2DcEv
542// CHECK-LP64-NEXT: .quad __ZTv0_n64_N9test13_B22B2Ev
543
Mike Stump09765ec2009-08-19 02:53:08 +0000544
Mike Stumpd9878a12009-10-13 10:55:21 +0000545class test14 {
546public:
547 virtual void initWithInt(int a);
548 static test14 *withInt(int a);
549};
550
551void test14::initWithInt(int a) { }
552
553test14 *test14::withInt(int a) {
554 test14 *me = new test14;
555 me->initWithInt(a);
556 return me;
557}
558
559
560struct test15_B {
561 virtual test15_B *foo1() { return 0; }
562 virtual test15_B *foo2() { return 0; }
563 virtual test15_B *foo3() { return 0; }
564 int i;
565};
566
567struct test15_NV1 {
568 virtual void fooNV1() { }
569 int i;
570};
571
572struct test15_B2 : test15_NV1, virtual test15_B {
573 virtual test15_B2 *foo1() { return 0; }
574 virtual test15_B2 *foo2() { return 0; }
575 int i;
576};
577
578struct test15_D : test15_NV1, virtual test15_B2 {
579 virtual test15_D *foo1() { return 0; }
580};
581
582// CHECK-LP64:__ZTV8test15_D:
583// CHECK-LP64-NEXT: .quad 32
584// CHECK-LP64-NEXT: .quad 16
585// CHECK-LP64-NEXT: .space 8
586// CHECK-LP64-NEXT: .quad __ZTI8test15_D
587// CHECK-LP64-NEXT: .quad __ZN10test15_NV16fooNV1Ev
588// CHECK-LP64-NEXT: .quad __ZN8test15_D4foo1Ev
589// CHECK-LP64-NEXT: .space 8
590// CHECK-LP64-NEXT: .quad 18446744073709551600
591// CHECK-LP64-NEXT: .space 8
592// CHECK-LP64-NEXT: .quad 16
593// CHECK-LP64-NEXT: .quad 18446744073709551600
594// CHECK-LP64-NEXT: .quad __ZTI8test15_D
595// CHECK-LP64-NEXT: .quad __ZN10test15_NV16fooNV1Ev
596// CHECK-LP64-NEXT: .quad __ZTcv0_n40_v0_n24_N8test15_D4foo1Ev
597// CHECK-LP64-NEXT: .quad __ZN9test15_B24foo2Ev
598// CHECK-LP64-NEXT: .space 8
599// CHECK-LP64-NEXT: .quad 18446744073709551600
600// CHECK-LP64-NEXT: .quad 18446744073709551584
601// CHECK-LP64-NEXT: .quad 18446744073709551584
602// CHECK-LP64-NEXT: .quad __ZTI8test15_D
603// CHECK-LP64-NEXT: .quad __ZTcv0_n24_v0_n32_N8test15_D4foo1Ev
604// CHECK-LP64-NEXT: .quad __ZTcv0_n32_v0_n24_N9test15_B24foo2Ev
605// CHECK-LP64-NEXT: .quad __ZN8test15_B4foo3Ev
606
Mike Stumpd9878a12009-10-13 10:55:21 +0000607
Mike Stump54150d92009-10-14 18:38:01 +0000608struct test16_NV1 {
609 virtual void fooNV1() { }
610virtual void foo_NV1() { }
611 int i;
612};
613
614struct test16_NV2 {
615 virtual test16_NV2* foo1() { return 0; }
616virtual void foo_NV2() { }
617virtual void foo_NV2b() { }
618 int i;
619};
620
621struct test16_B : public test16_NV1, test16_NV2 {
622 virtual test16_B *foo1() { return 0; }
623 virtual test16_B *foo2() { return 0; }
624 virtual test16_B *foo3() { return 0; }
625virtual void foo_B() { }
626 int i;
627};
628
629struct test16_B2 : test16_NV1, virtual test16_B {
630 virtual test16_B2 *foo1() { return 0; }
631 virtual test16_B2 *foo2() { return 0; }
632virtual void foo_B2() { }
633 int i;
634};
635
636struct test16_D : test16_NV1, virtual test16_B2 {
Mike Stump941e3f32009-11-05 05:01:19 +0000637 virtual void bar();
638 virtual test16_D *foo1();
Mike Stump54150d92009-10-14 18:38:01 +0000639};
640
Mike Stump941e3f32009-11-05 05:01:19 +0000641void test16_D::bar() { }
642
Mike Stump54150d92009-10-14 18:38:01 +0000643// CHECK-LP64: __ZTV8test16_D:
644// CHECK-LP64-NEXT: .quad 32
645// CHECK-LP64-NEXT: .quad 16
646// CHECK-LP64-NEXT: .space 8
647// CHECK-LP64-NEXT: .quad __ZTI8test16_D
648// CHECK-LP64-NEXT: .quad __ZN10test16_NV16fooNV1Ev
649// CHECK-LP64-NEXT: .quad __ZN10test16_NV17foo_NV1Ev
Mike Stump941e3f32009-11-05 05:01:19 +0000650// CHECK-LP64-NEXT: .quad __ZN8test16_D3barEv
Mike Stump54150d92009-10-14 18:38:01 +0000651// CHECK-LP64-NEXT: .quad __ZN8test16_D4foo1Ev
652// CHECK-LP64-NEXT: .space 8
653// CHECK-LP64-NEXT: .space 8
654// CHECK-LP64-NEXT: .quad 18446744073709551600
655// CHECK-LP64-NEXT: .space 8
656// CHECK-LP64-NEXT: .space 8
657// CHECK-LP64-NEXT: .quad 16
658// CHECK-LP64-NEXT: .quad 18446744073709551600
659// CHECK-LP64-NEXT: .quad __ZTI8test16_D
660// CHECK-LP64-NEXT: .quad __ZN10test16_NV16fooNV1Ev
661// CHECK-LP64-NEXT: .quad __ZN10test16_NV17foo_NV1Ev
662// CHECK-LP64-NEXT: .quad __ZTcv0_n48_v0_n24_N8test16_D4foo1Ev
663// CHECK-LP64-NEXT: .quad __ZN9test16_B24foo2Ev
664// CHECK-LP64-NEXT: .quad __ZN9test16_B26foo_B2Ev
665// CHECK-LP64-NEXT .quad 16
666// CHECK-LP64-NEXT .quad 16
667// CHECK-LP64-NEXT: .space 8
668// CHECK-LP64-NEXT: .space 8
669// CHECK-LP64: .quad 18446744073709551600
670// CHECK-LP64: .quad 18446744073709551584
671// CHECK-LP64-NEXT: .space 8
672// CHECK-LP64-NEXT: .space 8
673// CHECK-LP64-NEXT: .quad 18446744073709551584
674// CHECK-LP64-NEXT: .quad __ZTI8test16_D
675// CHECK-LP64-NEXT: .quad __ZN10test16_NV16fooNV1Ev
676// CHECK-LP64-NEXT: .quad __ZN10test16_NV17foo_NV1Ev
677// CHECK-LP64-NEXT: .quad __ZTcv0_n40_v0_n32_N8test16_D4foo1Ev
678// CHECK-LP64-NEXT: .quad __ZTcv0_n48_v0_n24_N9test16_B24foo2Ev
679// CHECK-LP64-NEXT: .quad __ZN8test16_B4foo3Ev
680// CHECK-LP64-NEXT: .quad __ZN8test16_B5foo_BEv
681// CHECK-LP64-NEXT: .quad 18446744073709551568
682// CHECK-LP64-NEXT: .quad __ZTI8test16_D
683// CHECK-LP64-NEXT .quad __ZTcvn16_n40_v16_n32_N8test16_D4foo1Ev
684// CHECK-LP64: .quad __ZN10test16_NV27foo_NV2Ev
685// CHECK-LP64-NEXT: .quad __ZN10test16_NV28foo_NV2bEv
686
Mike Stumpd9878a12009-10-13 10:55:21 +0000687
Mike Stump941e3f32009-11-05 05:01:19 +0000688// FIXME: This is the wrong thunk, but until these issues are fixed, better
689// than nothing.
Mike Stump599837a2009-11-06 00:18:25 +0000690// CHECK-LPLL64:define weak %class.test8_D* @_ZTcvn16_n72_v16_n32_N8test16_D4foo1Ev(%class.test8_D*) {
691// CHECK-LPLL64:entry:
692// CHECK-LPLL64: %retval = alloca %class.test8_D*
693// CHECK-LPLL64: %.addr = alloca %class.test8_D*
694// CHECK-LPLL64: store %class.test8_D* %0, %class.test8_D** %.addr
695// CHECK-LPLL64: %this = load %class.test8_D** %.addr
696// CHECK-LPLL64: %1 = bitcast %class.test8_D* %this to i8*
697// CHECK-LPLL64: %2 = getelementptr inbounds i8* %1, i64 -16
698// CHECK-LPLL64: %3 = bitcast i8* %2 to %class.test8_D*
699// CHECK-LPLL64: %4 = bitcast %class.test8_D* %3 to i8*
700// CHECK-LPLL64: %5 = bitcast %class.test8_D* %3 to i64**
701// CHECK-LPLL64: %vtable = load i64** %5
702// CHECK-LPLL64: %6 = getelementptr inbounds i64* %vtable, i64 -9
703// CHECK-LPLL64: %7 = load i64* %6
704// CHECK-LPLL64: %8 = getelementptr i8* %4, i64 %7
705// CHECK-LPLL64: %9 = bitcast i8* %8 to %class.test8_D*
706// CHECK-LPLL64: %call = call %class.test8_D* @_ZTch0_v16_n32_N8test16_D4foo1Ev(%class.test8_D* %9)
707// CHECK-LPLL64: store %class.test8_D* %call, %class.test8_D** %retval
708// CHECK-LPLL64: %10 = load %class.test8_D** %retval
709// CHECK-LPLL64: ret %class.test8_D* %10
710// CHECK-LPLL64:}
Mike Stump941e3f32009-11-05 05:01:19 +0000711
Mike Stump599837a2009-11-06 00:18:25 +0000712// CHECK-LPLL64:define weak %class.test8_D* @_ZTch0_v16_n32_N8test16_D4foo1Ev36(%class.test8_D*) {
713// CHECK-LPLL64:entry:
714// CHECK-LPLL64: %retval = alloca %class.test8_D*
715// CHECK-LPLL64: %.addr = alloca %class.test8_D*
716// CHECK-LPLL64: store %class.test8_D* %0, %class.test8_D** %.addr
717// CHECK-LPLL64: %this = load %class.test8_D** %.addr
718// CHECK-LPLL64: %call = call %class.test8_D* @_ZN8test16_D4foo1Ev(%class.test8_D* %this)
719// CHECK-LPLL64: %1 = icmp ne %class.test8_D* %call, null
720// CHECK-LPLL64: br i1 %1, label %2, label %12
721// CHECK-LPLL64:; <label>:2
722// CHECK-LPLL64: %3 = bitcast %class.test8_D* %call to i8*
723// CHECK-LPLL64: %4 = getelementptr inbounds i8* %3, i64 16
724// CHECK-LPLL64: %5 = bitcast i8* %4 to %class.test8_D*
725// CHECK-LPLL64: %6 = bitcast %class.test8_D* %5 to i8*
726// CHECK-LPLL64: %7 = bitcast %class.test8_D* %5 to i64**
727// CHECK-LPLL64: %vtable = load i64** %7
728// CHECK-LPLL64: %8 = getelementptr inbounds i64* %vtable, i64 -4
729// CHECK-LPLL64: %9 = load i64* %8
730// CHECK-LPLL64: %10 = getelementptr i8* %6, i64 %9
731// CHECK-LPLL64: %11 = bitcast i8* %10 to %class.test8_D*
732// CHECK-LPLL64: br label %13
733// CHECK-LPLL64:; <label>:12
734// CHECK-LPLL64: br label %13
735// CHECK-LPLL64:; <label>:13
736// CHECK-LPLL64: %14 = phi %class.test8_D* [ %11, %2 ], [ %call, %12 ]
737// CHECK-LPLL64: store %class.test8_D* %14, %class.test8_D** %retval
738// CHECK-LPLL64: %15 = load %class.test8_D** %retval
739// CHECK-LPLL64: ret %class.test8_D* %15
740// CHECK-LPLL64:}
Mike Stump941e3f32009-11-05 05:01:19 +0000741
742
Mike Stump7809e0d2009-10-28 00:35:46 +0000743class test17_B1 {
744 virtual void foo() = 0;
745 virtual void bar() { }
746};
747
748class test17_B2 : public test17_B1 {
749 void foo() { }
750 virtual void bar() = 0;
751};
752
753class test17_D : public test17_B2 {
754 void bar() { }
Mike Stump62db2452009-11-03 19:28:52 +0000755};
Mike Stump7809e0d2009-10-28 00:35:46 +0000756
757
758// CHECK-LP64:__ZTV8test17_D:
759// CHECK-LP64-NEXT: .space 8
760// CHECK-LP64-NEXT: .quad __ZTI8test17_D
761// CHECK-LP64-NEXT: .quad __ZN9test17_B23fooEv
762// CHECK-LP64-NEXT: .quad __ZN8test17_D3barEv
763
764// CHECK-LP64:__ZTV9test17_B2:
765// CHECK-LP64-NEXT: .space 8
766// CHECK-LP64-NEXT: .quad __ZTI9test17_B2
767// CHECK-LP64-NEXT: .quad __ZN9test17_B23fooEv
768// CHECK-LP64-NEXT: .quad ___cxa_pure_virtual
769
770// CHECK-LP64:__ZTV9test17_B1:
771// CHECK-LP64-NEXT: .space 8
772// CHECK-LP64-NEXT: .quad __ZTI9test17_B1
773// CHECK-LP64-NEXT: .quad ___cxa_pure_virtual
774// CHECK-LP64-NEXT: .quad __ZN9test17_B13barEv
775
776
Mike Stump9c212892009-11-03 19:03:17 +0000777struct test18_NV1 {
778 virtual void fooNV1() { }
779virtual void foo_NV1() { }
780 int i;
781};
782
783struct test18_NV2 {
784 virtual test18_NV2& foo1() { return *this; }
785virtual void foo_NV2() { }
786virtual void foo_NV2b() { }
787 int i;
788};
789
790struct test18_B : public test18_NV1, test18_NV2 {
791 virtual test18_B& foo1() { return *this; }
792 virtual test18_B *foo2() { return 0; }
793 virtual test18_B *foo3() { return 0; }
794virtual void foo_B() { }
795 int i;
796};
797
798struct test18_B2 : test18_NV1, virtual test18_B {
799 virtual test18_B2& foo1() { return *this; }
800 virtual test18_B2 *foo2() { return 0; }
801virtual void foo_B2() { }
802 int i;
803};
804
805struct test18_D : test18_NV1, virtual test18_B2 {
806 virtual test18_D& foo1() { return *this; }
Mike Stump62db2452009-11-03 19:28:52 +0000807};
808
809
810struct test19_VB1 { };
811struct test19_B1 : public virtual test19_VB1 {
812 virtual void fB1() { }
813 virtual void foB1B2() { }
814 virtual void foB1B3() { }
815 virtual void foB1B4() { }
816};
817
818struct test19_VB2 { };
819struct test19_B2: public test19_B1, public virtual test19_VB2 {
820 virtual void foB1B2() { }
821 virtual void foB1B3() { }
822 virtual void foB1B4() { }
823
824 virtual void fB2() { }
825 virtual void foB2B3() { }
826 virtual void foB2B4() { }
827};
828
829struct test19_VB3 { };
830struct test19_B3: virtual public test19_B2, public virtual test19_VB3 {
831 virtual void foB1B3() { }
832 virtual void foB1B4() { }
833
834 virtual void foB2B3() { }
835 virtual void foB2B4() { }
836
837 virtual void fB3() { }
838 virtual void foB3B4() { }
839};
840
841struct test19_VB4 { };
842struct test19_B4: public test19_B3, public virtual test19_VB4 {
843 virtual void foB1B4() { }
844
845 virtual void foB2B4() { }
846
847 virtual void foB3B4() { }
848
849 virtual void fB4() { }
850};
851
852struct test19_D : virtual test19_B4 {
853};
854
855
856// CHECK-LP64: __ZTV8test19_D:
857// CHECK-LP64-NEXT: .space 8
858// CHECK-LP64-NEXT: .space 8
859// CHECK-LP64-NEXT: .space 8
860// CHECK-LP64-NEXT: .space 8
861// CHECK-LP64-NEXT: .space 8
862// CHECK-LP64-NEXT: .space 8
863// CHECK-LP64-NEXT: .space 8
864// CHECK-LP64-NEXT: .space 8
865// CHECK-LP64-NEXT: .space 8
866// CHECK-LP64-NEXT: .space 8
867// CHECK-LP64-NEXT: .space 8
868// CHECK-LP64-NEXT: .space 8
869// CHECK-LP64-NEXT: .space 8
870// CHECK-LP64-NEXT: .space 8
871// CHECK-LP64-NEXT: .space 8
872// CHECK-LP64-NEXT: .space 8
873// CHECK-LP64-NEXT: .space 8
874// CHECK-LP64-NEXT: .quad __ZTI8test19_D
875// CHECK-LP64-NEXT .quad __ZN9test19_B13fB1Ev
876// CHECK-LP64-NEXT .quad __ZN9test19_B26foB1B2Ev
877// CHECK-LP64-NEXT .quad __ZN9test19_B36foB1B3Ev
878// CHECK-LP64-NEXT .quad __ZN9test19_B46foB1B4Ev
879// CHECK-LP64-NEXT .quad __ZN9test19_B23fB2Ev
880// CHECK-LP64-NEXT .quad __ZN9test19_B36foB2B3Ev
881// CHECK-LP64-NEXT .quad __ZN9test19_B46foB2B4Ev
882// CHECK-LP64-NEXT .quad __ZN9test19_B33fB3Ev
883// CHECK-LP64-NEXT .quad __ZN9test19_B46foB3B4Ev
884// CHECK-LP64-NEXT .quad __ZN9test19_B43fB4Ev
885
Mike Stump9c212892009-11-03 19:03:17 +0000886
Mike Stump99faefd2009-11-05 05:26:28 +0000887class test20_V {
888 virtual void foo1();
889};
890class test20_V1 {
891 virtual void foo2();
892};
893class test20_B : virtual test20_V {
894} b;
895class test20_B1 : virtual test20_V1 {
896};
897class test20_D : public test20_B, public test20_B1 {
898} d;
899
900// CHECK-LP64: __ZTV8test20_D:
901// CHECK-LP64-NEXT: .quad 8
902// CHECK-LP64-NEXT: .space 8
903// CHECK-LP64-NEXT: .space 8
904// CHECK-LP64-NEXT: .space 8
905// CHECK-LP64-NEXT: .quad __ZTI8test20_D
906// CHECK-LP64-NEXT: .quad __ZN8test20_V4foo1Ev
907// CHECK-LP64-NEXT: .space 8
908// CHECK-LP64-NEXT: .space 8
909// CHECK-LP64-NEXT: .quad 18446744073709551608
910// CHECK-LP64-NEXT: .quad __ZTI8test20_D
911// CHECK-LP64-NEXT: .quad __ZN9test20_V14foo2Ev
912
913
Mike Stump7809e0d2009-10-28 00:35:46 +0000914
Mike Stump26899b02009-08-05 22:48:36 +0000915// CHECK-LP64: __ZTV1B:
Mike Stumpb46c92d2009-08-19 02:06:38 +0000916// CHECK-LP64-NEXT: .space 8
917// CHECK-LP64-NEXT: .quad __ZTI1B
Mike Stump4ec04c42009-08-16 02:40:14 +0000918// CHECK-LP64-NEXT: .quad __ZN1B4bar1Ev
919// CHECK-LP64-NEXT: .quad __ZN1B4bar2Ev
Mike Stump26899b02009-08-05 22:48:36 +0000920
Mike Stump06758d02009-08-04 20:37:29 +0000921// CHECK-LP64: __ZTV1A:
Mike Stump4ec04c42009-08-16 02:40:14 +0000922// CHECK-LP64-NEXT: .space 8
Mike Stumpb46c92d2009-08-19 02:06:38 +0000923// CHECK-LP64-NEXT: .quad __ZTI1A
Mike Stump4ec04c42009-08-16 02:40:14 +0000924// CHECK-LP64-NEXT: .quad __ZN1B4bar1Ev
925// CHECK-LP64-NEXT: .quad __ZN1B4bar2Ev
926// CHECK-LP64-NEXT: .quad __ZN1A4foo1Ev
927// CHECK-LP64-NEXT: .quad __ZN1A4foo2Ev
Mike Stumpb46c92d2009-08-19 02:06:38 +0000928// CHECK-LP64-NEXT: .quad 18446744073709551600
Mike Stump4ec04c42009-08-16 02:40:14 +0000929// CHECK-LP64-NEXT: .quad __ZTI1A
930// CHECK-LP64-NEXT: .quad __ZN1C4bee1Ev
931// CHECK-LP64-NEXT: .quad __ZN1C4bee2Ev
Mike Stump06758d02009-08-04 20:37:29 +0000932
Mike Stump8a12b562009-08-06 15:50:11 +0000933// CHECK-LP64: __ZTV1F:
Mike Stump4ec04c42009-08-16 02:40:14 +0000934// CHECK-LP64-NEXT: .space 8
935// CHECK-LP64-NEXT: .quad 16
936// CHECK-LP64-NEXT: .space 8
937// CHECK-LP64-NEXT: .space 8
Mike Stumpb46c92d2009-08-19 02:06:38 +0000938// CHECK-LP64-NEXT: .quad __ZTI1F
Mike Stump4ec04c42009-08-16 02:40:14 +0000939// CHECK-LP64-NEXT: .quad __ZN1D3booEv
940// CHECK-LP64-NEXT: .quad __ZN1F3fooEv
941// CHECK-LP64-NEXT: .space 8
942// CHECK-LP64-NEXT: .space 8
943// CHECK-LP64-NEXT: .space 8
944// CHECK-LP64-NEXT: .space 8
945// CHECK-LP64-NEXT: .space 8
946// CHECK-LP64-NEXT: .quad 18446744073709551600
947// CHECK-LP64-NEXT: .quad __ZTI1F
948// CHECK-LP64-NEXT: .quad __ZN2D13barEv
949// CHECK-LP64-NEXT: .quad __ZN2D14bar2Ev
950// CHECK-LP64-NEXT: .quad __ZN2D14bar3Ev
951// CHECK-LP64-NEXT: .quad __ZN2D14bar4Ev
952// CHECK-LP64-NEXT: .quad __ZN2D14bar5Ev
Mike Stump49520942009-08-11 04:03:59 +0000953
Mike Stump62db2452009-11-03 19:28:52 +0000954test19_D d19;
955test18_D d18;
956test17_D d17;
Mike Stump54150d92009-10-14 18:38:01 +0000957test16_D d16;
Mike Stumpd9878a12009-10-13 10:55:21 +0000958test15_D d15;
959test13_D d13;
Mike Stumpb9871a22009-08-21 01:45:00 +0000960test11_D d11;
Mike Stumpb9837442009-08-20 07:22:17 +0000961test10_D d10;
Mike Stump09765ec2009-08-19 02:53:08 +0000962test9_D d9;
963test8_D d8;
964
Mike Stumpd76264e2009-08-12 21:50:08 +0000965test5_D d5;
Mike Stump34fae9c2009-08-12 18:50:26 +0000966test4_D d4;
967test3_D d3;
Mike Stump78846782009-08-13 23:33:29 +0000968
969test6_D d6;
970test7_D d7;