1 // RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fms-extensions -fdump-record-layouts -fsyntax-only -Wno-inaccessible-base %s 2>&1 \
2 // RUN: | FileCheck %s --strict-whitespace
3 // RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fms-extensions -fdump-record-layouts -fsyntax-only -Wno-inaccessible-base %s 2>/dev/null \
4 // RUN: | FileCheck %s -check-prefix CHECK-X64 --strict-whitespace
6 extern "C" int printf(const char *fmt
, ...);
7 char buffer
[419430400];
12 printf("A = %d\n", (int)((char*)this - buffer
));
13 printf("A.a = %d\n", (int)((char*)&a
- buffer
));
18 __declspec(align(4)) long long a
;
20 printf("B = %d\n", (int)((char*)this - buffer
));
21 printf("B.a = %d\n", (int)((char*)&a
- buffer
));
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
));
38 // CHECK-LABEL: 0 | struct X{{$}}
39 // CHECK-NEXT: 0 | struct B a
40 // CHECK-NEXT: 0 | long long a
41 // CHECK-NEXT: 8 | char b
42 // CHECK-NEXT: 10 | int c
43 // CHECK-NEXT: | [sizeof=16, align=4
44 // CHECK-NEXT: | nvsize=14, nvalign=4]
45 // CHECK-X64-LABEL: 0 | struct X{{$}}
46 // CHECK-X64-NEXT: 0 | struct B a
47 // CHECK-X64-NEXT: 0 | long long a
48 // CHECK-X64-NEXT: 8 | char b
49 // CHECK-X64-NEXT: 10 | int c
50 // CHECK-X64-NEXT: | [sizeof=16, align=4
51 // CHECK-X64-NEXT: | nvsize=14, nvalign=4]
57 printf("Y = %d\n", (int)((char*)this - buffer
));
58 printf("Y.a = %d\n", (int)((char*)&a
- buffer
));
59 printf("Y.b = %d\n", (int)((char*)&b
- buffer
));
63 // CHECK-LABEL: 0 | struct Y{{$}}
64 // CHECK-NEXT: 0 | struct A (base)
65 // CHECK-NEXT: 0 | char a
66 // CHECK-NEXT: 4 | struct B (base)
67 // CHECK-NEXT: 4 | long long a
68 // CHECK-NEXT: 12 | char a
69 // CHECK-NEXT: 14 | int b
70 // CHECK-NEXT: | [sizeof=20, align=4
71 // CHECK-NEXT: | nvsize=18, nvalign=4]
72 // CHECK-X64-LABEL: 0 | struct Y{{$}}
73 // CHECK-X64-NEXT: 0 | struct A (base)
74 // CHECK-X64-NEXT: 0 | char a
75 // CHECK-X64-NEXT: 4 | struct B (base)
76 // CHECK-X64-NEXT: 4 | long long a
77 // CHECK-X64-NEXT: 12 | char a
78 // CHECK-X64-NEXT: 14 | int b
79 // CHECK-X64-NEXT: | [sizeof=20, align=4
80 // CHECK-X64-NEXT: | nvsize=18, nvalign=4]
82 struct Z
: virtual B
{
86 printf("Z = %d\n", (int)((char*)this - buffer
));
87 printf("Z.a = %d\n", (int)((char*)&a
- buffer
));
88 printf("Z.b = %d\n", (int)((char*)&b
- buffer
));
92 // CHECK-LABEL: 0 | struct Z{{$}}
93 // CHECK-NEXT: 0 | (Z vbtable pointer)
94 // CHECK-NEXT: 4 | char a
95 // CHECK-NEXT: 6 | int b
96 // CHECK-NEXT: 12 | struct B (virtual base)
97 // CHECK-NEXT: 12 | long long a
98 // CHECK-NEXT: | [sizeof=20, align=4
99 // CHECK-NEXT: | nvsize=10, nvalign=4]
100 // CHECK-X64-LABEL: 0 | struct Z{{$}}
101 // CHECK-X64-NEXT: 0 | (Z vbtable pointer)
102 // CHECK-X64-NEXT: 8 | char a
103 // CHECK-X64-NEXT: 10 | int b
104 // CHECK-X64-NEXT: 16 | struct B (virtual base)
105 // CHECK-X64-NEXT: 16 | long long a
106 // CHECK-X64-NEXT: | [sizeof=24, align=4
107 // CHECK-X64-NEXT: | nvsize=14, nvalign=4]
111 struct A1
{ long long a
; };
112 #pragma pack(push, 1)
113 struct B1
: virtual A1
{ char a
; };
117 // CHECK-LABEL: 0 | struct C1{{$}}
118 // CHECK-NEXT: 0 | struct B1 (base)
119 // CHECK-NEXT: 0 | (B1 vbtable pointer)
120 // CHECK-NEXT: 4 | char a
121 // CHECK-NEXT: 8 | struct A1 (virtual base)
122 // CHECK-NEXT: 8 | long long a
123 // CHECK-NEXT: | [sizeof=16, align=8
124 // CHECK-NEXT: | nvsize=5, nvalign=8]
125 // CHECK-X64-LABEL: 0 | struct C1{{$}}
126 // CHECK-X64-NEXT: 0 | struct B1 (base)
127 // CHECK-X64-NEXT: 0 | (B1 vbtable pointer)
128 // CHECK-X64-NEXT: 8 | char a
129 // CHECK-X64-NEXT: 16 | struct A1 (virtual base)
130 // CHECK-X64-NEXT: 16 | long long a
131 // CHECK-X64-NEXT: | [sizeof=24, align=8
132 // CHECK-X64-NEXT: | nvsize=9, nvalign=8]
137 struct CA1
: virtual CA0
{
140 #pragma pack(push, 1)
141 struct CA2
: public CA1
, public CA0
{
142 virtual void CA2Method() {}
147 // CHECK-LABEL: 0 | struct CA2{{$}}
148 // CHECK-NEXT: 0 | (CA2 vftable pointer)
149 // CHECK-NEXT: 4 | struct CA1 (base)
150 // CHECK-NEXT: 4 | (CA1 vbtable pointer)
151 // CHECK-NEXT: 9 | struct CA0 (base) (empty)
152 // CHECK-NEXT: 9 | struct CA0 (virtual base) (empty)
153 // CHECK-NEXT: | [sizeof=9, align=1
154 // CHECK-NEXT: | nvsize=9, nvalign=1]
155 // CHECK-X64-LABEL: 0 | struct CA2{{$}}
156 // CHECK-X64-NEXT: 0 | (CA2 vftable pointer)
157 // CHECK-X64-NEXT: 8 | struct CA1 (base)
158 // CHECK-X64-NEXT: 8 | (CA1 vbtable pointer)
159 // CHECK-X64-NEXT: 17 | struct CA0 (base) (empty)
160 // CHECK-X64-NEXT: 17 | struct CA0 (virtual base) (empty)
161 // CHECK-X64-NEXT: | [sizeof=17, align=1
162 // CHECK-X64-NEXT: | nvsize=17, nvalign=1]
166 __declspec(align(32)) char : 1;
168 // CHECK-LABEL: 0 | struct YA{{$}}
169 // CHECK-NEXT:0:0-0 | char
170 // CHECK-NEXT: | [sizeof=32, align=32
171 // CHECK-NEXT: | nvsize=32, nvalign=32]
172 // CHECK-X64-LABEL: 0 | struct YA{{$}}
173 // CHECK-X64-NEXT:0:0-0 | char
174 // CHECK-X64-NEXT: | [sizeof=32, align=32
175 // CHECK-X64-NEXT: | nvsize=32, nvalign=32]
182 // CHECK-LABEL: 0 | struct YB{{$}}
183 // CHECK-NEXT: 0 | char a
184 // CHECK-NEXT: 1 | struct YA b
185 // CHECK-NEXT:1:0-0 | char
186 // CHECK-NEXT: | [sizeof=33, align=1
187 // CHECK-NEXT: | nvsize=33, nvalign=1]
188 // CHECK-X64-LABEL: 0 | struct YB{{$}}
189 // CHECK-X64-NEXT: 0 | char a
190 // CHECK-X64-NEXT: 1 | struct YA b
191 // CHECK-X64-NEXT:1:0-0 | char
192 // CHECK-X64-NEXT: | [sizeof=33, align=1
193 // CHECK-X64-NEXT: | nvsize=33, nvalign=1]
197 __declspec(align(32)) char : 1;
199 // CHECK-LABEL: 0 | struct YC{{$}}
200 // CHECK-NEXT:0:0-0 | char
201 // CHECK-NEXT: | [sizeof=32, align=32
202 // CHECK-NEXT: | nvsize=32, nvalign=32]
203 // CHECK-X64-LABEL: 0 | struct YC{{$}}
204 // CHECK-X64-NEXT: 0:0-0 | char
205 // CHECK-X64-NEXT: | [sizeof=8, align=32
206 // CHECK-X64-NEXT: | nvsize=8, nvalign=32]
213 // CHECK-LABEL: 0 | struct YD{{$}}
214 // CHECK-NEXT: 0 | char a
215 // CHECK-NEXT: 1 | struct YC b
216 // CHECK-NEXT:1:0-0 | char
217 // CHECK-NEXT: | [sizeof=33, align=1
218 // CHECK-NEXT: | nvsize=33, nvalign=1]
219 // CHECK-X64-LABEL: 0 | struct YD{{$}}
220 // CHECK-X64-NEXT: 0 | char a
221 // CHECK-X64-NEXT: 1 | struct YC b
222 // CHECK-X64-NEXT:1:0-0 | char
223 // CHECK-X64-NEXT: | [sizeof=9, align=1
224 // CHECK-X64-NEXT: | nvsize=9, nvalign=1]
228 __declspec(align(32)) char : 1;
230 // CHECK-LABEL: 0 | struct YE{{$}}
231 // CHECK-NEXT: 0:0-0 | char
232 // CHECK-NEXT: | [sizeof=4, align=32
233 // CHECK-NEXT: | nvsize=4, nvalign=32]
234 // CHECK-X64-LABEL: 0 | struct YE{{$}}
235 // CHECK-X64-NEXT: 0:0-0 | char
236 // CHECK-X64-NEXT: | [sizeof=4, align=32
237 // CHECK-X64-NEXT: | nvsize=4, nvalign=32]
244 // CHECK-LABEL: 0 | struct YF{{$}}
245 // CHECK-NEXT: 0 | char a
246 // CHECK-NEXT: 1 | struct YE b
247 // CHECK-NEXT:1:0-0 | char
248 // CHECK-NEXT: | [sizeof=5, align=1
249 // CHECK-NEXT: | nvsize=5, nvalign=1]
250 // CHECK-X64-LABEL: 0 | struct YF{{$}}
251 // CHECK-X64-NEXT: 0 | char a
252 // CHECK-X64-NEXT: 1 | struct YE b
253 // CHECK-X64-NEXT:1:0-0 | char
254 // CHECK-X64-NEXT: | [sizeof=5, align=1
255 // CHECK-X64-NEXT: | nvsize=5, nvalign=1]
258 struct __declspec(align(16)) D0
{ char a
; };
260 struct D1
: public D0
{ char a
; };
262 struct D2
: D1
{ char a
; };
264 // CHECK-LABEL: 0 | struct D2{{$}}
265 // CHECK-NEXT: 0 | struct D1 (base)
266 // CHECK-NEXT: 0 | struct D0 (base)
267 // CHECK-NEXT: 0 | char a
268 // CHECK-NEXT: 1 | char a
269 // CHECK-NEXT: 2 | char a
270 // CHECK-NEXT: | [sizeof=16, align=16
271 // CHECK-NEXT: | nvsize=16, nvalign=16]
272 // CHECK-X64-LABEL: 0 | struct D2{{$}}
273 // CHECK-X64-NEXT: 0 | struct D1 (base)
274 // CHECK-X64-NEXT: 0 | struct D0 (base)
275 // CHECK-X64-NEXT: 0 | char a
276 // CHECK-X64-NEXT: 1 | char a
277 // CHECK-X64-NEXT: 2 | char a
278 // CHECK-X64-NEXT: | [sizeof=16, align=16
279 // CHECK-X64-NEXT: | nvsize=16, nvalign=16]
282 struct JA
{ char a
; };
284 struct JB
{ __declspec(align(4)) char a
; };
286 struct JC
: JB
, JA
{ };
288 // CHECK-LABEL: 0 | struct JC{{$}}
289 // CHECK-NEXT: 0 | struct JB (base)
290 // CHECK-NEXT: 0 | char a
291 // CHECK-NEXT: 1 | struct JA (base)
292 // CHECK-NEXT: 1 | char a
293 // CHECK-NEXT: | [sizeof=4, align=4
294 // CHECK-NEXT: | nvsize=4, nvalign=4]
295 // CHECK-X64-LABEL: 0 | struct JC{{$}}
296 // CHECK-X64-NEXT: 0 | struct JB (base)
297 // CHECK-X64-NEXT: 0 | char a
298 // CHECK-X64-NEXT: 1 | struct JA (base)
299 // CHECK-X64-NEXT: 1 | char a
300 // CHECK-X64-NEXT: | [sizeof=4, align=4
301 // CHECK-X64-NEXT: | nvsize=4, nvalign=4]
304 struct KA
{ char a
; };
306 struct KB
: KA
{ __declspec(align(2)) char a
; };
308 // CHECK-LABEL: 0 | struct KB{{$}}
309 // CHECK-NEXT: 0 | struct KA (base)
310 // CHECK-NEXT: 0 | char a
311 // CHECK-NEXT: 2 | char a
312 // CHECK-NEXT: | [sizeof=4, align=2
313 // CHECK-NEXT: | nvsize=3, nvalign=2]
314 // CHECK-X64-LABEL: 0 | struct KB{{$}}
315 // CHECK-X64-NEXT: 0 | struct KA (base)
316 // CHECK-X64-NEXT: 0 | char a
317 // CHECK-X64-NEXT: 2 | char a
318 // CHECK-X64-NEXT: | [sizeof=4, align=2
319 // CHECK-X64-NEXT: | nvsize=3, nvalign=2]
323 virtual void fun() {}
324 __declspec(align(256)) int Field
;
327 // CHECK-LABEL: 0 | struct L{{$}}
328 // CHECK-NEXT: 0 | (L vftable pointer)
329 // CHECK-NEXT: 256 | int Field
330 // CHECK-NEXT: | [sizeof=512, align=256
331 // CHECK-NEXT: | nvsize=260, nvalign=256]
332 // CHECK-X64-LABEL: 0 | struct L{{$}}
333 // CHECK-X64-NEXT: 0 | (L vftable pointer)
334 // CHECK-X64-NEXT: 256 | int Field
335 // CHECK-X64-NEXT: | [sizeof=512, align=256
336 // CHECK-X64-NEXT: | nvsize=260, nvalign=256]
341 struct MB
: virtual MA
{
342 __declspec(align(256)) int Field
;
345 // CHECK-LABEL: 0 | struct MB{{$}}
346 // CHECK-NEXT: 0 | (MB vbtable pointer)
347 // CHECK-NEXT: 256 | int Field
348 // CHECK-NEXT: 260 | struct MA (virtual base) (empty)
349 // CHECK-NEXT: | [sizeof=512, align=256
350 // CHECK-NEXT: | nvsize=260, nvalign=256]
351 // CHECK-X64-LABEL: 0 | struct MB{{$}}
352 // CHECK-X64-NEXT: 0 | (MB vbtable pointer)
353 // CHECK-X64-NEXT: 256 | int Field
354 // CHECK-X64-NEXT: 260 | struct MA (virtual base) (empty)
355 // CHECK-X64-NEXT: | [sizeof=512, align=256
356 // CHECK-X64-NEXT: | nvsize=260, nvalign=256]
360 struct __declspec(align(8)) RB0
{
361 __declspec(align(1024)) int b
: 3;
364 struct __declspec(align(8)) RB1
{
365 __declspec(align(1024)) int b
: 3;
369 struct __declspec(align(8)) RB2
: virtual RA
{
370 __declspec(align(1024)) int b
: 3;
373 struct __declspec(align(8)) RB3
: virtual RA
{
374 __declspec(align(1024)) int b
: 3;
380 __declspec(align(1024)) int c
: 3;
388 // CHECK-LABEL: 0 | struct RB0{{$}}
389 // CHECK-NEXT:0:0-2 | int b
390 // CHECK-NEXT: | [sizeof=8, align=1024
391 // CHECK-NEXT: | nvsize=4, nvalign=1024]
392 // CHECK-LABEL: 0 | struct RB1{{$}}
393 // CHECK-NEXT: 0 | (RB1 vftable pointer)
394 // CHECK-NEXT: 1024:0-2 | int b
395 // CHECK-NEXT: | [sizeof=1032, align=1024
396 // CHECK-NEXT: | nvsize=1028, nvalign=1024]
397 // CHECK-LABEL: 0 | struct RB2{{$}}
398 // CHECK-NEXT: 0 | (RB2 vbtable pointer)
399 // CHECK-NEXT: 1024:0-2 | int b
400 // CHECK-NEXT: 1028 | struct RA (virtual base) (empty)
401 // CHECK-NEXT: | [sizeof=1032, align=1024
402 // CHECK-NEXT: | nvsize=1028, nvalign=1024]
403 // CHECK-LABEL: 0 | struct RB3{{$}}
404 // CHECK-NEXT: 0 | (RB3 vftable pointer)
405 // CHECK-NEXT: 1024 | (RB3 vbtable pointer)
406 // CHECK-NEXT: 2048:0-2 | int b
407 // CHECK-NEXT: 2052 | struct RA (virtual base) (empty)
408 // CHECK-NEXT: | [sizeof=2056, align=1024
409 // CHECK-NEXT: | nvsize=2052, nvalign=1024]
410 // CHECK-LABEL: 0 | struct RC{{$}}
411 // CHECK-NEXT: 0 | char _
412 // CHECK-NEXT: 1024:0-2 | int c
413 // CHECK-NEXT: | [sizeof=1028, align=1024
414 // CHECK-NEXT: | nvsize=1028, nvalign=1024]
415 // CHECK-LABEL: 0 | struct RE{{$}}
416 // CHECK-NEXT: 0 | char _
417 // CHECK-NEXT: 1 | struct RC c
418 // CHECK-NEXT: 1 | char _
419 // CHECK-NEXT: 1025:0-2 | int c
420 // CHECK-NEXT: | [sizeof=1029, align=1
421 // CHECK-NEXT: | nvsize=1029, nvalign=1]
422 // CHECK-X64-LABEL: 0 | struct RB0{{$}}
423 // CHECK-X64-NEXT: 0:0-2 | int b
424 // CHECK-X64-NEXT: | [sizeof=8, align=1024
425 // CHECK-X64-NEXT: | nvsize=4, nvalign=1024]
426 // CHECK-X64-LABEL: 0 | struct RB1{{$}}
427 // CHECK-X64-NEXT: 0 | (RB1 vftable pointer)
428 // CHECK-X64-NEXT: 1024:0-2 | int b
429 // CHECK-X64-NEXT: | [sizeof=1032, align=1024
430 // CHECK-X64-NEXT: | nvsize=1028, nvalign=1024]
431 // CHECK-X64-LABEL: 0 | struct RB2{{$}}
432 // CHECK-X64-NEXT: 0 | (RB2 vbtable pointer)
433 // CHECK-X64-NEXT: 1024:0-2 | int b
434 // CHECK-X64-NEXT: 1028 | struct RA (virtual base) (empty)
435 // CHECK-X64-NEXT: | [sizeof=1032, align=1024
436 // CHECK-X64-NEXT: | nvsize=1028, nvalign=1024]
437 // CHECK-X64-LABEL: 0 | struct RB3{{$}}
438 // CHECK-X64-NEXT: 0 | (RB3 vftable pointer)
439 // CHECK-X64-NEXT: 1024 | (RB3 vbtable pointer)
440 // CHECK-X64-NEXT: 2048:0-2 | int b
441 // CHECK-X64-NEXT: 2052 | struct RA (virtual base) (empty)
442 // CHECK-X64-NEXT: | [sizeof=2056, align=1024
443 // CHECK-X64-NEXT: | nvsize=2052, nvalign=1024]
444 // CHECK-X64-LABEL: 0 | struct RC{{$}}
445 // CHECK-X64-NEXT: 0 | char _
446 // CHECK-X64-NEXT: 1024:0-2 | int c
447 // CHECK-X64-NEXT: | [sizeof=1028, align=1024
448 // CHECK-X64-NEXT: | nvsize=1028, nvalign=1024]
449 // CHECK-X64-LABEL: 0 | struct RE{{$}}
450 // CHECK-X64-NEXT: 0 | char _
451 // CHECK-X64-NEXT: 1 | struct RC c
452 // CHECK-X64-NEXT: 1 | char _
453 // CHECK-X64-NEXT: 1025:0-2 | int c
454 // CHECK-X64-NEXT: | [sizeof=1029, align=1
455 // CHECK-X64-NEXT: | nvsize=1029, nvalign=1]
459 #pragma pack(push, 1)
460 struct NC
: virtual NA
, virtual NB
{};
464 // CHECK-LABEL: 0 | struct NA (empty){{$}}
465 // CHECK-NEXT: | [sizeof=1, align=1
466 // CHECK-NEXT: | nvsize=0, nvalign=1]
467 // CHECK-LABEL: 0 | struct NB (empty){{$}}
468 // CHECK-NEXT: | [sizeof=1, align=1
469 // CHECK-NEXT: | nvsize=0, nvalign=1]
470 // CHECK-LABEL: 0 | struct NC{{$}}
471 // CHECK-NEXT: 0 | (NC vbtable pointer)
472 // CHECK-NEXT: 4 | struct NA (virtual base) (empty)
473 // CHECK-NEXT: 8 | struct NB (virtual base) (empty)
474 // CHECK-NEXT: | [sizeof=8, align=1
475 // CHECK-NEXT: | nvsize=4, nvalign=1]
476 // CHECK-LABEL: 0 | struct ND{{$}}
477 // CHECK-NEXT: 0 | struct NC (base)
478 // CHECK-NEXT: 0 | (NC vbtable pointer)
479 // CHECK-NEXT: 4 | struct NA (virtual base) (empty)
480 // CHECK-NEXT: 8 | struct NB (virtual base) (empty)
481 // CHECK-NEXT: | [sizeof=8, align=4
482 // CHECK-NEXT: | nvsize=4, nvalign=4]
483 // CHECK-X64-LABEL: 0 | struct NA (empty){{$}}
484 // CHECK-X64-NEXT: | [sizeof=1, align=1
485 // CHECK-X64-NEXT: | nvsize=0, nvalign=1]
486 // CHECK-X64-LABEL: 0 | struct NB (empty){{$}}
487 // CHECK-X64-NEXT: | [sizeof=1, align=1
488 // CHECK-X64-NEXT: | nvsize=0, nvalign=1]
489 // CHECK-X64-LABEL: 0 | struct NC{{$}}
490 // CHECK-X64-NEXT: 0 | (NC vbtable pointer)
491 // CHECK-X64-NEXT: 8 | struct NA (virtual base) (empty)
492 // CHECK-X64-NEXT: 12 | struct NB (virtual base) (empty)
493 // CHECK-X64-NEXT: | [sizeof=12, align=1
494 // CHECK-X64-NEXT: | nvsize=8, nvalign=1]
495 // CHECK-X64-LABEL: 0 | struct ND{{$}}
496 // CHECK-X64-NEXT: 0 | struct NC (base)
497 // CHECK-X64-NEXT: 0 | (NC vbtable pointer)
498 // CHECK-X64-NEXT: 8 | struct NA (virtual base) (empty)
499 // CHECK-X64-NEXT: 12 | struct NB (virtual base) (empty)
500 // CHECK-X64-NEXT: | [sizeof=12, align=4
501 // CHECK-X64-NEXT: | nvsize=8, nvalign=4]
505 struct OC
: virtual OA
, virtual OB
{};
506 #pragma pack(push, 1)
510 // CHECK-LABEL: 0 | struct OA (empty){{$}}
511 // CHECK-NEXT: | [sizeof=1, align=1
512 // CHECK-NEXT: | nvsize=0, nvalign=1]
513 // CHECK-LABEL: 0 | struct OB (empty){{$}}
514 // CHECK-NEXT: | [sizeof=1, align=1
515 // CHECK-NEXT: | nvsize=0, nvalign=1]
516 // CHECK-LABEL: 0 | struct OC{{$}}
517 // CHECK-NEXT: 0 | (OC vbtable pointer)
518 // CHECK-NEXT: 4 | struct OA (virtual base) (empty)
519 // CHECK-NEXT: 8 | struct OB (virtual base) (empty)
520 // CHECK-NEXT: | [sizeof=8, align=4
521 // CHECK-NEXT: | nvsize=4, nvalign=4]
522 // CHECK-LABEL: 0 | struct OD{{$}}
523 // CHECK-NEXT: 0 | struct OC (base)
524 // CHECK-NEXT: 0 | (OC vbtable pointer)
525 // CHECK-NEXT: 4 | struct OA (virtual base) (empty)
526 // CHECK-NEXT: 8 | struct OB (virtual base) (empty)
527 // CHECK-NEXT: | [sizeof=8, align=1
528 // CHECK-NEXT: | nvsize=4, nvalign=1]
529 // CHECK-X64-LABEL: 0 | struct OA (empty){{$}}
530 // CHECK-X64-NEXT: | [sizeof=1, align=1
531 // CHECK-X64-NEXT: | nvsize=0, nvalign=1]
532 // CHECK-X64-LABEL: 0 | struct OB (empty){{$}}
533 // CHECK-X64-NEXT: | [sizeof=1, align=1
534 // CHECK-X64-NEXT: | nvsize=0, nvalign=1]
535 // CHECK-X64-LABEL: 0 | struct OC{{$}}
536 // CHECK-X64-NEXT: 0 | (OC vbtable pointer)
537 // CHECK-X64-NEXT: 8 | struct OA (virtual base) (empty)
538 // CHECK-X64-NEXT: 12 | struct OB (virtual base) (empty)
539 // CHECK-X64-NEXT: | [sizeof=16, align=8
540 // CHECK-X64-NEXT: | nvsize=8, nvalign=8]
541 // CHECK-X64-LABEL: 0 | struct OD{{$}}
542 // CHECK-X64-NEXT: 0 | struct OC (base)
543 // CHECK-X64-NEXT: 0 | (OC vbtable pointer)
544 // CHECK-X64-NEXT: 8 | struct OA (virtual base) (empty)
545 // CHECK-X64-NEXT: 12 | struct OB (virtual base) (empty)
546 // CHECK-X64-NEXT: | [sizeof=12, align=1
547 // CHECK-X64-NEXT: | nvsize=8, nvalign=1]
549 struct __declspec(align(4)) PA
{
553 typedef __declspec(align(8)) PA PB
;
555 #pragma pack(push, 1)
562 // CHECK: 0 | struct PC
563 // CHECK-NEXT: 0 | char a
564 // CHECK-NEXT: 8 | struct PA x
565 // CHECK-NEXT: 8 | int c
566 // CHECK-NEXT: | [sizeof=16, align=8
567 // CHECK-NEXT: | nvsize=12, nvalign=8]
568 // CHECK-X64: 0 | struct PC
569 // CHECK-X64-NEXT: 0 | char a
570 // CHECK-X64-NEXT: 8 | struct PA x
571 // CHECK-X64-NEXT: 8 | int c
572 // CHECK-X64-NEXT: | [sizeof=16, align=8
573 // CHECK-X64-NEXT: | nvsize=12, nvalign=8]
577 #pragma pack(push, 1)
584 // CHECK: 0 | struct PE
585 // CHECK-NEXT: 0 | char a
586 // CHECK-NEXT: 8 | struct PA x
587 // CHECK-NEXT: 8 | int c
588 // CHECK-NEXT: | [sizeof=16, align=8
589 // CHECK-NEXT: | nvsize=12, nvalign=8]
590 // CHECK-X64: 0 | struct PE
591 // CHECK-X64-NEXT: 0 | char a
592 // CHECK-X64-NEXT: 8 | struct PA x
593 // CHECK-X64-NEXT: 8 | int c
594 // CHECK-X64-NEXT: | [sizeof=16, align=8
595 // CHECK-X64-NEXT: | nvsize=12, nvalign=8]
597 typedef int __declspec(align(2)) QA
;
598 #pragma pack(push, 1)
605 // CHECK-LABEL: 0 | struct QB{{$}}
606 // CHECK-NEXT: 0 | char a
607 // CHECK-NEXT: 2 | QA b
608 // CHECK-NEXT: | [sizeof=6, align=2
609 // CHECK-NEXT: | nvsize=6, nvalign=2]
610 // CHECK-X64-LABEL: 0 | struct QB{{$}}
611 // CHECK-X64-NEXT: 0 | char a
612 // CHECK-X64-NEXT: 2 | QA b
613 // CHECK-X64-NEXT: | [sizeof=6, align=2
614 // CHECK-X64-NEXT: | nvsize=6, nvalign=2]
621 // CHECK-LABEL: 0 | struct QC{{$}}
622 // CHECK-NEXT: 0 | char a
623 // CHECK-NEXT: 4 | QA b
624 // CHECK-NEXT: | [sizeof=8, align=4
625 // CHECK-NEXT: | nvsize=8, nvalign=4]
626 // CHECK-X64-LABEL: 0 | struct QC{{$}}
627 // CHECK-X64-NEXT: 0 | char a
628 // CHECK-X64-NEXT: 4 | QA b
629 // CHECK-X64-NEXT: | [sizeof=8, align=4
630 // CHECK-X64-NEXT: | nvsize=8, nvalign=4]
637 // CHECK-LABEL: 0 | struct QD{{$}}
638 // CHECK-NEXT: 0 | char a
639 // CHECK-NEXT:4:0-2 | QA b
640 // CHECK-NEXT: | [sizeof=8, align=4
641 // CHECK-NEXT: | nvsize=8, nvalign=4]
642 // CHECK-X64-LABEL: 0 | struct QD{{$}}
643 // CHECK-X64-NEXT: 0 | char a
644 // CHECK-X64-NEXT:4:0-2 | QA b
645 // CHECK-X64-NEXT: | [sizeof=8, align=4
646 // CHECK-X64-NEXT: | nvsize=8, nvalign=4]
648 struct __declspec(align(4)) EmptyAlignedLongLongMemb
{
649 long long FlexArrayMemb
[0];
652 // CHECK-LABEL: 0 | struct EmptyAlignedLongLongMemb{{$}}
653 // CHECK-NEXT: 0 | long long[0] FlexArrayMemb
654 // CHECK-NEXT: | [sizeof=8, align=8
655 // CHECK-NEXT: | nvsize=0, nvalign=8]
656 // CHECK-X64-LABEL: 0 | struct EmptyAlignedLongLongMemb{{$}}
657 // CHECK-X64-NEXT: 0 | long long[0] FlexArrayMemb
658 // CHECK-X64-NEXT: | [sizeof=8, align=8
659 // CHECK-X64-NEXT: | nvsize=0, nvalign=8]
662 struct __declspec(align(4)) EmptyPackedAlignedLongLongMemb
{
663 long long FlexArrayMemb
[0];
667 // CHECK-LABEL: 0 | struct EmptyPackedAlignedLongLongMemb{{$}}
668 // CHECK-NEXT: 0 | long long[0] FlexArrayMemb
669 // CHECK-NEXT: | [sizeof=4, align=4
670 // CHECK-NEXT: | nvsize=0, nvalign=4]
671 // CHECK-X64-LABEL: 0 | struct EmptyPackedAlignedLongLongMemb{{$}}
672 // CHECK-X64-NEXT: 0 | long long[0] FlexArrayMemb
673 // CHECK-X64-NEXT: | [sizeof=4, align=4
674 // CHECK-X64-NEXT: | nvsize=0, nvalign=4]
707 sizeof(EmptyAlignedLongLongMemb
)+
708 sizeof(EmptyPackedAlignedLongLongMemb
)+