• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only %s 2>&1 \
2 // RUN:            | FileCheck %s
3 // RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -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 char buffer[419430400];
8 
9 struct A {
10 	char a;
AA11 	A() {
12 		printf("A   = %d\n", (int)((char*)this - buffer));
13 		printf("A.a = %d\n", (int)((char*)&a - buffer));
14 	}
15 };
16 
17 struct B {
18 	__declspec(align(4)) long long a;
BB19 	B() {
20 		printf("B   = %d\n", (int)((char*)this - buffer));
21 		printf("B.a = %d\n", (int)((char*)&a - buffer));
22 	}
23 };
24 
25 #pragma pack(push, 2)
26 struct X {
27 	B a;
28 	char b;
29 	int c;
XX30 	X() {
31 		printf("X   = %d\n", (int)((char*)this - buffer));
32 		printf("X.a = %d\n", (int)((char*)&a - buffer));
33 		printf("X.b = %d\n", (int)((char*)&b - buffer));
34 		printf("X.c = %d\n", (int)((char*)&c - buffer));
35 	}
36 };
37 
38 // CHECK: *** Dumping AST Record Layout
39 // CHECK: *** Dumping AST Record Layout
40 // CHECK-NEXT:    0 | struct X
41 // CHECK-NEXT:    0 |   struct B a
42 // CHECK-NEXT:    0 |     long long a
43 // CHECK-NEXT:      |   [sizeof=8, align=8
44 // CHECK-NEXT:      |    nvsize=8, nvalign=8]
45 // CHECK-NEXT:    8 |   char b
46 // CHECK-NEXT:   10 |   int c
47 // CHECK-NEXT:      | [sizeof=16, align=4
48 // CHECK-NEXT:      |  nvsize=14, nvalign=4]
49 // CHECK-X64: *** Dumping AST Record Layout
50 // CHECK-X64: *** Dumping AST Record Layout
51 // CHECK-X64-NEXT:    0 | struct X
52 // CHECK-X64-NEXT:    0 |   struct B a
53 // CHECK-X64-NEXT:    0 |     long long a
54 // CHECK-X64-NEXT:      |   [sizeof=8, align=8
55 // CHECK-X64-NEXT:      |    nvsize=8, nvalign=8]
56 // CHECK-X64-NEXT:    8 |   char b
57 // CHECK-X64-NEXT:   10 |   int c
58 // CHECK-X64-NEXT:      | [sizeof=16, align=4
59 // CHECK-X64-NEXT:      |  nvsize=14, nvalign=4]
60 
61 struct Y : A, B {
62 	char a;
63 	int b;
YY64 	Y() {
65 		printf("Y   = %d\n", (int)((char*)this - buffer));
66 		printf("Y.a = %d\n", (int)((char*)&a - buffer));
67 		printf("Y.b = %d\n", (int)((char*)&b - buffer));
68 	}
69 };
70 
71 // CHECK: *** Dumping AST Record Layout
72 // CHECK: *** Dumping AST Record Layout
73 // CHECK-NEXT:    0 | struct Y
74 // CHECK-NEXT:    0 |   struct A (base)
75 // CHECK-NEXT:    0 |     char a
76 // CHECK-NEXT:    4 |   struct B (base)
77 // CHECK-NEXT:    4 |     long long a
78 // CHECK-NEXT:   12 |   char a
79 // CHECK-NEXT:   14 |   int b
80 // CHECK-NEXT:      | [sizeof=20, align=4
81 // CHECK-NEXT:      |  nvsize=18, nvalign=4]
82 // CHECK-X64: *** Dumping AST Record Layout
83 // CHECK-X64: *** Dumping AST Record Layout
84 // CHECK-X64-NEXT:    0 | struct Y
85 // CHECK-X64-NEXT:    0 |   struct A (base)
86 // CHECK-X64-NEXT:    0 |     char a
87 // CHECK-X64-NEXT:    4 |   struct B (base)
88 // CHECK-X64-NEXT:    4 |     long long a
89 // CHECK-X64-NEXT:   12 |   char a
90 // CHECK-X64-NEXT:   14 |   int b
91 // CHECK-X64-NEXT:      | [sizeof=20, align=4
92 // CHECK-X64-NEXT:      |  nvsize=18, nvalign=4]
93 
94 struct Z : virtual B {
95 	char a;
96 	int b;
ZZ97 	Z() {
98 		printf("Z   = %d\n", (int)((char*)this - buffer));
99 		printf("Z.a = %d\n", (int)((char*)&a - buffer));
100 		printf("Z.b = %d\n", (int)((char*)&b - buffer));
101 	}
102 };
103 
104 // CHECK: *** Dumping AST Record Layout
105 // CHECK-NEXT:    0 | struct Z
106 // CHECK-NEXT:    0 |   (Z vbtable pointer)
107 // CHECK-NEXT:    4 |   char a
108 // CHECK-NEXT:    6 |   int b
109 // CHECK-NEXT:   12 |   struct B (virtual base)
110 // CHECK-NEXT:   12 |     long long a
111 // CHECK-NEXT:      | [sizeof=20, align=4
112 // CHECK-NEXT:      |  nvsize=10, nvalign=4]
113 // CHECK-X64: *** Dumping AST Record Layout
114 // CHECK-X64-NEXT:    0 | struct Z
115 // CHECK-X64-NEXT:    0 |   (Z vbtable pointer)
116 // CHECK-X64-NEXT:    8 |   char a
117 // CHECK-X64-NEXT:   10 |   int b
118 // CHECK-X64-NEXT:   16 |   struct B (virtual base)
119 // CHECK-X64-NEXT:   16 |     long long a
120 // CHECK-X64-NEXT:      | [sizeof=24, align=4
121 // CHECK-X64-NEXT:      |  nvsize=14, nvalign=4]
122 
123 #pragma pack(pop)
124 
125 struct A1 { long long a; };
126 #pragma pack(push, 1)
127 struct B1 : virtual A1 { char a; };
128 #pragma pack(pop)
129 struct C1 : B1 {};
130 
131 // CHECK: *** Dumping AST Record Layout
132 // CHECK: *** Dumping AST Record Layout
133 // CHECK: *** Dumping AST Record Layout
134 // CHECK-NEXT:    0 | struct C1
135 // CHECK-NEXT:    0 |   struct B1 (base)
136 // CHECK-NEXT:    0 |     (B1 vbtable pointer)
137 // CHECK-NEXT:    4 |     char a
138 // CHECK-NEXT:    8 |   struct A1 (virtual base)
139 // CHECK-NEXT:    8 |     long long a
140 // CHECK-NEXT:      | [sizeof=16, align=8
141 // CHECK-NEXT:      |  nvsize=5, nvalign=8]
142 // CHECK-X64: *** Dumping AST Record Layout
143 // CHECK-X64: *** Dumping AST Record Layout
144 // CHECK-X64: *** Dumping AST Record Layout
145 // CHECK-X64-NEXT:    0 | struct C1
146 // CHECK-X64-NEXT:    0 |   struct B1 (base)
147 // CHECK-X64-NEXT:    0 |     (B1 vbtable pointer)
148 // CHECK-X64-NEXT:    8 |     char a
149 // CHECK-X64-NEXT:   16 |   struct A1 (virtual base)
150 // CHECK-X64-NEXT:   16 |     long long a
151 // CHECK-X64-NEXT:      | [sizeof=24, align=8
152 // CHECK-X64-NEXT:      |  nvsize=9, nvalign=8]
153 
154 struct CA0 {
CA0CA0155 	CA0() {}
156 };
157 struct CA1 : virtual CA0 {
CA1CA1158 	CA1() {}
159 };
160 #pragma pack(push, 1)
161 struct CA2 : public CA1, public CA0 {
CA2MethodCA2162 	virtual void CA2Method() {}
CA2CA2163 	CA2() {}
164 };
165 #pragma pack(pop)
166 
167 // CHECK: *** Dumping AST Record Layout
168 // CHECK: *** Dumping AST Record Layout
169 // CHECK: *** Dumping AST Record Layout
170 // CHECK-NEXT:    0 | struct CA2
171 // CHECK-NEXT:    0 |   (CA2 vftable pointer)
172 // CHECK-NEXT:    4 |   struct CA1 (base)
173 // CHECK-NEXT:    4 |     (CA1 vbtable pointer)
174 // CHECK-NEXT:    9 |   struct CA0 (base) (empty)
175 // CHECK-NEXT:    9 |   struct CA0 (virtual base) (empty)
176 // CHECK-NEXT:      | [sizeof=9, align=1
177 // CHECK-NEXT:      |  nvsize=9, nvalign=1]
178 // CHECK-X64: *** Dumping AST Record Layout
179 // CHECK-X64: *** Dumping AST Record Layout
180 // CHECK-X64: *** Dumping AST Record Layout
181 // CHECK-X64-NEXT:    0 | struct CA2
182 // CHECK-X64-NEXT:    0 |   (CA2 vftable pointer)
183 // CHECK-X64-NEXT:    8 |   struct CA1 (base)
184 // CHECK-X64-NEXT:    8 |     (CA1 vbtable pointer)
185 // CHECK-X64-NEXT:   17 |   struct CA0 (base) (empty)
186 // CHECK-X64-NEXT:   17 |   struct CA0 (virtual base) (empty)
187 // CHECK-X64-NEXT:      | [sizeof=17, align=1
188 // CHECK-X64-NEXT:      |  nvsize=17, nvalign=1]
189 
190 #pragma pack(16)
191 struct YA {
192 	__declspec(align(32)) char : 1;
193 };
194 // CHECK: *** Dumping AST Record Layout
195 // CHECK-NEXT:    0 | struct YA (empty)
196 // CHECK-NEXT:    0 |   char
197 // CHECK-NEXT:      | [sizeof=32, align=32
198 // CHECK-NEXT:      |  nvsize=32, nvalign=32]
199 // CHECK-X64: *** Dumping AST Record Layout
200 // CHECK-X64-NEXT:    0 | struct YA (empty)
201 // CHECK-X64-NEXT:    0 |   char
202 // CHECK-X64-NEXT:      | [sizeof=32, align=32
203 // CHECK-X64-NEXT:      |  nvsize=32, nvalign=32]
204 
205 #pragma pack(1)
206 struct YB {
207 	char a;
208 	YA b;
209 };
210 // CHECK: *** Dumping AST Record Layout
211 // CHECK-NEXT:    0 | struct YB
212 // CHECK-NEXT:    0 |   char a
213 // CHECK-NEXT:    1 |   struct YA b (empty)
214 // CHECK-NEXT:    1 |     char
215 // CHECK-NEXT:      |   [sizeof=32, align=32
216 // CHECK-NEXT:      |    nvsize=32, nvalign=32]
217 // CHECK-NEXT:      | [sizeof=33, align=1
218 // CHECK-NEXT:      |  nvsize=33, nvalign=1]
219 // CHECK-X64: *** Dumping AST Record Layout
220 // CHECK-X64-NEXT:    0 | struct YB
221 // CHECK-X64-NEXT:    0 |   char a
222 // CHECK-X64-NEXT:    1 |   struct YA b (empty)
223 // CHECK-X64-NEXT:    1 |     char
224 // CHECK-X64-NEXT:      |   [sizeof=32, align=32
225 // CHECK-X64-NEXT:      |    nvsize=32, nvalign=32]
226 // CHECK-X64-NEXT:      | [sizeof=33, align=1
227 // CHECK-X64-NEXT:      |  nvsize=33, nvalign=1]
228 
229 #pragma pack(8)
230 struct YC {
231 	__declspec(align(32)) char : 1;
232 };
233 // CHECK: *** Dumping AST Record Layout
234 // CHECK-NEXT:    0 | struct YC (empty)
235 // CHECK-NEXT:    0 |   char
236 // CHECK-NEXT:      | [sizeof=32, align=32
237 // CHECK-NEXT:      |  nvsize=32, nvalign=32]
238 // CHECK-X64: *** Dumping AST Record Layout
239 // CHECK-X64-NEXT:    0 | struct YC (empty)
240 // CHECK-X64-NEXT:    0 |   char
241 // CHECK-X64-NEXT:      | [sizeof=8, align=32
242 // CHECK-X64-NEXT:      |  nvsize=8, nvalign=32]
243 
244 #pragma pack(1)
245 struct YD {
246 	char a;
247 	YC b;
248 };
249 // CHECK: *** Dumping AST Record Layout
250 // CHECK-NEXT:    0 | struct YD
251 // CHECK-NEXT:    0 |   char a
252 // CHECK-NEXT:    1 |   struct YC b (empty)
253 // CHECK-NEXT:    1 |     char
254 // CHECK-NEXT:      |   [sizeof=32, align=32
255 // CHECK-NEXT:      |    nvsize=32, nvalign=32]
256 // CHECK-NEXT:      | [sizeof=33, align=1
257 // CHECK-NEXT:      |  nvsize=33, nvalign=1]
258 // CHECK-X64: *** Dumping AST Record Layout
259 // CHECK-X64-NEXT:    0 | struct YD
260 // CHECK-X64-NEXT:    0 |   char a
261 // CHECK-X64-NEXT:    1 |   struct YC b (empty)
262 // CHECK-X64-NEXT:    1 |     char
263 // CHECK-X64-NEXT:      |   [sizeof=8, align=32
264 // CHECK-X64-NEXT:      |    nvsize=8, nvalign=32]
265 // CHECK-X64-NEXT:      | [sizeof=9, align=1
266 // CHECK-X64-NEXT:      |  nvsize=9, nvalign=1]
267 
268 #pragma pack(4)
269 struct YE {
270 	__declspec(align(32)) char : 1;
271 };
272 // CHECK: *** Dumping AST Record Layout
273 // CHECK-NEXT:    0 | struct YE (empty)
274 // CHECK-NEXT:    0 |   char
275 // CHECK-NEXT:      | [sizeof=4, align=32
276 // CHECK-NEXT:      |  nvsize=4, nvalign=32]
277 // CHECK-X64: *** Dumping AST Record Layout
278 // CHECK-X64-NEXT:    0 | struct YE (empty)
279 // CHECK-X64-NEXT:    0 |   char
280 // CHECK-X64-NEXT:      | [sizeof=4, align=32
281 // CHECK-X64-NEXT:      |  nvsize=4, nvalign=32]
282 
283 #pragma pack(1)
284 struct YF {
285 	char a;
286 	YE b;
287 };
288 // CHECK: *** Dumping AST Record Layout
289 // CHECK-NEXT:    0 | struct YF
290 // CHECK-NEXT:    0 |   char a
291 // CHECK-NEXT:    1 |   struct YE b (empty)
292 // CHECK-NEXT:    1 |     char
293 // CHECK-NEXT:      |   [sizeof=4, align=32
294 // CHECK-NEXT:      |    nvsize=4, nvalign=32]
295 // CHECK-NEXT:      | [sizeof=5, align=1
296 // CHECK-NEXT:      |  nvsize=5, nvalign=1]
297 // CHECK-X64: *** Dumping AST Record Layout
298 // CHECK-X64-NEXT:    0 | struct YF
299 // CHECK-X64-NEXT:    0 |   char a
300 // CHECK-X64-NEXT:    1 |   struct YE b (empty)
301 // CHECK-X64-NEXT:    1 |     char
302 // CHECK-X64-NEXT:      |   [sizeof=4, align=32
303 // CHECK-X64-NEXT:      |    nvsize=4, nvalign=32]
304 // CHECK-X64-NEXT:      | [sizeof=5, align=1
305 // CHECK-X64-NEXT:      |  nvsize=5, nvalign=1]
306 
307 #pragma pack(16)
308 struct __declspec(align(16)) D0 { char a; };
309 #pragma pack(1)
310 struct D1 : public D0 { char a; };
311 #pragma pack(16)
312 struct D2 : D1 { char a; };
313 
314 // CHECK: *** Dumping AST Record Layout
315 // CHECK: *** Dumping AST Record Layout
316 // CHECK: *** Dumping AST Record Layout
317 // CHECK-NEXT:    0 | struct D2
318 // CHECK-NEXT:    0 |   struct D1 (base)
319 // CHECK-NEXT:    0 |     struct D0 (base)
320 // CHECK-NEXT:    0 |       char a
321 // CHECK-NEXT:    1 |     char a
322 // CHECK-NEXT:    2 |   char a
323 // CHECK-NEXT:      | [sizeof=16, align=16
324 // CHECK-NEXT:      |  nvsize=16, nvalign=16]
325 // CHECK-X64: *** Dumping AST Record Layout
326 // CHECK-X64: *** Dumping AST Record Layout
327 // CHECK-X64: *** Dumping AST Record Layout
328 // CHECK-X64-NEXT:    0 | struct D2
329 // CHECK-X64-NEXT:    0 |   struct D1 (base)
330 // CHECK-X64-NEXT:    0 |     struct D0 (base)
331 // CHECK-X64-NEXT:    0 |       char a
332 // CHECK-X64-NEXT:    1 |     char a
333 // CHECK-X64-NEXT:    2 |   char a
334 // CHECK-X64-NEXT:      | [sizeof=16, align=16
335 // CHECK-X64-NEXT:      |  nvsize=16, nvalign=16]
336 
337 #pragma pack()
338 struct JA { char a; };
339 #pragma pack(1)
340 struct JB { __declspec(align(4)) char a; };
341 #pragma pack()
342 struct JC : JB, JA { };
343 
344 // CHECK: *** Dumping AST Record Layout
345 // CHECK: *** Dumping AST Record Layout
346 // CHECK: *** Dumping AST Record Layout
347 // CHECK-NEXT:    0 | struct JC
348 // CHECK-NEXT:    0 |   struct JB (base)
349 // CHECK-NEXT:    0 |     char a
350 // CHECK-NEXT:    1 |   struct JA (base)
351 // CHECK-NEXT:    1 |     char a
352 // CHECK-NEXT:      | [sizeof=4, align=4
353 // CHECK-NEXT:      |  nvsize=4, nvalign=4]
354 // CHECK-X64: *** Dumping AST Record Layout
355 // CHECK-X64: *** Dumping AST Record Layout
356 // CHECK-X64: *** Dumping AST Record Layout
357 // CHECK-X64-NEXT:    0 | struct JC
358 // CHECK-X64-NEXT:    0 |   struct JB (base)
359 // CHECK-X64-NEXT:    0 |     char a
360 // CHECK-X64-NEXT:    1 |   struct JA (base)
361 // CHECK-X64-NEXT:    1 |     char a
362 // CHECK-X64-NEXT:      | [sizeof=4, align=4
363 // CHECK-X64-NEXT:      |  nvsize=4, nvalign=4]
364 
365 #pragma pack()
366 struct KA { char a; };
367 #pragma pack(1)
368 struct KB : KA { __declspec(align(2)) char a; };
369 
370 // CHECK: *** Dumping AST Record Layout
371 // CHECK: *** Dumping AST Record Layout
372 // CHECK-NEXT:    0 | struct KB
373 // CHECK-NEXT:    0 |   struct KA (base)
374 // CHECK-NEXT:    0 |     char a
375 // CHECK-NEXT:    2 |   char a
376 // CHECK-NEXT:      | [sizeof=4, align=2
377 // CHECK-NEXT:      |  nvsize=3, nvalign=2]
378 // CHECK-X64: *** Dumping AST Record Layout
379 // CHECK-X64: *** Dumping AST Record Layout
380 // CHECK-X64-NEXT:    0 | struct KB
381 // CHECK-X64-NEXT:    0 |   struct KA (base)
382 // CHECK-X64-NEXT:    0 |     char a
383 // CHECK-X64-NEXT:    2 |   char a
384 // CHECK-X64-NEXT:      | [sizeof=4, align=2
385 // CHECK-X64-NEXT:      |  nvsize=3, nvalign=2]
386 
387 #pragma pack(1)
388 struct L {
funL389   virtual void fun() {}
390   __declspec(align(256)) int Field;
391 };
392 
393 // CHECK: *** Dumping AST Record Layout
394 // CHECK-NEXT:    0 | struct L
395 // CHECK-NEXT:    0 |   (L vftable pointer)
396 // CHECK-NEXT:  256 |   int Field
397 // CHECK-NEXT:      | [sizeof=512, align=256
398 // CHECK-NEXT:      |  nvsize=260, nvalign=256]
399 // CHECK-X64: *** Dumping AST Record Layout
400 // CHECK-X64-NEXT:    0 | struct L
401 // CHECK-X64-NEXT:    0 |   (L vftable pointer)
402 // CHECK-X64-NEXT:  256 |   int Field
403 // CHECK-X64-NEXT:      | [sizeof=512, align=256
404 // CHECK-X64-NEXT:      |  nvsize=260, nvalign=256]
405 
406 #pragma pack()
407 struct MA {};
408 #pragma pack(1)
409 struct MB : virtual MA {
410   __declspec(align(256)) int Field;
411 };
412 
413 // CHECK: *** Dumping AST Record Layout
414 // CHECK: *** Dumping AST Record Layout
415 // CHECK-NEXT:    0 | struct MB
416 // CHECK-NEXT:    0 |   (MB vbtable pointer)
417 // CHECK-NEXT:  256 |   int Field
418 // CHECK-NEXT:  260 |   struct MA (virtual base) (empty)
419 // CHECK-NEXT:      | [sizeof=512, align=256
420 // CHECK-NEXT:      |  nvsize=260, nvalign=256]
421 // CHECK-X64: *** Dumping AST Record Layout
422 // CHECK-X64: *** Dumping AST Record Layout
423 // CHECK-X64-NEXT:    0 | struct MB
424 // CHECK-X64-NEXT:    0 |   (MB vbtable pointer)
425 // CHECK-X64-NEXT:  256 |   int Field
426 // CHECK-X64-NEXT:  260 |   struct MA (virtual base) (empty)
427 // CHECK-X64-NEXT:      | [sizeof=512, align=256
428 // CHECK-X64-NEXT:      |  nvsize=260, nvalign=256]
429 
430 struct RA {};
431 #pragma pack(1)
432 struct __declspec(align(8)) RB0 {
433 	__declspec(align(1024)) int b : 3;
434 };
435 
436 struct __declspec(align(8)) RB1 {
437 	__declspec(align(1024)) int b : 3;
fRB1438 	virtual void f() {}
439 };
440 
441 struct __declspec(align(8)) RB2 : virtual RA {
442 	__declspec(align(1024)) int b : 3;
443 };
444 
445 struct __declspec(align(8)) RB3 : virtual RA {
446 	__declspec(align(1024)) int b : 3;
fRB3447 	virtual void f() {}
448 };
449 
450 struct RC {
451 	char _;
452 	__declspec(align(1024)) int c : 3;
453 };
454 struct RE {
455 	char _;
456 	RC c;
457 };
458 #pragma pack()
459 
460 // CHECK: *** Dumping AST Record Layout
461 // CHECK-NEXT:    0 | struct RB0
462 // CHECK-NEXT:    0 |   int b
463 // CHECK-NEXT:      | [sizeof=8, align=1024
464 // CHECK-NEXT:      |  nvsize=4, nvalign=1024]
465 // CHECK: *** Dumping AST Record Layout
466 // CHECK-NEXT:    0 | struct RB1
467 // CHECK-NEXT:    0 |   (RB1 vftable pointer)
468 // CHECK-NEXT: 1024 |   int b
469 // CHECK-NEXT:      | [sizeof=1032, align=1024
470 // CHECK-NEXT:      |  nvsize=1028, nvalign=1024]
471 // CHECK: *** Dumping AST Record Layout
472 // CHECK: *** Dumping AST Record Layout
473 // CHECK-NEXT:    0 | struct RB2
474 // CHECK-NEXT:    0 |   (RB2 vbtable pointer)
475 // CHECK-NEXT: 1024 |   int b
476 // CHECK-NEXT: 1028 |   struct RA (virtual base) (empty)
477 // CHECK-NEXT:      | [sizeof=1032, align=1024
478 // CHECK-NEXT:      |  nvsize=1028, nvalign=1024]
479 // CHECK: *** Dumping AST Record Layout
480 // CHECK-NEXT:    0 | struct RB3
481 // CHECK-NEXT:    0 |   (RB3 vftable pointer)
482 // CHECK-NEXT: 1024 |   (RB3 vbtable pointer)
483 // CHECK-NEXT: 2048 |   int b
484 // CHECK-NEXT: 2052 |   struct RA (virtual base) (empty)
485 // CHECK-NEXT:      | [sizeof=2056, align=1024
486 // CHECK-NEXT:      |  nvsize=2052, nvalign=1024]
487 // CHECK: *** Dumping AST Record Layout
488 // CHECK-NEXT:    0 | struct RC
489 // CHECK-NEXT:    0 |   char _
490 // CHECK-NEXT: 1024 |   int c
491 // CHECK-NEXT:      | [sizeof=1028, align=1024
492 // CHECK-NEXT:      |  nvsize=1028, nvalign=1024]
493 // CHECK: *** Dumping AST Record Layout
494 // CHECK-NEXT:    0 | struct RE
495 // CHECK-NEXT:    0 |   char _
496 // CHECK-NEXT:    1 |   struct RC c
497 // CHECK-NEXT:    1 |     char _
498 // CHECK-NEXT: 1025 |     int c
499 // CHECK-NEXT:      |   [sizeof=1028, align=1024
500 // CHECK-NEXT:      |    nvsize=1028, nvalign=1024]
501 // CHECK-NEXT:      | [sizeof=1029, align=1
502 // CHECK-NEXT:      |  nvsize=1029, nvalign=1]
503 // CHECK-X64: *** Dumping AST Record Layout
504 // CHECK-X64-NEXT:    0 | struct RB0
505 // CHECK-X64-NEXT:    0 |   int b
506 // CHECK-X64-NEXT:      | [sizeof=8, align=1024
507 // CHECK-X64-NEXT:      |  nvsize=4, nvalign=1024]
508 // CHECK-X64: *** Dumping AST Record Layout
509 // CHECK-X64-NEXT:    0 | struct RB1
510 // CHECK-X64-NEXT:    0 |   (RB1 vftable pointer)
511 // CHECK-X64-NEXT: 1024 |   int b
512 // CHECK-X64-NEXT:      | [sizeof=1032, align=1024
513 // CHECK-X64-NEXT:      |  nvsize=1028, nvalign=1024]
514 // CHECK-X64: *** Dumping AST Record Layout
515 // CHECK-X64: *** Dumping AST Record Layout
516 // CHECK-X64-NEXT:    0 | struct RB2
517 // CHECK-X64-NEXT:    0 |   (RB2 vbtable pointer)
518 // CHECK-X64-NEXT: 1024 |   int b
519 // CHECK-X64-NEXT: 1028 |   struct RA (virtual base) (empty)
520 // CHECK-X64-NEXT:      | [sizeof=1032, align=1024
521 // CHECK-X64-NEXT:      |  nvsize=1028, nvalign=1024]
522 // CHECK-X64: *** Dumping AST Record Layout
523 // CHECK-X64-NEXT:    0 | struct RB3
524 // CHECK-X64-NEXT:    0 |   (RB3 vftable pointer)
525 // CHECK-X64-NEXT: 1024 |   (RB3 vbtable pointer)
526 // CHECK-X64-NEXT: 2048 |   int b
527 // CHECK-X64-NEXT: 2052 |   struct RA (virtual base) (empty)
528 // CHECK-X64-NEXT:      | [sizeof=2056, align=1024
529 // CHECK-X64-NEXT:      |  nvsize=2052, nvalign=1024]
530 // CHECK-X64: *** Dumping AST Record Layout
531 // CHECK-X64-NEXT:    0 | struct RC
532 // CHECK-X64-NEXT:    0 |   char _
533 // CHECK-X64-NEXT: 1024 |   int c
534 // CHECK-X64-NEXT:      | [sizeof=1028, align=1024
535 // CHECK-X64-NEXT:      |  nvsize=1028, nvalign=1024]
536 // CHECK-X64: *** Dumping AST Record Layout
537 // CHECK-X64-NEXT:    0 | struct RE
538 // CHECK-X64-NEXT:    0 |   char _
539 // CHECK-X64-NEXT:    1 |   struct RC c
540 // CHECK-X64-NEXT:    1 |     char _
541 // CHECK-X64-NEXT: 1025 |     int c
542 // CHECK-X64-NEXT:      |   [sizeof=1028, align=1024
543 // CHECK-X64-NEXT:      |    nvsize=1028, nvalign=1024]
544 // CHECK-X64-NEXT:      | [sizeof=1029, align=1
545 // CHECK-X64-NEXT:      |  nvsize=1029, nvalign=1]
546 
547 int a[
548 sizeof(X)+
549 sizeof(Y)+
550 sizeof(Z)+
551 sizeof(C1)+
552 sizeof(CA2)+
553 sizeof(YA)+
554 sizeof(YB)+
555 sizeof(YC)+
556 sizeof(YD)+
557 sizeof(YE)+
558 sizeof(YF)+
559 sizeof(YF)+
560 sizeof(D2)+
561 sizeof(JC)+
562 sizeof(KB)+
563 sizeof(L)+
564 sizeof(MB)+
565 sizeof(RB0)+
566 sizeof(RB1)+
567 sizeof(RB2)+
568 sizeof(RB3)+
569 sizeof(RC)+
570 sizeof(RE)+
571 0];
572