1 // RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fms-extensions -fdump-record-layouts -fsyntax-only %s 2>/dev/null \
2 // RUN: | FileCheck %s
3 // RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fms-extensions -fdump-record-layouts -fsyntax-only %s 2>/dev/null \
4 // RUN: | FileCheck %s -check-prefix CHECK-X64
5
6 extern "C" int printf(const char *fmt, ...);
7
8 struct B0 {
9 int a;
B0B010 B0() : a(0xf00000B0) {}
11 };
12 struct __declspec(align(16)) B1 {
13 int a;
B1B114 B1() : a(0xf00000B1) {}
15 };
16 struct B2 {
17 __declspec(align(16)) int a;
B2B218 B2() : a(0xf00000B2) {}
19 };
20 struct __declspec(align(16)) B3 {
21 long long a1;
22 int a;
B3B323 B3() : a(0xf00000B3), a1(0xf00000B3f00000B3ll) {}
24 };
25 struct V {
26 char a;
VV27 V() : a(0X11) {}
28 };
29 struct __declspec(align(32)) A16 {};
fV130 struct V1 : A16 { virtual void f() {} };
31 struct V2 {
32 long long a;
33 int a1;
V2V234 V2() : a(0xf0000011f0000011ll), a1(0xf0000011) {}
35 };
36 struct V3 {
37 int a;
V3V338 V3() : a(0xf0000022) {}
39 };
40 struct __declspec(align(16)) A16X {
41 };
42 struct __declspec(align(16)) B0X {
43 int a, a1;
B0XB0X44 B0X() : a(0xf00000B0), a1(0xf00000B0) {}
45 };
46 struct B1X {
47 int a;
B1XB1X48 B1X() : a(0xf00000B1) {}
49 };
50 struct B2X {
51 int a;
B2XB2X52 B2X() : a(0xf00000B2) {}
53 };
54 struct __declspec(align(16)) B3X {
55 int a;
B3XB3X56 B3X() : a(0xf00000B3) {}
gB3X57 virtual void g() {}
58 };
59 struct B4X : A16X {
60 int a, a1;
B4XB4X61 B4X() : a(0xf00000B4), a1(0xf00000B4) {}
62 };
63 struct B5X : virtual A16X {
64 int a, a1;
B5XB5X65 B5X() : a(0xf00000B5), a1(0xf00000B5) {}
66 };
67 struct B6X {
68 int a;
B6XB6X69 B6X() : a(0xf00000B6) {}
70 };
71
72 struct A : B1, B0, B2, virtual V {
73 int a;
AA74 A() : a(0xf000000A) {}
75 };
76
77 // CHECK: *** Dumping AST Record Layout
78 // CHECK: *** Dumping AST Record Layout
79 // CHECK: *** Dumping AST Record Layout
80 // CHECK: *** Dumping AST Record Layout
81 // CHECK: *** Dumping AST Record Layout
82 // CHECK-NEXT: 0 | struct A
83 // CHECK-NEXT: 0 | struct B1 (base)
84 // CHECK-NEXT: 0 | int a
85 // CHECK-NEXT: 4 | struct B0 (base)
86 // CHECK-NEXT: 4 | int a
87 // CHECK-NEXT: 16 | struct B2 (base)
88 // CHECK-NEXT: 16 | int a
89 // CHECK-NEXT: 32 | (A vbtable pointer)
90 // CHECK-NEXT: 48 | int a
91 // CHECK-NEXT: 64 | struct V (virtual base)
92 // CHECK-NEXT: 64 | char a
93 // CHECK-NEXT: | [sizeof=80, align=16
94 // CHECK-NEXT: | nvsize=64, nvalign=16]
95 // CHECK-X64: *** Dumping AST Record Layout
96 // CHECK-X64: *** Dumping AST Record Layout
97 // CHECK-X64: *** Dumping AST Record Layout
98 // CHECK-X64: *** Dumping AST Record Layout
99 // CHECK-X64: *** Dumping AST Record Layout
100 // CHECK-X64-NEXT: 0 | struct A
101 // CHECK-X64-NEXT: 0 | struct B1 (base)
102 // CHECK-X64-NEXT: 0 | int a
103 // CHECK-X64-NEXT: 4 | struct B0 (base)
104 // CHECK-X64-NEXT: 4 | int a
105 // CHECK-X64-NEXT: 16 | struct B2 (base)
106 // CHECK-X64-NEXT: 16 | int a
107 // CHECK-X64-NEXT: 32 | (A vbtable pointer)
108 // CHECK-X64-NEXT: 48 | int a
109 // CHECK-X64-NEXT: 64 | struct V (virtual base)
110 // CHECK-X64-NEXT: 64 | char a
111 // CHECK-X64-NEXT: | [sizeof=80, align=16
112 // CHECK-X64-NEXT: | nvsize=64, nvalign=16]
113
114 struct B : B2, B0, B1, virtual V {
115 int a;
BB116 B() : a(0xf000000B) {}
117 };
118
119 // CHECK: *** Dumping AST Record Layout
120 // CHECK-NEXT: 0 | struct B
121 // CHECK-NEXT: 0 | struct B2 (base)
122 // CHECK-NEXT: 0 | int a
123 // CHECK-NEXT: 16 | struct B0 (base)
124 // CHECK-NEXT: 16 | int a
125 // CHECK-NEXT: 32 | struct B1 (base)
126 // CHECK-NEXT: 32 | int a
127 // CHECK-NEXT: 36 | (B vbtable pointer)
128 // CHECK-NEXT: 52 | int a
129 // CHECK-NEXT: 64 | struct V (virtual base)
130 // CHECK-NEXT: 64 | char a
131 // CHECK-NEXT: | [sizeof=80, align=16
132 // CHECK-NEXT: | nvsize=64, nvalign=16]
133 // CHECK-X64: *** Dumping AST Record Layout
134 // CHECK-X64-NEXT: 0 | struct B
135 // CHECK-X64-NEXT: 0 | struct B2 (base)
136 // CHECK-X64-NEXT: 0 | int a
137 // CHECK-X64-NEXT: 16 | struct B0 (base)
138 // CHECK-X64-NEXT: 16 | int a
139 // CHECK-X64-NEXT: 32 | struct B1 (base)
140 // CHECK-X64-NEXT: 32 | int a
141 // CHECK-X64-NEXT: 40 | (B vbtable pointer)
142 // CHECK-X64-NEXT: 52 | int a
143 // CHECK-X64-NEXT: 64 | struct V (virtual base)
144 // CHECK-X64-NEXT: 64 | char a
145 // CHECK-X64-NEXT: | [sizeof=80, align=16
146 // CHECK-X64-NEXT: | nvsize=64, nvalign=16]
147
148 struct C : B1, B0, virtual V {
149 int a;
150 long long a1;
CC151 C() : a(0xf000000C), a1(0xf000000Cf000000Cll) {}
152 };
153
154 // CHECK: *** Dumping AST Record Layout
155 // CHECK-NEXT: 0 | struct C
156 // CHECK-NEXT: 0 | struct B1 (base)
157 // CHECK-NEXT: 0 | int a
158 // CHECK-NEXT: 4 | struct B0 (base)
159 // CHECK-NEXT: 4 | int a
160 // CHECK-NEXT: 8 | (C vbtable pointer)
161 // CHECK-NEXT: 24 | int a
162 // CHECK-NEXT: 32 | long long a1
163 // CHECK-NEXT: 48 | struct V (virtual base)
164 // CHECK-NEXT: 48 | char a
165 // CHECK-NEXT: | [sizeof=64, align=16
166 // CHECK-NEXT: | nvsize=48, nvalign=16]
167 // CHECK-X64: *** Dumping AST Record Layout
168 // CHECK-X64-NEXT: 0 | struct C
169 // CHECK-X64-NEXT: 0 | struct B1 (base)
170 // CHECK-X64-NEXT: 0 | int a
171 // CHECK-X64-NEXT: 4 | struct B0 (base)
172 // CHECK-X64-NEXT: 4 | int a
173 // CHECK-X64-NEXT: 8 | (C vbtable pointer)
174 // CHECK-X64-NEXT: 24 | int a
175 // CHECK-X64-NEXT: 32 | long long a1
176 // CHECK-X64-NEXT: 48 | struct V (virtual base)
177 // CHECK-X64-NEXT: 48 | char a
178 // CHECK-X64-NEXT: | [sizeof=64, align=16
179 // CHECK-X64-NEXT: | nvsize=48, nvalign=16]
180
181 struct D : B2, B0, virtual V {
182 int a;
DD183 D() : a(0xf000000D) {}
184 };
185
186 // CHECK: *** Dumping AST Record Layout
187 // CHECK-NEXT: 0 | struct D
188 // CHECK-NEXT: 0 | struct B2 (base)
189 // CHECK-NEXT: 0 | int a
190 // CHECK-NEXT: 16 | struct B0 (base)
191 // CHECK-NEXT: 16 | int a
192 // CHECK-NEXT: 20 | (D vbtable pointer)
193 // CHECK-NEXT: 36 | int a
194 // CHECK-NEXT: 48 | struct V (virtual base)
195 // CHECK-NEXT: 48 | char a
196 // CHECK-NEXT: | [sizeof=64, align=16
197 // CHECK-NEXT: | nvsize=48, nvalign=16]
198 // CHECK-X64: *** Dumping AST Record Layout
199 // CHECK-X64-NEXT: 0 | struct D
200 // CHECK-X64-NEXT: 0 | struct B2 (base)
201 // CHECK-X64-NEXT: 0 | int a
202 // CHECK-X64-NEXT: 16 | struct B0 (base)
203 // CHECK-X64-NEXT: 16 | int a
204 // CHECK-X64-NEXT: 24 | (D vbtable pointer)
205 // CHECK-X64-NEXT: 36 | int a
206 // CHECK-X64-NEXT: 48 | struct V (virtual base)
207 // CHECK-X64-NEXT: 48 | char a
208 // CHECK-X64-NEXT: | [sizeof=64, align=16
209 // CHECK-X64-NEXT: | nvsize=48, nvalign=16]
210
211 struct E : B3, B0, virtual V {
212 int a;
EE213 E() : a(0xf000000E) {}
214 };
215
216 // CHECK: *** Dumping AST Record Layout
217 // CHECK: *** Dumping AST Record Layout
218 // CHECK-NEXT: 0 | struct E
219 // CHECK-NEXT: 0 | struct B3 (base)
220 // CHECK-NEXT: 0 | long long a1
221 // CHECK-NEXT: 8 | int a
222 // CHECK-NEXT: 16 | struct B0 (base)
223 // CHECK-NEXT: 16 | int a
224 // CHECK-NEXT: 20 | (E vbtable pointer)
225 // CHECK-NEXT: 36 | int a
226 // CHECK-NEXT: 48 | struct V (virtual base)
227 // CHECK-NEXT: 48 | char a
228 // CHECK-NEXT: | [sizeof=64, align=16
229 // CHECK-NEXT: | nvsize=48, nvalign=16]
230 // CHECK-X64: *** Dumping AST Record Layout
231 // CHECK-X64: *** Dumping AST Record Layout
232 // CHECK-X64-NEXT: 0 | struct E
233 // CHECK-X64-NEXT: 0 | struct B3 (base)
234 // CHECK-X64-NEXT: 0 | long long a1
235 // CHECK-X64-NEXT: 8 | int a
236 // CHECK-X64-NEXT: 16 | struct B0 (base)
237 // CHECK-X64-NEXT: 16 | int a
238 // CHECK-X64-NEXT: 24 | (E vbtable pointer)
239 // CHECK-X64-NEXT: 36 | int a
240 // CHECK-X64-NEXT: 48 | struct V (virtual base)
241 // CHECK-X64-NEXT: 48 | char a
242 // CHECK-X64-NEXT: | [sizeof=64, align=16
243 // CHECK-X64-NEXT: | nvsize=48, nvalign=16]
244
245 struct F : B0, virtual V1 {
246 __declspec(align(16)) int a;
FF247 F() : a(0xf000000F) {}
fF248 virtual void f() {}
249 };
250
251 // CHECK: *** Dumping AST Record Layout
252 // CHECK: *** Dumping AST Record Layout
253 // CHECK: *** Dumping AST Record Layout
254 // CHECK-NEXT: 0 | struct F
255 // CHECK-NEXT: 0 | struct B0 (base)
256 // CHECK-NEXT: 0 | int a
257 // CHECK-NEXT: 4 | (F vbtable pointer)
258 // CHECK-NEXT: 32 | int a
259 // CHECK-NEXT: 92 | (vtordisp for vbase V1)
260 // CHECK-NEXT: 96 | struct V1 (virtual base)
261 // CHECK-NEXT: 96 | (V1 vftable pointer)
262 // CHECK-NEXT: 128 | struct A16 (base) (empty)
263 // CHECK-NEXT: | [sizeof=128, align=32
264 // CHECK-NEXT: | nvsize=48, nvalign=32]
265 // CHECK-X64: *** Dumping AST Record Layout
266 // CHECK-X64: *** Dumping AST Record Layout
267 // CHECK-X64: *** Dumping AST Record Layout
268 // CHECK-X64-NEXT: 0 | struct F
269 // CHECK-X64-NEXT: 0 | struct B0 (base)
270 // CHECK-X64-NEXT: 0 | int a
271 // CHECK-X64-NEXT: 8 | (F vbtable pointer)
272 // CHECK-X64-NEXT: 32 | int a
273 // CHECK-X64-NEXT: 92 | (vtordisp for vbase V1)
274 // CHECK-X64-NEXT: 96 | struct V1 (virtual base)
275 // CHECK-X64-NEXT: 96 | (V1 vftable pointer)
276 // CHECK-X64-NEXT: 128 | struct A16 (base) (empty)
277 // CHECK-X64-NEXT: | [sizeof=128, align=32
278 // CHECK-X64-NEXT: | nvsize=48, nvalign=32]
279
280 struct G : virtual V2, virtual V3 {
281 int a;
GG282 G() : a(0xf0000001) {}
283 };
284
285 // CHECK: *** Dumping AST Record Layout
286 // CHECK: *** Dumping AST Record Layout
287 // CHECK: *** Dumping AST Record Layout
288 // CHECK-NEXT: 0 | struct G
289 // CHECK-NEXT: 0 | (G vbtable pointer)
290 // CHECK-NEXT: 4 | int a
291 // CHECK-NEXT: 8 | struct V2 (virtual base)
292 // CHECK-NEXT: 8 | long long a
293 // CHECK-NEXT: 16 | int a1
294 // CHECK-NEXT: 24 | struct V3 (virtual base)
295 // CHECK-NEXT: 24 | int a
296 // CHECK-NEXT: | [sizeof=28, align=8
297 // CHECK-NEXT: | nvsize=8, nvalign=8]
298 // CHECK-X64: *** Dumping AST Record Layout
299 // CHECK-X64: *** Dumping AST Record Layout
300 // CHECK-X64: *** Dumping AST Record Layout
301 // CHECK-X64-NEXT: 0 | struct G
302 // CHECK-X64-NEXT: 0 | (G vbtable pointer)
303 // CHECK-X64-NEXT: 8 | int a
304 // CHECK-X64-NEXT: 16 | struct V2 (virtual base)
305 // CHECK-X64-NEXT: 16 | long long a
306 // CHECK-X64-NEXT: 24 | int a1
307 // CHECK-X64-NEXT: 32 | struct V3 (virtual base)
308 // CHECK-X64-NEXT: 32 | int a
309 // CHECK-X64-NEXT: | [sizeof=40, align=8
310 // CHECK-X64-NEXT: | nvsize=16, nvalign=8]
311
312 struct H {
313 __declspec(align(16)) int a;
314 int b;
HH315 H() : a(0xf0000010), b(0xf0000010) {}
316 };
317
318 // CHECK: *** Dumping AST Record Layout
319 // CHECK-NEXT: 0 | struct H
320 // CHECK-NEXT: 0 | int a
321 // CHECK-NEXT: 4 | int b
322 // CHECK-NEXT: | [sizeof=16, align=16
323 // CHECK-NEXT: | nvsize=16, nvalign=16]
324 // CHECK-X64: *** Dumping AST Record Layout
325 // CHECK-X64-NEXT: 0 | struct H
326 // CHECK-X64-NEXT: 0 | int a
327 // CHECK-X64-NEXT: 4 | int b
328 // CHECK-X64-NEXT: | [sizeof=16, align=16
329 // CHECK-X64-NEXT: | nvsize=16, nvalign=16]
330
331 struct I {
332 B2 a;
333 int b;
II334 I() : b(0xf0000010) {}
335 };
336
337 // CHECK: *** Dumping AST Record Layout
338 // CHECK-NEXT: 0 | struct I
339 // CHECK-NEXT: 0 | struct B2 a
340 // CHECK-NEXT: 0 | int a
341 // CHECK: 16 | int b
342 // CHECK-NEXT: | [sizeof=32, align=16
343 // CHECK-NEXT: | nvsize=32, nvalign=16]
344 // CHECK-X64: *** Dumping AST Record Layout
345 // CHECK-X64-NEXT: 0 | struct I
346 // CHECK-X64-NEXT: 0 | struct B2 a
347 // CHECK-X64-NEXT: 0 | int a
348 // CHECK-X64: 16 | int b
349 // CHECK-X64-NEXT: | [sizeof=32, align=16
350 // CHECK-X64-NEXT: | nvsize=32, nvalign=16]
351
352 struct AX : B0X, virtual B2X, virtual B6X, virtual B3X {
353 int a;
AXAX354 AX() : a(0xf000000A) {}
fAX355 virtual void f() {}
gAX356 virtual void g() {}
357 };
358
359 // CHECK: *** Dumping AST Record Layout
360 // CHECK: *** Dumping AST Record Layout
361 // CHECK: *** Dumping AST Record Layout
362 // CHECK: *** Dumping AST Record Layout
363 // CHECK: *** Dumping AST Record Layout
364 // CHECK-NEXT: 0 | struct AX
365 // CHECK-NEXT: 0 | (AX vftable pointer)
366 // CHECK-NEXT: 16 | struct B0X (base)
367 // CHECK-NEXT: 16 | int a
368 // CHECK-NEXT: 20 | int a1
369 // CHECK-NEXT: 24 | (AX vbtable pointer)
370 // CHECK-NEXT: 40 | int a
371 // CHECK-NEXT: 48 | struct B2X (virtual base)
372 // CHECK-NEXT: 48 | int a
373 // CHECK-NEXT: 52 | struct B6X (virtual base)
374 // CHECK-NEXT: 52 | int a
375 // CHECK-NEXT: 76 | (vtordisp for vbase B3X)
376 // CHECK-NEXT: 80 | struct B3X (virtual base)
377 // CHECK-NEXT: 80 | (B3X vftable pointer)
378 // CHECK-NEXT: 84 | int a
379 // CHECK-NEXT: | [sizeof=96, align=16
380 // CHECK-NEXT: | nvsize=48, nvalign=16]
381 // CHECK-X64: *** Dumping AST Record Layout
382 // CHECK-X64: *** Dumping AST Record Layout
383 // CHECK-X64: *** Dumping AST Record Layout
384 // CHECK-X64: *** Dumping AST Record Layout
385 // CHECK-X64: *** Dumping AST Record Layout
386 // CHECK-X64-NEXT: 0 | struct AX
387 // CHECK-X64-NEXT: 0 | (AX vftable pointer)
388 // CHECK-X64-NEXT: 16 | struct B0X (base)
389 // CHECK-X64-NEXT: 16 | int a
390 // CHECK-X64-NEXT: 20 | int a1
391 // CHECK-X64-NEXT: 24 | (AX vbtable pointer)
392 // CHECK-X64-NEXT: 40 | int a
393 // CHECK-X64-NEXT: 48 | struct B2X (virtual base)
394 // CHECK-X64-NEXT: 48 | int a
395 // CHECK-X64-NEXT: 52 | struct B6X (virtual base)
396 // CHECK-X64-NEXT: 52 | int a
397 // CHECK-X64-NEXT: 76 | (vtordisp for vbase B3X)
398 // CHECK-X64-NEXT: 80 | struct B3X (virtual base)
399 // CHECK-X64-NEXT: 80 | (B3X vftable pointer)
400 // CHECK-X64-NEXT: 88 | int a
401 // CHECK-X64-NEXT: | [sizeof=96, align=16
402 // CHECK-X64-NEXT: | nvsize=48, nvalign=16]
403
404 struct BX : B4X, virtual B2X, virtual B6X, virtual B3X {
405 int a;
BXBX406 BX() : a(0xf000000B) {}
fBX407 virtual void f() {}
gBX408 virtual void g() {}
409 };
410
411 // CHECK: *** Dumping AST Record Layout
412 // CHECK: *** Dumping AST Record Layout
413 // CHECK: *** Dumping AST Record Layout
414 // CHECK-NEXT: 0 | struct BX
415 // CHECK-NEXT: 0 | (BX vftable pointer)
416 // CHECK-NEXT: 16 | struct B4X (base)
417 // CHECK-NEXT: 16 | struct A16X (base) (empty)
418 // CHECK-NEXT: 16 | int a
419 // CHECK-NEXT: 20 | int a1
420 // CHECK-NEXT: 32 | (BX vbtable pointer)
421 // CHECK-NEXT: 48 | int a
422 // CHECK-NEXT: 64 | struct B2X (virtual base)
423 // CHECK-NEXT: 64 | int a
424 // CHECK-NEXT: 68 | struct B6X (virtual base)
425 // CHECK-NEXT: 68 | int a
426 // CHECK-NEXT: 92 | (vtordisp for vbase B3X)
427 // CHECK-NEXT: 96 | struct B3X (virtual base)
428 // CHECK-NEXT: 96 | (B3X vftable pointer)
429 // CHECK-NEXT: 100 | int a
430 // CHECK-NEXT: | [sizeof=112, align=16
431 // CHECK-NEXT: | nvsize=64, nvalign=16]
432 // CHECK-X64: *** Dumping AST Record Layout
433 // CHECK-X64: *** Dumping AST Record Layout
434 // CHECK-X64: *** Dumping AST Record Layout
435 // CHECK-X64-NEXT: 0 | struct BX
436 // CHECK-X64-NEXT: 0 | (BX vftable pointer)
437 // CHECK-X64-NEXT: 16 | struct B4X (base)
438 // CHECK-X64-NEXT: 16 | struct A16X (base) (empty)
439 // CHECK-X64-NEXT: 16 | int a
440 // CHECK-X64-NEXT: 20 | int a1
441 // CHECK-X64-NEXT: 32 | (BX vbtable pointer)
442 // CHECK-X64-NEXT: 48 | int a
443 // CHECK-X64-NEXT: 64 | struct B2X (virtual base)
444 // CHECK-X64-NEXT: 64 | int a
445 // CHECK-X64-NEXT: 68 | struct B6X (virtual base)
446 // CHECK-X64-NEXT: 68 | int a
447 // CHECK-X64-NEXT: 92 | (vtordisp for vbase B3X)
448 // CHECK-X64-NEXT: 96 | struct B3X (virtual base)
449 // CHECK-X64-NEXT: 96 | (B3X vftable pointer)
450 // CHECK-X64-NEXT: 104 | int a
451 // CHECK-X64-NEXT: | [sizeof=112, align=16
452 // CHECK-X64-NEXT: | nvsize=64, nvalign=16]
453
454 struct CX : B5X, virtual B2X, virtual B6X, virtual B3X {
455 int a;
CXCX456 CX() : a(0xf000000C) {}
fCX457 virtual void f() {}
gCX458 virtual void g() {}
459 };
460
461 // CHECK: *** Dumping AST Record Layout
462 // CHECK: *** Dumping AST Record Layout
463 // CHECK-NEXT: 0 | struct CX
464 // CHECK-NEXT: 0 | (CX vftable pointer)
465 // CHECK-NEXT: 16 | struct B5X (base)
466 // CHECK-NEXT: 16 | (B5X vbtable pointer)
467 // CHECK-NEXT: 20 | int a
468 // CHECK-NEXT: 24 | int a1
469 // CHECK-NEXT: 28 | int a
470 // CHECK-NEXT: 32 | struct A16X (virtual base) (empty)
471 // CHECK-NEXT: 32 | struct B2X (virtual base)
472 // CHECK-NEXT: 32 | int a
473 // CHECK-NEXT: 36 | struct B6X (virtual base)
474 // CHECK-NEXT: 36 | int a
475 // CHECK-NEXT: 60 | (vtordisp for vbase B3X)
476 // CHECK-NEXT: 64 | struct B3X (virtual base)
477 // CHECK-NEXT: 64 | (B3X vftable pointer)
478 // CHECK-NEXT: 68 | int a
479 // CHECK-NEXT: | [sizeof=80, align=16
480 // CHECK-NEXT: | nvsize=32, nvalign=16]
481 // CHECK-X64: *** Dumping AST Record Layout
482 // CHECK-X64: *** Dumping AST Record Layout
483 // CHECK-X64-NEXT: 0 | struct CX
484 // CHECK-X64-NEXT: 0 | (CX vftable pointer)
485 // CHECK-X64-NEXT: 16 | struct B5X (base)
486 // CHECK-X64-NEXT: 16 | (B5X vbtable pointer)
487 // CHECK-X64-NEXT: 24 | int a
488 // CHECK-X64-NEXT: 28 | int a1
489 // CHECK-X64-NEXT: 32 | int a
490 // CHECK-X64-NEXT: 48 | struct A16X (virtual base) (empty)
491 // CHECK-X64-NEXT: 48 | struct B2X (virtual base)
492 // CHECK-X64-NEXT: 48 | int a
493 // CHECK-X64-NEXT: 52 | struct B6X (virtual base)
494 // CHECK-X64-NEXT: 52 | int a
495 // CHECK-X64-NEXT: 76 | (vtordisp for vbase B3X)
496 // CHECK-X64-NEXT: 80 | struct B3X (virtual base)
497 // CHECK-X64-NEXT: 80 | (B3X vftable pointer)
498 // CHECK-X64-NEXT: 88 | int a
499 // CHECK-X64-NEXT: | [sizeof=96, align=16
500 // CHECK-X64-NEXT: | nvsize=48, nvalign=16]
501
502 struct __declspec(align(16)) DX {
503 int a;
DXDX504 DX() : a(0xf000000D) {}
fDX505 virtual void f() {}
506 };
507
508 // CHECK: *** Dumping AST Record Layout
509 // CHECK-NEXT: 0 | struct DX
510 // CHECK-NEXT: 0 | (DX vftable pointer)
511 // CHECK-NEXT: 4 | int a
512 // CHECK-NEXT: | [sizeof=16, align=16
513 // CHECK-NEXT: | nvsize=8, nvalign=16]
514 // CHECK-X64: *** Dumping AST Record Layout
515 // CHECK-X64-NEXT: 0 | struct DX
516 // CHECK-X64-NEXT: 0 | (DX vftable pointer)
517 // CHECK-X64-NEXT: 8 | int a
518 // CHECK-X64-NEXT: | [sizeof=16, align=16
519 // CHECK-X64-NEXT: | nvsize=16, nvalign=16]
520
521 int a[
522 sizeof(A)+
523 sizeof(B)+
524 sizeof(C)+
525 sizeof(D)+
526 sizeof(E)+
527 sizeof(F)+
528 sizeof(G)+
529 sizeof(H)+
530 sizeof(I)+
531 sizeof(AX)+
532 sizeof(BX)+
533 sizeof(CX)+
534 sizeof(DX)];
535