// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fms-extensions -fdump-record-layouts -fsyntax-only %s 2>&1 \
// RUN: | FileCheck %s --strict-whitespace
// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fms-extensions -fdump-record-layouts -fsyntax-only %s 2>/dev/null \
// RUN: | FileCheck %s -check-prefix CHECK-X64 --strict-whitespace
extern "C" int ;
;
;
;
;
;
;
;
;
// CHECK-LABEL: 0 | struct A
// CHECK-NEXT: 0 | (A vftable pointer)
// CHECK-NEXT: 16 | struct B0 (base)
// CHECK-NEXT: 16 | int a
// CHECK-NEXT: 20 | (A vbtable pointer)
// CHECK-NEXT: 48 | int a
// CHECK-NEXT: 64 | struct B1 (virtual base)
// CHECK-NEXT: 64 | char a
// CHECK-NEXT: | [sizeof=80, align=16
// CHECK-NEXT: | nvsize=64, nvalign=16]
// CHECK-X64-LABEL: 0 | struct A
// CHECK-X64-NEXT: 0 | (A vftable pointer)
// CHECK-X64-NEXT: 16 | struct B0 (base)
// CHECK-X64-NEXT: 16 | int a
// CHECK-X64-NEXT: 24 | (A vbtable pointer)
// CHECK-X64-NEXT: 48 | int a
// CHECK-X64-NEXT: 64 | struct B1 (virtual base)
// CHECK-X64-NEXT: 64 | char a
// CHECK-X64-NEXT: | [sizeof=80, align=16
// CHECK-X64-NEXT: | nvsize=64, nvalign=16]
;
// CHECK-LABEL: 0 | struct C
// CHECK-NEXT: 0 | (C vftable pointer)
// CHECK-NEXT: 16 | struct B4 (base)
// CHECK-NEXT: 16 | (B4 vbtable pointer)
// CHECK-NEXT: 20 | int a
// CHECK-NEXT: 24 | int a
// CHECK-NEXT: 32 | struct B3 (virtual base)
// CHECK-NEXT: 32 | int a
// CHECK-NEXT: | [sizeof=48, align=16
// CHECK-NEXT: | nvsize=32, nvalign=16]
// CHECK-X64-LABEL: 0 | struct C
// CHECK-X64-NEXT: 0 | (C vftable pointer)
// CHECK-X64-NEXT: 16 | struct B4 (base)
// CHECK-X64-NEXT: 16 | (B4 vbtable pointer)
// CHECK-X64-NEXT: 24 | int a
// CHECK-X64-NEXT: 32 | int a
// CHECK-X64-NEXT: 48 | struct B3 (virtual base)
// CHECK-X64-NEXT: 48 | int a
// CHECK-X64-NEXT: | [sizeof=64, align=16
// CHECK-X64-NEXT: | nvsize=48, nvalign=16]
;
// CHECK-LABEL: 0 | struct K
// CHECK-NEXT: 0 | (K vftable pointer)
// CHECK-NEXT: 4 | int a
// CHECK-NEXT: | [sizeof=8, align=4
// CHECK-NEXT: | nvsize=8, nvalign=4]
// CHECK-X64-LABEL: 0 | struct K
// CHECK-X64-NEXT: 0 | (K vftable pointer)
// CHECK-X64-NEXT: 8 | int a
// CHECK-X64-NEXT: | [sizeof=16, align=8
// CHECK-X64-NEXT: | nvsize=16, nvalign=8]
;
// CHECK-LABEL: 0 | struct B{{$}}
// CHECK-NEXT: 0 | struct A (primary base)
// CHECK-NEXT: 0 | (A vftable pointer)
// CHECK-NEXT: 16 | struct B0 (base)
// CHECK-NEXT: 16 | int a
// CHECK-NEXT: 20 | (A vbtable pointer)
// CHECK-NEXT: 48 | int a
// CHECK-NEXT: 64 | struct B2 (base)
// CHECK-NEXT: 64 | (B2 vbtable pointer)
// CHECK-NEXT: 68 | int a
// CHECK-NEXT: 72 | int a
// CHECK-NEXT: 80 | struct B1 (virtual base)
// CHECK-NEXT: 80 | char a
// CHECK-NEXT: | [sizeof=96, align=16
// CHECK-NEXT: | nvsize=80, nvalign=16]
// CHECK-X64-LABEL: 0 | struct B{{$}}
// CHECK-X64-NEXT: 0 | struct A (primary base)
// CHECK-X64-NEXT: 0 | (A vftable pointer)
// CHECK-X64-NEXT: 16 | struct B0 (base)
// CHECK-X64-NEXT: 16 | int a
// CHECK-X64-NEXT: 24 | (A vbtable pointer)
// CHECK-X64-NEXT: 48 | int a
// CHECK-X64-NEXT: 64 | struct B2 (base)
// CHECK-X64-NEXT: 64 | (B2 vbtable pointer)
// CHECK-X64-NEXT: 72 | int a
// CHECK-X64-NEXT: 80 | int a
// CHECK-X64-NEXT: 96 | struct B1 (virtual base)
// CHECK-X64-NEXT: 96 | char a
// CHECK-X64-NEXT: | [sizeof=112, align=16
// CHECK-X64-NEXT: | nvsize=96, nvalign=16]
;
// CHECK-LABEL: 0 | struct D
// CHECK-NEXT: 0 | struct C (primary base)
// CHECK-NEXT: 0 | (C vftable pointer)
// CHECK-NEXT: 16 | struct B4 (base)
// CHECK-NEXT: 16 | (B4 vbtable pointer)
// CHECK-NEXT: 20 | int a
// CHECK-NEXT: 24 | int a
// CHECK-NEXT: 32 | int a
// CHECK-NEXT: 48 | struct B3 (virtual base)
// CHECK-NEXT: 48 | int a
// CHECK-NEXT: | [sizeof=64, align=16
// CHECK-NEXT: | nvsize=48, nvalign=16]
// CHECK-X64-LABEL: 0 | struct D
// CHECK-X64-NEXT: 0 | struct C (primary base)
// CHECK-X64-NEXT: 0 | (C vftable pointer)
// CHECK-X64-NEXT: 16 | struct B4 (base)
// CHECK-X64-NEXT: 16 | (B4 vbtable pointer)
// CHECK-X64-NEXT: 24 | int a
// CHECK-X64-NEXT: 32 | int a
// CHECK-X64-NEXT: 48 | int a
// CHECK-X64-NEXT: 64 | struct B3 (virtual base)
// CHECK-X64-NEXT: 64 | int a
// CHECK-X64-NEXT: | [sizeof=80, align=16
// CHECK-X64-NEXT: | nvsize=64, nvalign=16]
;
// CHECK-LABEL: 0 | struct E
// CHECK-NEXT: 0 | (E vbtable pointer)
// CHECK-NEXT: 4 | int a
// CHECK-NEXT: 16 | struct B3 (virtual base)
// CHECK-NEXT: 16 | int a
// CHECK-NEXT: 44 | (vtordisp for vbase C)
// CHECK-NEXT: 48 | struct C (virtual base)
// CHECK-NEXT: 48 | (C vftable pointer)
// CHECK-NEXT: 64 | struct B4 (base)
// CHECK-NEXT: 64 | (B4 vbtable pointer)
// CHECK-NEXT: 68 | int a
// CHECK-NEXT: 72 | int a
// CHECK-NEXT: | [sizeof=80, align=16
// CHECK-NEXT: | nvsize=8, nvalign=16]
// CHECK-X64-LABEL: 0 | struct E
// CHECK-X64-NEXT: 0 | (E vbtable pointer)
// CHECK-X64-NEXT: 8 | int a
// CHECK-X64-NEXT: 16 | struct B3 (virtual base)
// CHECK-X64-NEXT: 16 | int a
// CHECK-X64-NEXT: 44 | (vtordisp for vbase C)
// CHECK-X64-NEXT: 48 | struct C (virtual base)
// CHECK-X64-NEXT: 48 | (C vftable pointer)
// CHECK-X64-NEXT: 64 | struct B4 (base)
// CHECK-X64-NEXT: 64 | (B4 vbtable pointer)
// CHECK-X64-NEXT: 72 | int a
// CHECK-X64-NEXT: 80 | int a
// CHECK-X64-NEXT: | [sizeof=96, align=16
// CHECK-X64-NEXT: | nvsize=16, nvalign=16]
;
// CHECK-LABEL: 0 | struct F
// CHECK-NEXT: 0 | (F vftable pointer)
// CHECK-NEXT: 16 | struct B3 (base)
// CHECK-NEXT: 16 | int a
// CHECK-NEXT: 32 | (F vbtable pointer)
// CHECK-NEXT: 48 | int a
// CHECK-NEXT: 64 | struct B0 (virtual base)
// CHECK-NEXT: 64 | int a
// CHECK-NEXT: | [sizeof=80, align=16
// CHECK-NEXT: | nvsize=64, nvalign=16]
// CHECK-X64-LABEL: 0 | struct F
// CHECK-X64-NEXT: 0 | (F vftable pointer)
// CHECK-X64-NEXT: 16 | struct B3 (base)
// CHECK-X64-NEXT: 16 | int a
// CHECK-X64-NEXT: 32 | (F vbtable pointer)
// CHECK-X64-NEXT: 48 | int a
// CHECK-X64-NEXT: 64 | struct B0 (virtual base)
// CHECK-X64-NEXT: 64 | int a
// CHECK-X64-NEXT: | [sizeof=80, align=16
// CHECK-X64-NEXT: | nvsize=64, nvalign=16]
;
// CHECK-LABEL: 0 | struct G
// CHECK-NEXT: 0 | struct B6 (primary base)
// CHECK-NEXT: 0 | (B6 vftable pointer)
// CHECK-NEXT: 4 | int a
// CHECK-NEXT: 8 | struct B2 (base)
// CHECK-NEXT: 8 | (B2 vbtable pointer)
// CHECK-NEXT: 12 | int a
// CHECK-NEXT: 16 | int a
// CHECK-NEXT: 20 | struct B1 (virtual base)
// CHECK-NEXT: 20 | char a
// CHECK-NEXT: | [sizeof=21, align=4
// CHECK-NEXT: | nvsize=20, nvalign=4]
// CHECK-X64-LABEL: 0 | struct G
// CHECK-X64-NEXT: 0 | struct B6 (primary base)
// CHECK-X64-NEXT: 0 | (B6 vftable pointer)
// CHECK-X64-NEXT: 8 | int a
// CHECK-X64-NEXT: 16 | struct B2 (base)
// CHECK-X64-NEXT: 16 | (B2 vbtable pointer)
// CHECK-X64-NEXT: 24 | int a
// CHECK-X64-NEXT: 32 | int a
// CHECK-X64-NEXT: 40 | struct B1 (virtual base)
// CHECK-X64-NEXT: 40 | char a
// CHECK-X64-NEXT: | [sizeof=48, align=8
// CHECK-X64-NEXT: | nvsize=40, nvalign=8]
;
// CHECK-LABEL: 0 | struct H
// CHECK-NEXT: 0 | struct B6 (primary base)
// CHECK-NEXT: 0 | (B6 vftable pointer)
// CHECK-NEXT: 4 | int a
// CHECK-NEXT: 8 | struct B2 (base)
// CHECK-NEXT: 8 | (B2 vbtable pointer)
// CHECK-NEXT: 12 | int a
// CHECK-NEXT: 16 | int a
// CHECK-NEXT: 20 | struct B1 (virtual base)
// CHECK-NEXT: 20 | char a
// CHECK-NEXT: | [sizeof=21, align=4
// CHECK-NEXT: | nvsize=20, nvalign=4]
// CHECK-X64-LABEL: 0 | struct H
// CHECK-X64-NEXT: 0 | struct B6 (primary base)
// CHECK-X64-NEXT: 0 | (B6 vftable pointer)
// CHECK-X64-NEXT: 8 | int a
// CHECK-X64-NEXT: 16 | struct B2 (base)
// CHECK-X64-NEXT: 16 | (B2 vbtable pointer)
// CHECK-X64-NEXT: 24 | int a
// CHECK-X64-NEXT: 32 | int a
// CHECK-X64-NEXT: 40 | struct B1 (virtual base)
// CHECK-X64-NEXT: 40 | char a
// CHECK-X64-NEXT: | [sizeof=48, align=8
// CHECK-X64-NEXT: | nvsize=40, nvalign=8]
;
// CHECK-LABEL: 0 | struct I
// CHECK-NEXT: 0 | struct B0 (base)
// CHECK-NEXT: 0 | int a
// CHECK-NEXT: 4 | (I vbtable pointer)
// CHECK-NEXT: 20 | int a
// CHECK-NEXT: 24 | int a1
// CHECK-NEXT: 32 | int a2
// CHECK-NEXT: 48 | struct B1 (virtual base)
// CHECK-NEXT: 48 | char a
// CHECK-NEXT: | [sizeof=64, align=16
// CHECK-NEXT: | nvsize=48, nvalign=16]
// CHECK-X64-LABEL: 0 | struct I
// CHECK-X64-NEXT: 0 | struct B0 (base)
// CHECK-X64-NEXT: 0 | int a
// CHECK-X64-NEXT: 8 | (I vbtable pointer)
// CHECK-X64-NEXT: 20 | int a
// CHECK-X64-NEXT: 24 | int a1
// CHECK-X64-NEXT: 32 | int a2
// CHECK-X64-NEXT: 48 | struct B1 (virtual base)
// CHECK-X64-NEXT: 48 | char a
// CHECK-X64-NEXT: | [sizeof=64, align=16
// CHECK-X64-NEXT: | nvsize=48, nvalign=16]
;
// CHECK-LABEL: 0 | struct J
// CHECK-NEXT: 0 | struct B0 (base)
// CHECK-NEXT: 0 | int a
// CHECK-NEXT: 16 | struct B3 (base)
// CHECK-NEXT: 16 | int a
// CHECK-NEXT: 32 | (J vbtable pointer)
// CHECK-NEXT: 48 | int a
// CHECK-NEXT: 52 | int a1
// CHECK-NEXT: 64 | struct B1 (virtual base)
// CHECK-NEXT: 64 | char a
// CHECK-NEXT: | [sizeof=80, align=16
// CHECK-NEXT: | nvsize=64, nvalign=16]
// CHECK-X64-LABEL: 0 | struct J
// CHECK-X64-NEXT: 0 | struct B0 (base)
// CHECK-X64-NEXT: 0 | int a
// CHECK-X64-NEXT: 16 | struct B3 (base)
// CHECK-X64-NEXT: 16 | int a
// CHECK-X64-NEXT: 32 | (J vbtable pointer)
// CHECK-X64-NEXT: 48 | int a
// CHECK-X64-NEXT: 52 | int a1
// CHECK-X64-NEXT: 64 | struct B1 (virtual base)
// CHECK-X64-NEXT: 64 | char a
// CHECK-X64-NEXT: | [sizeof=80, align=16
// CHECK-X64-NEXT: | nvsize=64, nvalign=16]
;
// CHECK-LABEL: 0 | struct L
// CHECK-NEXT: 0 | (L vftable pointer)
// CHECK-NEXT: 4 | (L vbtable pointer)
// CHECK-NEXT: 8 | int a
// CHECK-NEXT: 12 | struct K (virtual base)
// CHECK-NEXT: 12 | (K vftable pointer)
// CHECK-NEXT: 16 | int a
// CHECK-NEXT: | [sizeof=20, align=4
// CHECK-NEXT: | nvsize=12, nvalign=4]
// CHECK-X64-LABEL: 0 | struct L
// CHECK-X64-NEXT: 0 | (L vftable pointer)
// CHECK-X64-NEXT: 8 | (L vbtable pointer)
// CHECK-X64-NEXT: 16 | int a
// CHECK-X64-NEXT: 24 | struct K (virtual base)
// CHECK-X64-NEXT: 24 | (K vftable pointer)
// CHECK-X64-NEXT: 32 | int a
// CHECK-X64-NEXT: | [sizeof=40, align=8
// CHECK-X64-NEXT: | nvsize=24, nvalign=8]
;
// CHECK-LABEL: 0 | struct M
// CHECK-NEXT: 0 | (M vbtable pointer)
// CHECK-NEXT: 4 | int a
// CHECK-NEXT: 8 | (vtordisp for vbase K)
// CHECK-NEXT: 12 | struct K (virtual base)
// CHECK-NEXT: 12 | (K vftable pointer)
// CHECK-NEXT: 16 | int a
// CHECK-NEXT: | [sizeof=20, align=4
// CHECK-NEXT: | nvsize=8, nvalign=4]
// CHECK-X64-LABEL: 0 | struct M
// CHECK-X64-NEXT: 0 | (M vbtable pointer)
// CHECK-X64-NEXT: 8 | int a
// CHECK-X64-NEXT: 20 | (vtordisp for vbase K)
// CHECK-X64-NEXT: 24 | struct K (virtual base)
// CHECK-X64-NEXT: 24 | (K vftable pointer)
// CHECK-X64-NEXT: 32 | int a
// CHECK-X64-NEXT: | [sizeof=40, align=8
// CHECK-X64-NEXT: | nvsize=16, nvalign=8]
int a;