// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fms-extensions -fdump-record-layouts -fsyntax-only %s 2>/dev/null \
// 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 ;
__declspec char buffer;
;
;
;
;
;
;
// CHECK-LABEL: 0 | struct AT3{{$}}
// CHECK-NEXT: 0 | struct AT2 (base)
// CHECK-NEXT: 0 | struct AT0 t
// CHECK-NEXT: 0 | union AT0::(unnamed at {{.*}} x
// CHECK-NEXT: 0 | struct AT0::(unnamed at {{.*}} y
// CHECK-NEXT: 0 | int a
// CHECK-NEXT: 4 | struct AT t (empty)
// CHECK: 0 | int b
// CHECK: 8 | char c
// CHECK: 12 | char AT2FieldName0
// CHECK-NEXT: 20 | struct AT1 (base)
// CHECK-NEXT: 20 | struct V (base)
// CHECK-NEXT: 20 | struct AT (base) (empty)
// CHECK-NEXT: 20 | char c
// CHECK-NEXT: 24 | int a
// CHECK-NEXT: | [sizeof=28, align=4
// CHECK-NEXT: | nvsize=28, nvalign=4]
// CHECK-X64-LABEL: 0 | struct AT3{{$}}
// CHECK-X64-NEXT: 0 | struct AT2 (base)
// CHECK-X64-NEXT: 0 | struct AT0 t
// CHECK-X64-NEXT: 0 | union AT0::(unnamed at {{.*}} x
// CHECK-X64-NEXT: 0 | struct AT0::(unnamed at {{.*}} y
// CHECK-X64-NEXT: 0 | int a
// CHECK-X64-NEXT: 4 | struct AT t (empty)
// CHECK-X64: 0 | int b
// CHECK-X64: 8 | char c
// CHECK-X64: 12 | char AT2FieldName0
// CHECK-X64-NEXT: 20 | struct AT1 (base)
// CHECK-X64-NEXT: 20 | struct V (base)
// CHECK-X64-NEXT: 20 | struct AT (base) (empty)
// CHECK-X64-NEXT: 20 | char c
// CHECK-X64-NEXT: 24 | int a
// CHECK-X64-NEXT: | [sizeof=28, align=4
// CHECK-X64-NEXT: | nvsize=28, nvalign=4]
;
;
;
// CHECK-LABEL: 0 | struct BT3{{$}}
// CHECK-NEXT: 0 | struct BT0 (base) (empty)
// CHECK-NEXT: 1 | struct BT2 (base)
// CHECK-NEXT: 1 | struct BT0 (base) (empty)
// CHECK-NEXT: 1 | char BT2FieldName0
// CHECK-NEXT: | [sizeof=2, align=1
// CHECK-NEXT: | nvsize=2, nvalign=1]
// CHECK-X64-LABEL: 0 | struct BT3{{$}}
// CHECK-X64-NEXT: 0 | struct BT0 (base) (empty)
// CHECK-X64-NEXT: 1 | struct BT2 (base)
// CHECK-X64-NEXT: 1 | struct BT0 (base) (empty)
// CHECK-X64-NEXT: 1 | char BT2FieldName0
// CHECK-X64-NEXT: | [sizeof=2, align=1
// CHECK-X64-NEXT: | nvsize=2, nvalign=1]
;
;
;
;
// CHECK-LABEL: 0 | struct T3{{$}}
// CHECK-NEXT: 0 | (T3 vbtable pointer)
// CHECK-NEXT: 4 | struct T1 (virtual base)
// CHECK-NEXT: 4 | struct T0 (base) (empty)
// CHECK-NEXT: 4 | struct AT (base) (empty)
// CHECK-NEXT: 4 | char a
// CHECK-NEXT: 12 | struct T2 (virtual base)
// CHECK-NEXT: 12 | struct AT (base) (empty)
// CHECK-NEXT: 12 | char a
// CHECK-NEXT: | [sizeof=16, align=4
// CHECK-NEXT: | nvsize=4, nvalign=4]
// CHECK-X64-LABEL: 0 | struct T3{{$}}
// CHECK-X64-NEXT: 0 | (T3 vbtable pointer)
// CHECK-X64-NEXT: 8 | struct T1 (virtual base)
// CHECK-X64-NEXT: 8 | struct T0 (base) (empty)
// CHECK-X64-NEXT: 8 | struct AT (base) (empty)
// CHECK-X64-NEXT: 8 | char a
// CHECK-X64-NEXT: 16 | struct T2 (virtual base)
// CHECK-X64-NEXT: 16 | struct AT (base) (empty)
// CHECK-X64-NEXT: 16 | char a
// CHECK-X64-NEXT: | [sizeof=24, align=8
// CHECK-X64-NEXT: | nvsize=8, nvalign=8]
;
;
;
;
// CHECK-LABEL: 0 | struct E{{$}}
// CHECK-NEXT: 0 | struct D (base)
// CHECK-NEXT: 4 | struct B (base) (empty)
// CHECK-NEXT: 0 | (D vbtable pointer)
// CHECK-NEXT: 4 | struct B b (empty)
// CHECK: 8 | struct B (base) (empty)
// CHECK-NEXT: 8 | struct C (virtual base)
// CHECK-NEXT: 8 | int a
// CHECK-NEXT: | [sizeof=12, align=4
// CHECK-NEXT: | nvsize=8, nvalign=4]
// CHECK-X64-LABEL: 0 | struct E{{$}}
// CHECK-X64-NEXT: 0 | struct D (base)
// CHECK-X64-NEXT: 8 | struct B (base) (empty)
// CHECK-X64-NEXT: 0 | (D vbtable pointer)
// CHECK-X64-NEXT: 8 | struct B b (empty)
// CHECK-X64: 16 | struct B (base) (empty)
// CHECK-X64-NEXT: 16 | struct C (virtual base)
// CHECK-X64-NEXT: 16 | int a
// CHECK-X64-NEXT: | [sizeof=24, align=8
// CHECK-X64-NEXT: | nvsize=16, nvalign=8]
;
// CHECK-LABEL: 0 | struct F{{$}}
// CHECK-NEXT: 0 | (F vbtable pointer)
// CHECK-NEXT: 4 | struct C (virtual base)
// CHECK-NEXT: 4 | int a
// CHECK-NEXT: 8 | struct D (virtual base)
// CHECK-NEXT: 12 | struct B (base) (empty)
// CHECK-NEXT: 8 | (D vbtable pointer)
// CHECK-NEXT: 12 | struct B b (empty)
// CHECK: 16 | struct B (virtual base) (empty)
// CHECK-NEXT: | [sizeof=16, align=4
// CHECK-NEXT: | nvsize=4, nvalign=4]
// CHECK-X64-LABEL: 0 | struct F{{$}}
// CHECK-X64-NEXT: 0 | (F vbtable pointer)
// CHECK-X64-NEXT: 8 | struct C (virtual base)
// CHECK-X64-NEXT: 8 | int a
// CHECK-X64-NEXT: 16 | struct D (virtual base)
// CHECK-X64-NEXT: 24 | struct B (base) (empty)
// CHECK-X64-NEXT: 16 | (D vbtable pointer)
// CHECK-X64-NEXT: 24 | struct B b (empty)
// CHECK-X64: 32 | struct B (virtual base) (empty)
// CHECK-X64-NEXT: | [sizeof=32, align=8
// CHECK-X64-NEXT: | nvsize=8, nvalign=8]
;
;
;
;
// CHECK-LABEL: 0 | struct JC4{{$}}
// CHECK-NEXT: 0 | struct JC1 (primary base)
// CHECK-NEXT: 0 | (JC1 vftable pointer)
// CHECK-NEXT: 4 | struct JC0 (base) (empty)
// CHECK-NEXT: 8 | struct JC2 (base)
// CHECK-NEXT: 8 | struct JC1 (primary base)
// CHECK-NEXT: 8 | (JC1 vftable pointer)
// CHECK-NEXT: 12 | struct JC0 (base) (empty)
// CHECK-NEXT: | [sizeof=12, align=4
// CHECK-NEXT: | nvsize=12, nvalign=4]
// CHECK-X64-LABEL: 0 | struct JC4{{$}}
// CHECK-X64-NEXT: 0 | struct JC1 (primary base)
// CHECK-X64-NEXT: 0 | (JC1 vftable pointer)
// CHECK-X64-NEXT: 8 | struct JC0 (base) (empty)
// CHECK-X64-NEXT: 16 | struct JC2 (base)
// CHECK-X64-NEXT: 16 | struct JC1 (primary base)
// CHECK-X64-NEXT: 16 | (JC1 vftable pointer)
// CHECK-X64-NEXT: 24 | struct JC0 (base) (empty)
// CHECK-X64-NEXT: | [sizeof=24, align=8
// CHECK-X64-NEXT: | nvsize=24, nvalign=8]
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
// CHECK-LABEL: 0 | struct RZ0{{$}}
// CHECK-NEXT: 0 | struct RX0 (base)
// CHECK-NEXT: 0 | struct RB (base)
// CHECK-NEXT: 0 | char c
// CHECK-NEXT: 1 | struct RA (base) (empty)
// CHECK-NEXT: 2 | struct RY (base) (empty)
// CHECK-NEXT: | [sizeof=2, align=1
// CHECK-NEXT: | nvsize=2, nvalign=1]
// CHECK-X64-LABEL: 0 | struct RZ0{{$}}
// CHECK-X64-NEXT: 0 | struct RX0 (base)
// CHECK-X64-NEXT: 0 | struct RB (base)
// CHECK-X64-NEXT: 0 | char c
// CHECK-X64-NEXT: 1 | struct RA (base) (empty)
// CHECK-X64-NEXT: 2 | struct RY (base) (empty)
// CHECK-X64-NEXT: | [sizeof=2, align=1
// CHECK-X64-NEXT: | nvsize=2, nvalign=1]
;
// CHECK-LABEL: 0 | struct RZ1{{$}}
// CHECK-NEXT: 0 | struct RX1 (base)
// CHECK-NEXT: 0 | struct RA (base) (empty)
// CHECK-NEXT: 0 | struct RB (base)
// CHECK-NEXT: 0 | char c
// CHECK-NEXT: 1 | struct RY (base) (empty)
// CHECK-NEXT: | [sizeof=1, align=1
// CHECK-NEXT: | nvsize=1, nvalign=1]
// CHECK-X64-LABEL: 0 | struct RZ1{{$}}
// CHECK-X64-NEXT: 0 | struct RX1 (base)
// CHECK-X64-NEXT: 0 | struct RA (base) (empty)
// CHECK-X64-NEXT: 0 | struct RB (base)
// CHECK-X64-NEXT: 0 | char c
// CHECK-X64-NEXT: 1 | struct RY (base) (empty)
// CHECK-X64-NEXT: | [sizeof=1, align=1
// CHECK-X64-NEXT: | nvsize=1, nvalign=1]
;
// CHECK-LABEL: 0 | struct RZ2{{$}}
// CHECK-NEXT: 0 | struct RX2 (base)
// CHECK-NEXT: 0 | struct RA (base) (empty)
// CHECK-NEXT: 0 | char a
// CHECK-NEXT: 2 | struct RY (base) (empty)
// CHECK-NEXT: | [sizeof=2, align=1
// CHECK-NEXT: | nvsize=2, nvalign=1]
// CHECK-X64-LABEL: 0 | struct RZ2{{$}}
// CHECK-X64-NEXT: 0 | struct RX2 (base)
// CHECK-X64-NEXT: 0 | struct RA (base) (empty)
// CHECK-X64-NEXT: 0 | char a
// CHECK-X64-NEXT: 2 | struct RY (base) (empty)
// CHECK-X64-NEXT: | [sizeof=2, align=1
// CHECK-X64-NEXT: | nvsize=2, nvalign=1]
;
// CHECK-LABEL: 0 | struct RZ3{{$}}
// CHECK-NEXT: 0 | struct RX3 (base)
// CHECK-NEXT: 0 | struct RA (base) (empty)
// CHECK-NEXT: 0 | struct RB a
// CHECK-NEXT: 0 | char c
// CHECK-NEXT: 1 | struct RY (base) (empty)
// CHECK-NEXT: | [sizeof=1, align=1
// CHECK-NEXT: | nvsize=1, nvalign=1]
// CHECK-X64-LABEL: 0 | struct RZ3{{$}}
// CHECK-X64-NEXT: 0 | struct RX3 (base)
// CHECK-X64-NEXT: 0 | struct RA (base) (empty)
// CHECK-X64-NEXT: 0 | struct RB a
// CHECK-X64-NEXT: 0 | char c
// CHECK-X64-NEXT: 1 | struct RY (base) (empty)
// CHECK-X64-NEXT: | [sizeof=1, align=1
// CHECK-X64-NEXT: | nvsize=1, nvalign=1]
;
// CHECK-LABEL: 0 | struct RZ4{{$}}
// CHECK-NEXT: 0 | struct RX4 (base)
// CHECK-NEXT: 0 | struct RA a (empty)
// CHECK-NEXT: 1 | char b
// CHECK-NEXT: 3 | struct RY (base) (empty)
// CHECK-NEXT: | [sizeof=3, align=1
// CHECK-NEXT: | nvsize=3, nvalign=1]
// CHECK-X64-LABEL: 0 | struct RZ4{{$}}
// CHECK-X64-NEXT: 0 | struct RX4 (base)
// CHECK-X64-NEXT: 0 | struct RA a (empty)
// CHECK-X64-NEXT: 1 | char b
// CHECK-X64-NEXT: 3 | struct RY (base) (empty)
// CHECK-X64-NEXT: | [sizeof=3, align=1
// CHECK-X64-NEXT: | nvsize=3, nvalign=1]
;
// CHECK-LABEL: 0 | struct RZ5{{$}}
// CHECK-NEXT: 0 | struct RX5 (base)
// CHECK-NEXT: 0 | struct RA a (empty)
// CHECK-NEXT: 1 | struct RB b
// CHECK-NEXT: 1 | char c
// CHECK-NEXT: 2 | struct RY (base) (empty)
// CHECK-NEXT: | [sizeof=2, align=1
// CHECK-NEXT: | nvsize=2, nvalign=1]
// CHECK-X64-LABEL: 0 | struct RZ5{{$}}
// CHECK-X64-NEXT: 0 | struct RX5 (base)
// CHECK-X64-NEXT: 0 | struct RA a (empty)
// CHECK-X64-NEXT: 1 | struct RB b
// CHECK-X64-NEXT: 1 | char c
// CHECK-X64-NEXT: 2 | struct RY (base) (empty)
// CHECK-X64-NEXT: | [sizeof=2, align=1
// CHECK-X64-NEXT: | nvsize=2, nvalign=1]
;
// CHECK-LABEL: 0 | struct RZ6{{$}}
// CHECK-NEXT: 0 | struct RX6 (base)
// CHECK-NEXT: 0 | (RX6 vbtable pointer)
// CHECK-NEXT: 4 | struct RB a
// CHECK-NEXT: 4 | char c
// CHECK-NEXT: 9 | struct RY (base) (empty)
// CHECK-NEXT: 12 | struct RV (virtual base) (empty)
// CHECK-NEXT: | [sizeof=12, align=4
// CHECK-NEXT: | nvsize=12, nvalign=4]
// CHECK-X64-LABEL: 0 | struct RZ6{{$}}
// CHECK-X64-NEXT: 0 | struct RX6 (base)
// CHECK-X64-NEXT: 0 | (RX6 vbtable pointer)
// CHECK-X64-NEXT: 8 | struct RB a
// CHECK-X64-NEXT: 8 | char c
// CHECK-X64-NEXT: 17 | struct RY (base) (empty)
// CHECK-X64-NEXT: 24 | struct RV (virtual base) (empty)
// CHECK-X64-NEXT: | [sizeof=24, align=8
// CHECK-X64-NEXT: | nvsize=24, nvalign=8]
;
// CHECK-LABEL: 0 | struct RZ7{{$}}
// CHECK-NEXT: 0 | struct RX7 (base)
// CHECK-NEXT: 0 | (RX7 vbtable pointer)
// CHECK-NEXT: 4 | struct RA a (empty)
// CHECK-NEXT: 8 | struct RY (base) (empty)
// CHECK-NEXT: 8 | struct RW (virtual base)
// CHECK-NEXT: 8 | char c
// CHECK-NEXT: | [sizeof=9, align=4
// CHECK-NEXT: | nvsize=8, nvalign=4]
// CHECK-X64-LABEL: 0 | struct RZ7{{$}}
// CHECK-X64-NEXT: 0 | struct RX7 (base)
// CHECK-X64-NEXT: 0 | (RX7 vbtable pointer)
// CHECK-X64-NEXT: 8 | struct RA a (empty)
// CHECK-X64-NEXT: 16 | struct RY (base) (empty)
// CHECK-X64-NEXT: 16 | struct RW (virtual base)
// CHECK-X64-NEXT: 16 | char c
// CHECK-X64-NEXT: | [sizeof=24, align=8
// CHECK-X64-NEXT: | nvsize=16, nvalign=8]
;
// CHECK-LABEL: 0 | struct RZ8{{$}}
// CHECK-NEXT: 0 | struct RX8 (base)
// CHECK-NEXT: 4 | struct RA (base) (empty)
// CHECK-NEXT: 0 | (RX8 vbtable pointer)
// CHECK-NEXT: 4 | struct RY (base) (empty)
// CHECK-NEXT: 4 | struct RW (virtual base)
// CHECK-NEXT: 4 | char c
// CHECK-NEXT: | [sizeof=5, align=4
// CHECK-NEXT: | nvsize=4, nvalign=4]
// CHECK-X64-LABEL: 0 | struct RZ8{{$}}
// CHECK-X64-NEXT: 0 | struct RX8 (base)
// CHECK-X64-NEXT: 8 | struct RA (base) (empty)
// CHECK-X64-NEXT: 0 | (RX8 vbtable pointer)
// CHECK-X64-NEXT: 8 | struct RY (base) (empty)
// CHECK-X64-NEXT: 8 | struct RW (virtual base)
// CHECK-X64-NEXT: 8 | char c
// CHECK-X64-NEXT: | [sizeof=16, align=8
// CHECK-X64-NEXT: | nvsize=8, nvalign=8]
;
;
;
;
// CHECK-LABEL: 0 | struct JD{{$}}
// CHECK-NEXT: 0 | (JD vbtable pointer)
// CHECK-NEXT: 4 | struct JB (virtual base) (empty)
// CHECK-NEXT: 4 | (vtordisp for vbase JC)
// CHECK-NEXT: 8 | struct JC (virtual base)
// CHECK-NEXT: 8 | (JC vftable pointer)
// CHECK-NEXT: 12 | struct JA (base) (empty)
// CHECK-NEXT: | [sizeof=12, align=4
// CHECK-NEXT: | nvsize=4, nvalign=4]
// CHECK-X64-LABEL: 0 | struct JD{{$}}
// CHECK-X64-NEXT: 0 | (JD vbtable pointer)
// CHECK-X64-NEXT: 8 | struct JB (virtual base) (empty)
// CHECK-X64-NEXT: 12 | (vtordisp for vbase JC)
// CHECK-X64-NEXT: 16 | struct JC (virtual base)
// CHECK-X64-NEXT: 16 | (JC vftable pointer)
// CHECK-X64-NEXT: 24 | struct JA (base) (empty)
// CHECK-X64-NEXT: | [sizeof=24, align=8
// CHECK-X64-NEXT: | nvsize=8, nvalign=8]
int a;