1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \ 2*f4a2713aSLionel Sambuc // RUN: | FileCheck %s 3*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \ 4*f4a2713aSLionel Sambuc // RUN: | FileCheck %s -check-prefix CHECK-X64 5*f4a2713aSLionel Sambuc 6*f4a2713aSLionel Sambuc extern "C" int printf(const char *fmt, ...); 7*f4a2713aSLionel Sambuc 8*f4a2713aSLionel Sambuc struct __declspec(align(8)) B0 { B0() {printf("B0 : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} }; 9*f4a2713aSLionel Sambuc struct __declspec(align(8)) B1 { B1() {printf("B1 : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} }; 10*f4a2713aSLionel Sambuc struct __declspec(align(8)) B2 { B2() {printf("B2 : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} }; 11*f4a2713aSLionel Sambuc struct __declspec(align(8)) B3 { B3() {printf("B3 : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} }; 12*f4a2713aSLionel Sambuc struct __declspec(align(8)) B4 { B4() {printf("B4 : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} }; 13*f4a2713aSLionel Sambuc 14*f4a2713aSLionel Sambuc struct C0 { int a; C0() : a(0xf00000C0) {printf("C0 : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} }; 15*f4a2713aSLionel Sambuc struct C1 { int a; C1() : a(0xf00000C1) {printf("C1 : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} }; 16*f4a2713aSLionel Sambuc struct C2 { int a; C2() : a(0xf00000C2) {printf("C2 : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} }; 17*f4a2713aSLionel Sambuc struct C3 { int a; C3() : a(0xf00000C3) {printf("C3 : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} }; 18*f4a2713aSLionel Sambuc struct C4 { int a; C4() : a(0xf00000C4) {printf("C4 : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} }; 19*f4a2713aSLionel Sambuc 20*f4a2713aSLionel Sambuc struct __declspec(align(16)) D0 { D0() {printf("D0 : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} virtual void f() {} }; 21*f4a2713aSLionel Sambuc struct D1 { D1() {printf("D1 : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} }; 22*f4a2713aSLionel Sambuc struct D2 { int a[8]; D2() {printf("D2 : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} }; 23*f4a2713aSLionel Sambuc 24*f4a2713aSLionel Sambuc struct A : virtual B0 { 25*f4a2713aSLionel Sambuc int a; 26*f4a2713aSLionel Sambuc A() : a(0xf000000A) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} 27*f4a2713aSLionel Sambuc }; 28*f4a2713aSLionel Sambuc 29*f4a2713aSLionel Sambuc // CHECK: *** Dumping AST Record Layout 30*f4a2713aSLionel Sambuc // CHECK: 0 | struct A 31*f4a2713aSLionel Sambuc // CHECK: 0 | (A vbtable pointer) 32*f4a2713aSLionel Sambuc // CHECK: 4 | int a 33*f4a2713aSLionel Sambuc // CHECK: 8 | struct B0 (virtual base) (empty) 34*f4a2713aSLionel Sambuc // CHECK: | [sizeof=8, align=8 35*f4a2713aSLionel Sambuc // CHECK: | nvsize=8, nvalign=4] 36*f4a2713aSLionel Sambuc // CHECK-X64: *** Dumping AST Record Layout 37*f4a2713aSLionel Sambuc // CHECK-X64: 0 | struct A 38*f4a2713aSLionel Sambuc // CHECK-X64: 0 | (A vbtable pointer) 39*f4a2713aSLionel Sambuc // CHECK-X64: 8 | int a 40*f4a2713aSLionel Sambuc // CHECK-X64: 16 | struct B0 (virtual base) (empty) 41*f4a2713aSLionel Sambuc // CHECK-X64: | [sizeof=16, align=8 42*f4a2713aSLionel Sambuc // CHECK-X64: | nvsize=16, nvalign=8] 43*f4a2713aSLionel Sambuc 44*f4a2713aSLionel Sambuc struct B : virtual B0 { 45*f4a2713aSLionel Sambuc B0 b0; 46*f4a2713aSLionel Sambuc int a; 47*f4a2713aSLionel Sambuc B() : a(0xf000000B) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} 48*f4a2713aSLionel Sambuc }; 49*f4a2713aSLionel Sambuc 50*f4a2713aSLionel Sambuc // CHECK: *** Dumping AST Record Layout 51*f4a2713aSLionel Sambuc // CHECK: 0 | struct B 52*f4a2713aSLionel Sambuc // CHECK: 0 | (B vbtable pointer) 53*f4a2713aSLionel Sambuc // CHECK: 8 | struct B0 b0 (empty) 54*f4a2713aSLionel Sambuc // CHECK: | [sizeof=8, align=8 55*f4a2713aSLionel Sambuc // CHECK: | nvsize=0, nvalign=1] 56*f4a2713aSLionel Sambuc // CHECK: 16 | int a 57*f4a2713aSLionel Sambuc // CHECK: 24 | struct B0 (virtual base) (empty) 58*f4a2713aSLionel Sambuc // CHECK: | [sizeof=24, align=8 59*f4a2713aSLionel Sambuc // CHECK: | nvsize=24, nvalign=8] 60*f4a2713aSLionel Sambuc // CHECK-X64: *** Dumping AST Record Layout 61*f4a2713aSLionel Sambuc // CHECK-X64: 0 | struct B 62*f4a2713aSLionel Sambuc // CHECK-X64: 0 | (B vbtable pointer) 63*f4a2713aSLionel Sambuc // CHECK-X64: 8 | struct B0 b0 (empty) 64*f4a2713aSLionel Sambuc // CHECK-X64: | [sizeof=8, align=8 65*f4a2713aSLionel Sambuc // CHECK-X64: | nvsize=0, nvalign=1] 66*f4a2713aSLionel Sambuc // CHECK-X64: 16 | int a 67*f4a2713aSLionel Sambuc // CHECK-X64: 24 | struct B0 (virtual base) (empty) 68*f4a2713aSLionel Sambuc // CHECK-X64: | [sizeof=24, align=8 69*f4a2713aSLionel Sambuc // CHECK-X64: | nvsize=24, nvalign=8] 70*f4a2713aSLionel Sambuc 71*f4a2713aSLionel Sambuc struct C : virtual B0, virtual B1, virtual B2, virtual B3, virtual B4 { 72*f4a2713aSLionel Sambuc int a; 73*f4a2713aSLionel Sambuc C() : a(0xf000000C) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} 74*f4a2713aSLionel Sambuc }; 75*f4a2713aSLionel Sambuc 76*f4a2713aSLionel Sambuc // CHECK: *** Dumping AST Record Layout 77*f4a2713aSLionel Sambuc // CHECK: 0 | struct C 78*f4a2713aSLionel Sambuc // CHECK: 0 | (C vbtable pointer) 79*f4a2713aSLionel Sambuc // CHECK: 4 | int a 80*f4a2713aSLionel Sambuc // CHECK: 8 | struct B0 (virtual base) (empty) 81*f4a2713aSLionel Sambuc // CHECK: 16 | struct B1 (virtual base) (empty) 82*f4a2713aSLionel Sambuc // CHECK: 24 | struct B2 (virtual base) (empty) 83*f4a2713aSLionel Sambuc // CHECK: 32 | struct B3 (virtual base) (empty) 84*f4a2713aSLionel Sambuc // CHECK: 40 | struct B4 (virtual base) (empty) 85*f4a2713aSLionel Sambuc // CHECK: | [sizeof=40, align=8 86*f4a2713aSLionel Sambuc // CHECK: | nvsize=8, nvalign=4] 87*f4a2713aSLionel Sambuc // CHECK-X64: *** Dumping AST Record Layout 88*f4a2713aSLionel Sambuc // CHECK-X64: 0 | struct C 89*f4a2713aSLionel Sambuc // CHECK-X64: 0 | (C vbtable pointer) 90*f4a2713aSLionel Sambuc // CHECK-X64: 8 | int a 91*f4a2713aSLionel Sambuc // CHECK-X64: 16 | struct B0 (virtual base) (empty) 92*f4a2713aSLionel Sambuc // CHECK-X64: 24 | struct B1 (virtual base) (empty) 93*f4a2713aSLionel Sambuc // CHECK-X64: 32 | struct B2 (virtual base) (empty) 94*f4a2713aSLionel Sambuc // CHECK-X64: 40 | struct B3 (virtual base) (empty) 95*f4a2713aSLionel Sambuc // CHECK-X64: 48 | struct B4 (virtual base) (empty) 96*f4a2713aSLionel Sambuc // CHECK-X64: | [sizeof=48, align=8 97*f4a2713aSLionel Sambuc // CHECK-X64: | nvsize=16, nvalign=8] 98*f4a2713aSLionel Sambuc 99*f4a2713aSLionel Sambuc struct D { 100*f4a2713aSLionel Sambuc B0 b0; 101*f4a2713aSLionel Sambuc C0 c0; 102*f4a2713aSLionel Sambuc C1 c1; 103*f4a2713aSLionel Sambuc C2 c2; 104*f4a2713aSLionel Sambuc B1 b1; 105*f4a2713aSLionel Sambuc int a; 106*f4a2713aSLionel Sambuc D() : a(0xf000000D) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} 107*f4a2713aSLionel Sambuc }; 108*f4a2713aSLionel Sambuc 109*f4a2713aSLionel Sambuc // CHECK: *** Dumping AST Record Layout 110*f4a2713aSLionel Sambuc // CHECK: 0 | struct D 111*f4a2713aSLionel Sambuc // CHECK: 0 | struct B0 b0 (empty) 112*f4a2713aSLionel Sambuc // CHECK: 8 | struct C0 c0 113*f4a2713aSLionel Sambuc // CHECK: 8 | int a 114*f4a2713aSLionel Sambuc // CHECK: 12 | struct C1 c1 115*f4a2713aSLionel Sambuc // CHECK: 12 | int a 116*f4a2713aSLionel Sambuc // CHECK: 16 | struct C2 c2 117*f4a2713aSLionel Sambuc // CHECK: 16 | int a 118*f4a2713aSLionel Sambuc // CHECK: 24 | struct B1 b1 (empty) 119*f4a2713aSLionel Sambuc // CHECK: 32 | int a 120*f4a2713aSLionel Sambuc // CHECK: | [sizeof=40, align=8 121*f4a2713aSLionel Sambuc // CHECK: | nvsize=40, nvalign=8] 122*f4a2713aSLionel Sambuc // CHECK-64: *** Dumping AST Record Layout 123*f4a2713aSLionel Sambuc // CHECK-64: 0 | struct D 124*f4a2713aSLionel Sambuc // CHECK-64: 0 | struct B0 b0 (empty) 125*f4a2713aSLionel Sambuc // CHECK-64: 8 | struct C0 c0 126*f4a2713aSLionel Sambuc // CHECK-64: 8 | int a 127*f4a2713aSLionel Sambuc // CHECK-64: 12 | struct C1 c1 128*f4a2713aSLionel Sambuc // CHECK-64: 12 | int a 129*f4a2713aSLionel Sambuc // CHECK-64: 16 | struct C2 c2 130*f4a2713aSLionel Sambuc // CHECK-64: 16 | int a 131*f4a2713aSLionel Sambuc // CHECK-64: 24 | struct B1 b1 (empty) 132*f4a2713aSLionel Sambuc // CHECK-64: 32 | int a 133*f4a2713aSLionel Sambuc // CHECK-64: | [sizeof=40, align=8 134*f4a2713aSLionel Sambuc // CHECK-64: | nvsize=40, nvalign=8] 135*f4a2713aSLionel Sambuc 136*f4a2713aSLionel Sambuc struct E : virtual B0, virtual C0, virtual C1, virtual C2, virtual B1 { 137*f4a2713aSLionel Sambuc int a; 138*f4a2713aSLionel Sambuc E() : a(0xf000000E) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} 139*f4a2713aSLionel Sambuc }; 140*f4a2713aSLionel Sambuc 141*f4a2713aSLionel Sambuc // CHECK: *** Dumping AST Record Layout 142*f4a2713aSLionel Sambuc // CHECK: 0 | struct E 143*f4a2713aSLionel Sambuc // CHECK: 0 | (E vbtable pointer) 144*f4a2713aSLionel Sambuc // CHECK: 4 | int a 145*f4a2713aSLionel Sambuc // CHECK: 8 | struct B0 (virtual base) (empty) 146*f4a2713aSLionel Sambuc // CHECK: 8 | struct C0 (virtual base) 147*f4a2713aSLionel Sambuc // CHECK: 8 | int a 148*f4a2713aSLionel Sambuc // CHECK: 12 | struct C1 (virtual base) 149*f4a2713aSLionel Sambuc // CHECK: 12 | int a 150*f4a2713aSLionel Sambuc // CHECK: 16 | struct C2 (virtual base) 151*f4a2713aSLionel Sambuc // CHECK: 16 | int a 152*f4a2713aSLionel Sambuc // CHECK: 24 | struct B1 (virtual base) (empty) 153*f4a2713aSLionel Sambuc // CHECK: | [sizeof=24, align=8 154*f4a2713aSLionel Sambuc // CHECK: | nvsize=8, nvalign=4] 155*f4a2713aSLionel Sambuc // CHECK-X64: *** Dumping AST Record Layout 156*f4a2713aSLionel Sambuc // CHECK-X64: 0 | struct E 157*f4a2713aSLionel Sambuc // CHECK-X64: 0 | (E vbtable pointer) 158*f4a2713aSLionel Sambuc // CHECK-X64: 8 | int a 159*f4a2713aSLionel Sambuc // CHECK-X64: 16 | struct B0 (virtual base) (empty) 160*f4a2713aSLionel Sambuc // CHECK-X64: 16 | struct C0 (virtual base) 161*f4a2713aSLionel Sambuc // CHECK-X64: 16 | int a 162*f4a2713aSLionel Sambuc // CHECK-X64: 20 | struct C1 (virtual base) 163*f4a2713aSLionel Sambuc // CHECK-X64: 20 | int a 164*f4a2713aSLionel Sambuc // CHECK-X64: 24 | struct C2 (virtual base) 165*f4a2713aSLionel Sambuc // CHECK-X64: 24 | int a 166*f4a2713aSLionel Sambuc // CHECK-X64: 32 | struct B1 (virtual base) (empty) 167*f4a2713aSLionel Sambuc // CHECK-X64: | [sizeof=32, align=8 168*f4a2713aSLionel Sambuc // CHECK-X64: | nvsize=16, nvalign=8] 169*f4a2713aSLionel Sambuc 170*f4a2713aSLionel Sambuc struct F : virtual C0, virtual B0, virtual B1, virtual C1 { 171*f4a2713aSLionel Sambuc int a; 172*f4a2713aSLionel Sambuc F() : a(0xf000000F) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} 173*f4a2713aSLionel Sambuc }; 174*f4a2713aSLionel Sambuc 175*f4a2713aSLionel Sambuc // CHECK: *** Dumping AST Record Layout 176*f4a2713aSLionel Sambuc // CHECK: 0 | struct F 177*f4a2713aSLionel Sambuc // CHECK: 0 | (F vbtable pointer) 178*f4a2713aSLionel Sambuc // CHECK: 4 | int a 179*f4a2713aSLionel Sambuc // CHECK: 8 | struct C0 (virtual base) 180*f4a2713aSLionel Sambuc // CHECK: 8 | int a 181*f4a2713aSLionel Sambuc // CHECK: 16 | struct B0 (virtual base) (empty) 182*f4a2713aSLionel Sambuc // CHECK: 24 | struct B1 (virtual base) (empty) 183*f4a2713aSLionel Sambuc // CHECK: 24 | struct C1 (virtual base) 184*f4a2713aSLionel Sambuc // CHECK: 24 | int a 185*f4a2713aSLionel Sambuc // CHECK: | [sizeof=32, align=8 186*f4a2713aSLionel Sambuc // CHECK: | nvsize=8, nvalign=4] 187*f4a2713aSLionel Sambuc // CHECK-X64: *** Dumping AST Record Layout 188*f4a2713aSLionel Sambuc // CHECK-X64: 0 | struct F 189*f4a2713aSLionel Sambuc // CHECK-X64: 0 | (F vbtable pointer) 190*f4a2713aSLionel Sambuc // CHECK-X64: 8 | int a 191*f4a2713aSLionel Sambuc // CHECK-X64: 16 | struct C0 (virtual base) 192*f4a2713aSLionel Sambuc // CHECK-X64: 16 | int a 193*f4a2713aSLionel Sambuc // CHECK-X64: 24 | struct B0 (virtual base) (empty) 194*f4a2713aSLionel Sambuc // CHECK-X64: 32 | struct B1 (virtual base) (empty) 195*f4a2713aSLionel Sambuc // CHECK-X64: 32 | struct C1 (virtual base) 196*f4a2713aSLionel Sambuc // CHECK-X64: 32 | int a 197*f4a2713aSLionel Sambuc // CHECK-X64: | [sizeof=40, align=8 198*f4a2713aSLionel Sambuc // CHECK-X64: | nvsize=16, nvalign=8] 199*f4a2713aSLionel Sambuc 200*f4a2713aSLionel Sambuc struct G : virtual C0, virtual B0, virtual B1, D0, virtual C1 { 201*f4a2713aSLionel Sambuc int a; 202*f4a2713aSLionel Sambuc G() : a(0xf0000010) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} 203*f4a2713aSLionel Sambuc virtual void f() {} 204*f4a2713aSLionel Sambuc }; 205*f4a2713aSLionel Sambuc 206*f4a2713aSLionel Sambuc // CHECK: *** Dumping AST Record Layout 207*f4a2713aSLionel Sambuc // CHECK: 0 | struct G 208*f4a2713aSLionel Sambuc // CHECK: 0 | struct D0 (primary base) 209*f4a2713aSLionel Sambuc // CHECK: 0 | (D0 vftable pointer) 210*f4a2713aSLionel Sambuc // CHECK: 4 | (G vbtable pointer) 211*f4a2713aSLionel Sambuc // CHECK: 20 | int a 212*f4a2713aSLionel Sambuc // CHECK: 32 | struct C0 (virtual base) 213*f4a2713aSLionel Sambuc // CHECK: 32 | int a 214*f4a2713aSLionel Sambuc // CHECK: 40 | struct B0 (virtual base) (empty) 215*f4a2713aSLionel Sambuc // CHECK: 56 | struct B1 (virtual base) (empty) 216*f4a2713aSLionel Sambuc // CHECK: 56 | struct C1 (virtual base) 217*f4a2713aSLionel Sambuc // CHECK: 56 | int a 218*f4a2713aSLionel Sambuc // CHECK: | [sizeof=64, align=16 219*f4a2713aSLionel Sambuc // CHECK: | nvsize=32, nvalign=16] 220*f4a2713aSLionel Sambuc // CHECK-X64: *** Dumping AST Record Layout 221*f4a2713aSLionel Sambuc // CHECK-X64: 0 | struct G 222*f4a2713aSLionel Sambuc // CHECK-X64: 0 | struct D0 (primary base) 223*f4a2713aSLionel Sambuc // CHECK-X64: 0 | (D0 vftable pointer) 224*f4a2713aSLionel Sambuc // CHECK-X64: 8 | (G vbtable pointer) 225*f4a2713aSLionel Sambuc // CHECK-X64: 16 | int a 226*f4a2713aSLionel Sambuc // CHECK-X64: 32 | struct C0 (virtual base) 227*f4a2713aSLionel Sambuc // CHECK-X64: 32 | int a 228*f4a2713aSLionel Sambuc // CHECK-X64: 40 | struct B0 (virtual base) (empty) 229*f4a2713aSLionel Sambuc // CHECK-X64: 56 | struct B1 (virtual base) (empty) 230*f4a2713aSLionel Sambuc // CHECK-X64: 56 | struct C1 (virtual base) 231*f4a2713aSLionel Sambuc // CHECK-X64: 56 | int a 232*f4a2713aSLionel Sambuc // CHECK-X64: | [sizeof=64, align=16 233*f4a2713aSLionel Sambuc // CHECK-X64: | nvsize=32, nvalign=16] 234*f4a2713aSLionel Sambuc 235*f4a2713aSLionel Sambuc struct H : virtual C0, virtual B0, virtual B1, virtual D0, virtual C1 { 236*f4a2713aSLionel Sambuc int a; 237*f4a2713aSLionel Sambuc H() : a(0xf0000011) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} 238*f4a2713aSLionel Sambuc virtual void f() {} 239*f4a2713aSLionel Sambuc }; 240*f4a2713aSLionel Sambuc 241*f4a2713aSLionel Sambuc // CHECK: *** Dumping AST Record Layout 242*f4a2713aSLionel Sambuc // CHECK: 0 | struct H 243*f4a2713aSLionel Sambuc // CHECK: 0 | (H vbtable pointer) 244*f4a2713aSLionel Sambuc // CHECK: 4 | int a 245*f4a2713aSLionel Sambuc // CHECK: 8 | struct C0 (virtual base) 246*f4a2713aSLionel Sambuc // CHECK: 8 | int a 247*f4a2713aSLionel Sambuc // CHECK: 16 | struct B0 (virtual base) (empty) 248*f4a2713aSLionel Sambuc // CHECK: 24 | struct B1 (virtual base) (empty) 249*f4a2713aSLionel Sambuc // CHECK: 44 | (vtordisp for vbase D0) 250*f4a2713aSLionel Sambuc // CHECK: 48 | struct D0 (virtual base) 251*f4a2713aSLionel Sambuc // CHECK: 48 | (D0 vftable pointer) 252*f4a2713aSLionel Sambuc // CHECK: 52 | struct C1 (virtual base) 253*f4a2713aSLionel Sambuc // CHECK: 52 | int a 254*f4a2713aSLionel Sambuc // CHECK: | [sizeof=64, align=16 255*f4a2713aSLionel Sambuc // CHECK: | nvsize=8, nvalign=4] 256*f4a2713aSLionel Sambuc // CHECK-X64: *** Dumping AST Record Layout 257*f4a2713aSLionel Sambuc // CHECK-X64: 0 | struct H 258*f4a2713aSLionel Sambuc // CHECK-X64: 0 | (H vbtable pointer) 259*f4a2713aSLionel Sambuc // CHECK-X64: 8 | int a 260*f4a2713aSLionel Sambuc // CHECK-X64: 16 | struct C0 (virtual base) 261*f4a2713aSLionel Sambuc // CHECK-X64: 16 | int a 262*f4a2713aSLionel Sambuc // CHECK-X64: 24 | struct B0 (virtual base) (empty) 263*f4a2713aSLionel Sambuc // CHECK-X64: 40 | struct B1 (virtual base) (empty) 264*f4a2713aSLionel Sambuc // CHECK-X64: 60 | (vtordisp for vbase D0) 265*f4a2713aSLionel Sambuc // CHECK-X64: 64 | struct D0 (virtual base) 266*f4a2713aSLionel Sambuc // CHECK-X64: 64 | (D0 vftable pointer) 267*f4a2713aSLionel Sambuc // CHECK-X64: 72 | struct C1 (virtual base) 268*f4a2713aSLionel Sambuc // CHECK-X64: 72 | int a 269*f4a2713aSLionel Sambuc // CHECK-X64: | [sizeof=80, align=16 270*f4a2713aSLionel Sambuc // CHECK-X64: | nvsize=16, nvalign=8] 271*f4a2713aSLionel Sambuc 272*f4a2713aSLionel Sambuc struct I : virtual B0, virtual B1, virtual B2, virtual B3, virtual B4 { 273*f4a2713aSLionel Sambuc __declspec(align(32)) int a; 274*f4a2713aSLionel Sambuc I() : a(0xf0000012) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} 275*f4a2713aSLionel Sambuc }; 276*f4a2713aSLionel Sambuc 277*f4a2713aSLionel Sambuc // CHECK: *** Dumping AST Record Layout 278*f4a2713aSLionel Sambuc // CHECK: 0 | struct I 279*f4a2713aSLionel Sambuc // CHECK: 0 | (I vbtable pointer) 280*f4a2713aSLionel Sambuc // CHECK: 32 | int a 281*f4a2713aSLionel Sambuc // CHECK: 64 | struct B0 (virtual base) (empty) 282*f4a2713aSLionel Sambuc // CHECK: 72 | struct B1 (virtual base) (empty) 283*f4a2713aSLionel Sambuc // CHECK: 104 | struct B2 (virtual base) (empty) 284*f4a2713aSLionel Sambuc // CHECK: 136 | struct B3 (virtual base) (empty) 285*f4a2713aSLionel Sambuc // CHECK: 168 | struct B4 (virtual base) (empty) 286*f4a2713aSLionel Sambuc // CHECK: | [sizeof=192, align=32 287*f4a2713aSLionel Sambuc // CHECK: | nvsize=64, nvalign=32] 288*f4a2713aSLionel Sambuc // CHECK-X64: *** Dumping AST Record Layout 289*f4a2713aSLionel Sambuc // CHECK-X64: 0 | struct I 290*f4a2713aSLionel Sambuc // CHECK-X64: 0 | (I vbtable pointer) 291*f4a2713aSLionel Sambuc // CHECK-X64: 32 | int a 292*f4a2713aSLionel Sambuc // CHECK-X64: 64 | struct B0 (virtual base) (empty) 293*f4a2713aSLionel Sambuc // CHECK-X64: 72 | struct B1 (virtual base) (empty) 294*f4a2713aSLionel Sambuc // CHECK-X64: 104 | struct B2 (virtual base) (empty) 295*f4a2713aSLionel Sambuc // CHECK-X64: 136 | struct B3 (virtual base) (empty) 296*f4a2713aSLionel Sambuc // CHECK-X64: 168 | struct B4 (virtual base) (empty) 297*f4a2713aSLionel Sambuc // CHECK-X64: | [sizeof=192, align=32 298*f4a2713aSLionel Sambuc // CHECK-X64: | nvsize=64, nvalign=32] 299*f4a2713aSLionel Sambuc 300*f4a2713aSLionel Sambuc struct __declspec(align(32)) J : virtual B0, virtual B1, virtual B2, virtual B3, virtual B4 { 301*f4a2713aSLionel Sambuc int a; 302*f4a2713aSLionel Sambuc J() : a(0xf0000012) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} 303*f4a2713aSLionel Sambuc }; 304*f4a2713aSLionel Sambuc 305*f4a2713aSLionel Sambuc // CHECK: *** Dumping AST Record Layout 306*f4a2713aSLionel Sambuc // CHECK: 0 | struct J 307*f4a2713aSLionel Sambuc // CHECK: 0 | (J vbtable pointer) 308*f4a2713aSLionel Sambuc // CHECK: 4 | int a 309*f4a2713aSLionel Sambuc // CHECK: 8 | struct B0 (virtual base) (empty) 310*f4a2713aSLionel Sambuc // CHECK: 40 | struct B1 (virtual base) (empty) 311*f4a2713aSLionel Sambuc // CHECK: 72 | struct B2 (virtual base) (empty) 312*f4a2713aSLionel Sambuc // CHECK: 104 | struct B3 (virtual base) (empty) 313*f4a2713aSLionel Sambuc // CHECK: 136 | struct B4 (virtual base) (empty) 314*f4a2713aSLionel Sambuc // CHECK: | [sizeof=160, align=32 315*f4a2713aSLionel Sambuc // CHECK: | nvsize=8, nvalign=4] 316*f4a2713aSLionel Sambuc // CHECK-X64: *** Dumping AST Record Layout 317*f4a2713aSLionel Sambuc // CHECK-X64: 0 | struct J 318*f4a2713aSLionel Sambuc // CHECK-X64: 0 | (J vbtable pointer) 319*f4a2713aSLionel Sambuc // CHECK-X64: 8 | int a 320*f4a2713aSLionel Sambuc // CHECK-X64: 16 | struct B0 (virtual base) (empty) 321*f4a2713aSLionel Sambuc // CHECK-X64: 40 | struct B1 (virtual base) (empty) 322*f4a2713aSLionel Sambuc // CHECK-X64: 72 | struct B2 (virtual base) (empty) 323*f4a2713aSLionel Sambuc // CHECK-X64: 104 | struct B3 (virtual base) (empty) 324*f4a2713aSLionel Sambuc // CHECK-X64: 136 | struct B4 (virtual base) (empty) 325*f4a2713aSLionel Sambuc // CHECK-X64: | [sizeof=160, align=32 326*f4a2713aSLionel Sambuc // CHECK-X64: | nvsize=16, nvalign=8] 327*f4a2713aSLionel Sambuc 328*f4a2713aSLionel Sambuc struct K : virtual D1, virtual B1, virtual B2, virtual B3, virtual B4 { 329*f4a2713aSLionel Sambuc __declspec(align(32)) int a; 330*f4a2713aSLionel Sambuc K() : a(0xf0000013) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} 331*f4a2713aSLionel Sambuc }; 332*f4a2713aSLionel Sambuc 333*f4a2713aSLionel Sambuc // CHECK: *** Dumping AST Record Layout 334*f4a2713aSLionel Sambuc // CHECK: 0 | struct K 335*f4a2713aSLionel Sambuc // CHECK: 0 | (K vbtable pointer) 336*f4a2713aSLionel Sambuc // CHECK: 32 | int a 337*f4a2713aSLionel Sambuc // CHECK: 64 | struct D1 (virtual base) (empty) 338*f4a2713aSLionel Sambuc // CHECK: 72 | struct B1 (virtual base) (empty) 339*f4a2713aSLionel Sambuc // CHECK: 104 | struct B2 (virtual base) (empty) 340*f4a2713aSLionel Sambuc // CHECK: 136 | struct B3 (virtual base) (empty) 341*f4a2713aSLionel Sambuc // CHECK: 168 | struct B4 (virtual base) (empty) 342*f4a2713aSLionel Sambuc // CHECK: | [sizeof=192, align=32 343*f4a2713aSLionel Sambuc // CHECK: | nvsize=64, nvalign=32] 344*f4a2713aSLionel Sambuc // CHECK-X64: *** Dumping AST Record Layout 345*f4a2713aSLionel Sambuc // CHECK-X64: 0 | struct K 346*f4a2713aSLionel Sambuc // CHECK-X64: 0 | (K vbtable pointer) 347*f4a2713aSLionel Sambuc // CHECK-X64: 32 | int a 348*f4a2713aSLionel Sambuc // CHECK-X64: 64 | struct D1 (virtual base) (empty) 349*f4a2713aSLionel Sambuc // CHECK-X64: 72 | struct B1 (virtual base) (empty) 350*f4a2713aSLionel Sambuc // CHECK-X64: 104 | struct B2 (virtual base) (empty) 351*f4a2713aSLionel Sambuc // CHECK-X64: 136 | struct B3 (virtual base) (empty) 352*f4a2713aSLionel Sambuc // CHECK-X64: 168 | struct B4 (virtual base) (empty) 353*f4a2713aSLionel Sambuc // CHECK-X64: | [sizeof=192, align=32 354*f4a2713aSLionel Sambuc // CHECK-X64: | nvsize=64, nvalign=32] 355*f4a2713aSLionel Sambuc 356*f4a2713aSLionel Sambuc struct L : virtual B1, virtual D1, virtual B2, virtual B3, virtual B4 { 357*f4a2713aSLionel Sambuc __declspec(align(32)) int a; 358*f4a2713aSLionel Sambuc L() : a(0xf0000014) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} 359*f4a2713aSLionel Sambuc }; 360*f4a2713aSLionel Sambuc 361*f4a2713aSLionel Sambuc // CHECK: *** Dumping AST Record Layout 362*f4a2713aSLionel Sambuc // CHECK: 0 | struct L 363*f4a2713aSLionel Sambuc // CHECK: 0 | (L vbtable pointer) 364*f4a2713aSLionel Sambuc // CHECK: 32 | int a 365*f4a2713aSLionel Sambuc // CHECK: 64 | struct B1 (virtual base) (empty) 366*f4a2713aSLionel Sambuc // CHECK: 68 | struct D1 (virtual base) (empty) 367*f4a2713aSLionel Sambuc // CHECK: 104 | struct B2 (virtual base) (empty) 368*f4a2713aSLionel Sambuc // CHECK: 136 | struct B3 (virtual base) (empty) 369*f4a2713aSLionel Sambuc // CHECK: 168 | struct B4 (virtual base) (empty) 370*f4a2713aSLionel Sambuc // CHECK: | [sizeof=192, align=32 371*f4a2713aSLionel Sambuc // CHECK: | nvsize=64, nvalign=32] 372*f4a2713aSLionel Sambuc // CHECK-X64: *** Dumping AST Record Layout 373*f4a2713aSLionel Sambuc // CHECK-X64: 0 | struct L 374*f4a2713aSLionel Sambuc // CHECK-X64: 0 | (L vbtable pointer) 375*f4a2713aSLionel Sambuc // CHECK-X64: 32 | int a 376*f4a2713aSLionel Sambuc // CHECK-X64: 64 | struct B1 (virtual base) (empty) 377*f4a2713aSLionel Sambuc // CHECK-X64: 68 | struct D1 (virtual base) (empty) 378*f4a2713aSLionel Sambuc // CHECK-X64: 104 | struct B2 (virtual base) (empty) 379*f4a2713aSLionel Sambuc // CHECK-X64: 136 | struct B3 (virtual base) (empty) 380*f4a2713aSLionel Sambuc // CHECK-X64: 168 | struct B4 (virtual base) (empty) 381*f4a2713aSLionel Sambuc // CHECK-X64: | [sizeof=192, align=32 382*f4a2713aSLionel Sambuc // CHECK-X64: | nvsize=64, nvalign=32] 383*f4a2713aSLionel Sambuc 384*f4a2713aSLionel Sambuc struct M : virtual B1, virtual B2, virtual D1, virtual B3, virtual B4 { 385*f4a2713aSLionel Sambuc __declspec(align(32)) int a; 386*f4a2713aSLionel Sambuc M() : a(0xf0000015) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} 387*f4a2713aSLionel Sambuc }; 388*f4a2713aSLionel Sambuc 389*f4a2713aSLionel Sambuc // CHECK: *** Dumping AST Record Layout 390*f4a2713aSLionel Sambuc // CHECK: 0 | struct M 391*f4a2713aSLionel Sambuc // CHECK: 0 | (M vbtable pointer) 392*f4a2713aSLionel Sambuc // CHECK: 32 | int a 393*f4a2713aSLionel Sambuc // CHECK: 64 | struct B1 (virtual base) (empty) 394*f4a2713aSLionel Sambuc // CHECK: 72 | struct B2 (virtual base) (empty) 395*f4a2713aSLionel Sambuc // CHECK: 100 | struct D1 (virtual base) (empty) 396*f4a2713aSLionel Sambuc // CHECK: 136 | struct B3 (virtual base) (empty) 397*f4a2713aSLionel Sambuc // CHECK: 168 | struct B4 (virtual base) (empty) 398*f4a2713aSLionel Sambuc // CHECK: | [sizeof=192, align=32 399*f4a2713aSLionel Sambuc // CHECK: | nvsize=64, nvalign=32] 400*f4a2713aSLionel Sambuc // CHECK-X64: *** Dumping AST Record Layout 401*f4a2713aSLionel Sambuc // CHECK-X64: 0 | struct M 402*f4a2713aSLionel Sambuc // CHECK-X64: 0 | (M vbtable pointer) 403*f4a2713aSLionel Sambuc // CHECK-X64: 32 | int a 404*f4a2713aSLionel Sambuc // CHECK-X64: 64 | struct B1 (virtual base) (empty) 405*f4a2713aSLionel Sambuc // CHECK-X64: 72 | struct B2 (virtual base) (empty) 406*f4a2713aSLionel Sambuc // CHECK-X64: 100 | struct D1 (virtual base) (empty) 407*f4a2713aSLionel Sambuc // CHECK-X64: 136 | struct B3 (virtual base) (empty) 408*f4a2713aSLionel Sambuc // CHECK-X64: 168 | struct B4 (virtual base) (empty) 409*f4a2713aSLionel Sambuc // CHECK-X64: | [sizeof=192, align=32 410*f4a2713aSLionel Sambuc // CHECK-X64: | nvsize=64, nvalign=32] 411*f4a2713aSLionel Sambuc 412*f4a2713aSLionel Sambuc struct N : virtual C0, virtual B1, virtual D1, virtual B2, virtual B3, virtual B4 { 413*f4a2713aSLionel Sambuc __declspec(align(32)) int a; 414*f4a2713aSLionel Sambuc N() : a(0xf0000016) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} 415*f4a2713aSLionel Sambuc }; 416*f4a2713aSLionel Sambuc 417*f4a2713aSLionel Sambuc // CHECK: *** Dumping AST Record Layout 418*f4a2713aSLionel Sambuc // CHECK: 0 | struct N 419*f4a2713aSLionel Sambuc // CHECK: 0 | (N vbtable pointer) 420*f4a2713aSLionel Sambuc // CHECK: 32 | int a 421*f4a2713aSLionel Sambuc // CHECK: 64 | struct C0 (virtual base) 422*f4a2713aSLionel Sambuc // CHECK: 64 | int a 423*f4a2713aSLionel Sambuc // CHECK: 72 | struct B1 (virtual base) (empty) 424*f4a2713aSLionel Sambuc // CHECK: 100 | struct D1 (virtual base) (empty) 425*f4a2713aSLionel Sambuc // CHECK: 136 | struct B2 (virtual base) (empty) 426*f4a2713aSLionel Sambuc // CHECK: 168 | struct B3 (virtual base) (empty) 427*f4a2713aSLionel Sambuc // CHECK: 200 | struct B4 (virtual base) (empty) 428*f4a2713aSLionel Sambuc // CHECK: | [sizeof=224, align=32 429*f4a2713aSLionel Sambuc // CHECK: | nvsize=64, nvalign=32] 430*f4a2713aSLionel Sambuc // CHECK-X64: *** Dumping AST Record Layout 431*f4a2713aSLionel Sambuc // CHECK-X64: 0 | struct N 432*f4a2713aSLionel Sambuc // CHECK-X64: 0 | (N vbtable pointer) 433*f4a2713aSLionel Sambuc // CHECK-X64: 32 | int a 434*f4a2713aSLionel Sambuc // CHECK-X64: 64 | struct C0 (virtual base) 435*f4a2713aSLionel Sambuc // CHECK-X64: 64 | int a 436*f4a2713aSLionel Sambuc // CHECK-X64: 72 | struct B1 (virtual base) (empty) 437*f4a2713aSLionel Sambuc // CHECK-X64: 100 | struct D1 (virtual base) (empty) 438*f4a2713aSLionel Sambuc // CHECK-X64: 136 | struct B2 (virtual base) (empty) 439*f4a2713aSLionel Sambuc // CHECK-X64: 168 | struct B3 (virtual base) (empty) 440*f4a2713aSLionel Sambuc // CHECK-X64: 200 | struct B4 (virtual base) (empty) 441*f4a2713aSLionel Sambuc // CHECK-X64: | [sizeof=224, align=32 442*f4a2713aSLionel Sambuc // CHECK-X64: | nvsize=64, nvalign=32] 443*f4a2713aSLionel Sambuc 444*f4a2713aSLionel Sambuc struct O : virtual C0, virtual B1, virtual B2, virtual D1, virtual B3, virtual B4 { 445*f4a2713aSLionel Sambuc __declspec(align(32)) int a; 446*f4a2713aSLionel Sambuc O() : a(0xf0000017) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} 447*f4a2713aSLionel Sambuc }; 448*f4a2713aSLionel Sambuc 449*f4a2713aSLionel Sambuc // CHECK: *** Dumping AST Record Layout 450*f4a2713aSLionel Sambuc // CHECK: 0 | struct O 451*f4a2713aSLionel Sambuc // CHECK: 0 | (O vbtable pointer) 452*f4a2713aSLionel Sambuc // CHECK: 32 | int a 453*f4a2713aSLionel Sambuc // CHECK: 64 | struct C0 (virtual base) 454*f4a2713aSLionel Sambuc // CHECK: 64 | int a 455*f4a2713aSLionel Sambuc // CHECK: 72 | struct B1 (virtual base) (empty) 456*f4a2713aSLionel Sambuc // CHECK: 104 | struct B2 (virtual base) (empty) 457*f4a2713aSLionel Sambuc // CHECK: 132 | struct D1 (virtual base) (empty) 458*f4a2713aSLionel Sambuc // CHECK: 168 | struct B3 (virtual base) (empty) 459*f4a2713aSLionel Sambuc // CHECK: 200 | struct B4 (virtual base) (empty) 460*f4a2713aSLionel Sambuc // CHECK: | [sizeof=224, align=32 461*f4a2713aSLionel Sambuc // CHECK: | nvsize=64, nvalign=32] 462*f4a2713aSLionel Sambuc // CHECK-X64: *** Dumping AST Record Layout 463*f4a2713aSLionel Sambuc // CHECK-X64: 0 | struct O 464*f4a2713aSLionel Sambuc // CHECK-X64: 0 | (O vbtable pointer) 465*f4a2713aSLionel Sambuc // CHECK-X64: 32 | int a 466*f4a2713aSLionel Sambuc // CHECK-X64: 64 | struct C0 (virtual base) 467*f4a2713aSLionel Sambuc // CHECK-X64: 64 | int a 468*f4a2713aSLionel Sambuc // CHECK-X64: 72 | struct B1 (virtual base) (empty) 469*f4a2713aSLionel Sambuc // CHECK-X64: 104 | struct B2 (virtual base) (empty) 470*f4a2713aSLionel Sambuc // CHECK-X64: 132 | struct D1 (virtual base) (empty) 471*f4a2713aSLionel Sambuc // CHECK-X64: 168 | struct B3 (virtual base) (empty) 472*f4a2713aSLionel Sambuc // CHECK-X64: 200 | struct B4 (virtual base) (empty) 473*f4a2713aSLionel Sambuc // CHECK-X64: | [sizeof=224, align=32 474*f4a2713aSLionel Sambuc // CHECK-X64: | nvsize=64, nvalign=32] 475*f4a2713aSLionel Sambuc 476*f4a2713aSLionel Sambuc struct P : virtual B1, virtual C0, virtual D1, virtual B2, virtual B3, virtual B4 { 477*f4a2713aSLionel Sambuc __declspec(align(32)) int a; 478*f4a2713aSLionel Sambuc P() : a(0xf0000018) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} 479*f4a2713aSLionel Sambuc }; 480*f4a2713aSLionel Sambuc 481*f4a2713aSLionel Sambuc // CHECK: *** Dumping AST Record Layout 482*f4a2713aSLionel Sambuc // CHECK: 0 | struct P 483*f4a2713aSLionel Sambuc // CHECK: 0 | (P vbtable pointer) 484*f4a2713aSLionel Sambuc // CHECK: 32 | int a 485*f4a2713aSLionel Sambuc // CHECK: 64 | struct B1 (virtual base) (empty) 486*f4a2713aSLionel Sambuc // CHECK: 64 | struct C0 (virtual base) 487*f4a2713aSLionel Sambuc // CHECK: 64 | int a 488*f4a2713aSLionel Sambuc // CHECK: 68 | struct D1 (virtual base) (empty) 489*f4a2713aSLionel Sambuc // CHECK: 104 | struct B2 (virtual base) (empty) 490*f4a2713aSLionel Sambuc // CHECK: 136 | struct B3 (virtual base) (empty) 491*f4a2713aSLionel Sambuc // CHECK: 168 | struct B4 (virtual base) (empty) 492*f4a2713aSLionel Sambuc // CHECK: | [sizeof=192, align=32 493*f4a2713aSLionel Sambuc // CHECK: | nvsize=64, nvalign=32] 494*f4a2713aSLionel Sambuc // CHECK-X64: *** Dumping AST Record Layout 495*f4a2713aSLionel Sambuc // CHECK-X64: 0 | struct P 496*f4a2713aSLionel Sambuc // CHECK-X64: 0 | (P vbtable pointer) 497*f4a2713aSLionel Sambuc // CHECK-X64: 32 | int a 498*f4a2713aSLionel Sambuc // CHECK-X64: 64 | struct B1 (virtual base) (empty) 499*f4a2713aSLionel Sambuc // CHECK-X64: 64 | struct C0 (virtual base) 500*f4a2713aSLionel Sambuc // CHECK-X64: 64 | int a 501*f4a2713aSLionel Sambuc // CHECK-X64: 68 | struct D1 (virtual base) (empty) 502*f4a2713aSLionel Sambuc // CHECK-X64: 104 | struct B2 (virtual base) (empty) 503*f4a2713aSLionel Sambuc // CHECK-X64: 136 | struct B3 (virtual base) (empty) 504*f4a2713aSLionel Sambuc // CHECK-X64: 168 | struct B4 (virtual base) (empty) 505*f4a2713aSLionel Sambuc // CHECK-X64: | [sizeof=192, align=32 506*f4a2713aSLionel Sambuc // CHECK-X64: | nvsize=64, nvalign=32] 507*f4a2713aSLionel Sambuc 508*f4a2713aSLionel Sambuc struct Q : virtual B1, virtual C0, virtual B2, virtual D1, virtual B3, virtual B4 { 509*f4a2713aSLionel Sambuc __declspec(align(32)) int a; 510*f4a2713aSLionel Sambuc Q() : a(0xf0000019) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} 511*f4a2713aSLionel Sambuc }; 512*f4a2713aSLionel Sambuc 513*f4a2713aSLionel Sambuc // CHECK: *** Dumping AST Record Layout 514*f4a2713aSLionel Sambuc // CHECK: 0 | struct Q 515*f4a2713aSLionel Sambuc // CHECK: 0 | (Q vbtable pointer) 516*f4a2713aSLionel Sambuc // CHECK: 32 | int a 517*f4a2713aSLionel Sambuc // CHECK: 64 | struct B1 (virtual base) (empty) 518*f4a2713aSLionel Sambuc // CHECK: 64 | struct C0 (virtual base) 519*f4a2713aSLionel Sambuc // CHECK: 64 | int a 520*f4a2713aSLionel Sambuc // CHECK: 72 | struct B2 (virtual base) (empty) 521*f4a2713aSLionel Sambuc // CHECK: 100 | struct D1 (virtual base) (empty) 522*f4a2713aSLionel Sambuc // CHECK: 136 | struct B3 (virtual base) (empty) 523*f4a2713aSLionel Sambuc // CHECK: 168 | struct B4 (virtual base) (empty) 524*f4a2713aSLionel Sambuc // CHECK: | [sizeof=192, align=32 525*f4a2713aSLionel Sambuc // CHECK: | nvsize=64, nvalign=32] 526*f4a2713aSLionel Sambuc // CHECK-X64: *** Dumping AST Record Layout 527*f4a2713aSLionel Sambuc // CHECK-X64: 0 | struct Q 528*f4a2713aSLionel Sambuc // CHECK-X64: 0 | (Q vbtable pointer) 529*f4a2713aSLionel Sambuc // CHECK-X64: 32 | int a 530*f4a2713aSLionel Sambuc // CHECK-X64: 64 | struct B1 (virtual base) (empty) 531*f4a2713aSLionel Sambuc // CHECK-X64: 64 | struct C0 (virtual base) 532*f4a2713aSLionel Sambuc // CHECK-X64: 64 | int a 533*f4a2713aSLionel Sambuc // CHECK-X64: 72 | struct B2 (virtual base) (empty) 534*f4a2713aSLionel Sambuc // CHECK-X64: 100 | struct D1 (virtual base) (empty) 535*f4a2713aSLionel Sambuc // CHECK-X64: 136 | struct B3 (virtual base) (empty) 536*f4a2713aSLionel Sambuc // CHECK-X64: 168 | struct B4 (virtual base) (empty) 537*f4a2713aSLionel Sambuc // CHECK-X64: | [sizeof=192, align=32 538*f4a2713aSLionel Sambuc // CHECK-X64: | nvsize=64, nvalign=32] 539*f4a2713aSLionel Sambuc 540*f4a2713aSLionel Sambuc struct R : virtual B0, virtual B1, virtual B2, virtual C0, virtual B3, virtual B4 { 541*f4a2713aSLionel Sambuc __declspec(align(32)) int a; 542*f4a2713aSLionel Sambuc R() : a(0xf0000020) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} 543*f4a2713aSLionel Sambuc }; 544*f4a2713aSLionel Sambuc 545*f4a2713aSLionel Sambuc // CHECK: *** Dumping AST Record Layout 546*f4a2713aSLionel Sambuc // CHECK: 0 | struct R 547*f4a2713aSLionel Sambuc // CHECK: 0 | (R vbtable pointer) 548*f4a2713aSLionel Sambuc // CHECK: 32 | int a 549*f4a2713aSLionel Sambuc // CHECK: 64 | struct B0 (virtual base) (empty) 550*f4a2713aSLionel Sambuc // CHECK: 72 | struct B1 (virtual base) (empty) 551*f4a2713aSLionel Sambuc // CHECK: 104 | struct B2 (virtual base) (empty) 552*f4a2713aSLionel Sambuc // CHECK: 104 | struct C0 (virtual base) 553*f4a2713aSLionel Sambuc // CHECK: 104 | int a 554*f4a2713aSLionel Sambuc // CHECK: 112 | struct B3 (virtual base) (empty) 555*f4a2713aSLionel Sambuc // CHECK: 136 | struct B4 (virtual base) (empty) 556*f4a2713aSLionel Sambuc // CHECK: | [sizeof=160, align=32 557*f4a2713aSLionel Sambuc // CHECK: | nvsize=64, nvalign=32] 558*f4a2713aSLionel Sambuc // CHECK-X64: *** Dumping AST Record Layout 559*f4a2713aSLionel Sambuc // CHECK-X64: 0 | struct R 560*f4a2713aSLionel Sambuc // CHECK-X64: 0 | (R vbtable pointer) 561*f4a2713aSLionel Sambuc // CHECK-X64: 32 | int a 562*f4a2713aSLionel Sambuc // CHECK-X64: 64 | struct B0 (virtual base) (empty) 563*f4a2713aSLionel Sambuc // CHECK-X64: 72 | struct B1 (virtual base) (empty) 564*f4a2713aSLionel Sambuc // CHECK-X64: 104 | struct B2 (virtual base) (empty) 565*f4a2713aSLionel Sambuc // CHECK-X64: 104 | struct C0 (virtual base) 566*f4a2713aSLionel Sambuc // CHECK-X64: 104 | int a 567*f4a2713aSLionel Sambuc // CHECK-X64: 112 | struct B3 (virtual base) (empty) 568*f4a2713aSLionel Sambuc // CHECK-X64: 136 | struct B4 (virtual base) (empty) 569*f4a2713aSLionel Sambuc // CHECK-X64: | [sizeof=160, align=32 570*f4a2713aSLionel Sambuc // CHECK-X64: | nvsize=64, nvalign=32] 571*f4a2713aSLionel Sambuc 572*f4a2713aSLionel Sambuc struct S : virtual B0, virtual B1, virtual C0, virtual B2, virtual B3, virtual B4 { 573*f4a2713aSLionel Sambuc __declspec(align(32)) int a; 574*f4a2713aSLionel Sambuc S() : a(0xf0000021) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} 575*f4a2713aSLionel Sambuc }; 576*f4a2713aSLionel Sambuc 577*f4a2713aSLionel Sambuc // CHECK: *** Dumping AST Record Layout 578*f4a2713aSLionel Sambuc // CHECK: 0 | struct S 579*f4a2713aSLionel Sambuc // CHECK: 0 | (S vbtable pointer) 580*f4a2713aSLionel Sambuc // CHECK: 32 | int a 581*f4a2713aSLionel Sambuc // CHECK: 64 | struct B0 (virtual base) (empty) 582*f4a2713aSLionel Sambuc // CHECK: 72 | struct B1 (virtual base) (empty) 583*f4a2713aSLionel Sambuc // CHECK: 72 | struct C0 (virtual base) 584*f4a2713aSLionel Sambuc // CHECK: 72 | int a 585*f4a2713aSLionel Sambuc // CHECK: 80 | struct B2 (virtual base) (empty) 586*f4a2713aSLionel Sambuc // CHECK: 104 | struct B3 (virtual base) (empty) 587*f4a2713aSLionel Sambuc // CHECK: 136 | struct B4 (virtual base) (empty) 588*f4a2713aSLionel Sambuc // CHECK: | [sizeof=160, align=32 589*f4a2713aSLionel Sambuc // CHECK: | nvsize=64, nvalign=32] 590*f4a2713aSLionel Sambuc // CHECK-X64: *** Dumping AST Record Layout 591*f4a2713aSLionel Sambuc // CHECK-X64: 0 | struct S 592*f4a2713aSLionel Sambuc // CHECK-X64: 0 | (S vbtable pointer) 593*f4a2713aSLionel Sambuc // CHECK-X64: 32 | int a 594*f4a2713aSLionel Sambuc // CHECK-X64: 64 | struct B0 (virtual base) (empty) 595*f4a2713aSLionel Sambuc // CHECK-X64: 72 | struct B1 (virtual base) (empty) 596*f4a2713aSLionel Sambuc // CHECK-X64: 72 | struct C0 (virtual base) 597*f4a2713aSLionel Sambuc // CHECK-X64: 72 | int a 598*f4a2713aSLionel Sambuc // CHECK-X64: 80 | struct B2 (virtual base) (empty) 599*f4a2713aSLionel Sambuc // CHECK-X64: 104 | struct B3 (virtual base) (empty) 600*f4a2713aSLionel Sambuc // CHECK-X64: 136 | struct B4 (virtual base) (empty) 601*f4a2713aSLionel Sambuc // CHECK-X64: | [sizeof=160, align=32 602*f4a2713aSLionel Sambuc // CHECK-X64: | nvsize=64, nvalign=32] 603*f4a2713aSLionel Sambuc 604*f4a2713aSLionel Sambuc struct T : virtual B0, virtual B1, virtual C0, virtual D2, virtual B2, virtual B3, virtual B4 { 605*f4a2713aSLionel Sambuc __declspec(align(16)) int a; 606*f4a2713aSLionel Sambuc T() : a(0xf0000022) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} 607*f4a2713aSLionel Sambuc }; 608*f4a2713aSLionel Sambuc 609*f4a2713aSLionel Sambuc // CHECK: *** Dumping AST Record Layout 610*f4a2713aSLionel Sambuc // CHECK: 0 | struct T 611*f4a2713aSLionel Sambuc // CHECK: 0 | (T vbtable pointer) 612*f4a2713aSLionel Sambuc // CHECK: 16 | int a 613*f4a2713aSLionel Sambuc // CHECK: 32 | struct B0 (virtual base) (empty) 614*f4a2713aSLionel Sambuc // CHECK: 40 | struct B1 (virtual base) (empty) 615*f4a2713aSLionel Sambuc // CHECK: 40 | struct C0 (virtual base) 616*f4a2713aSLionel Sambuc // CHECK: 40 | int a 617*f4a2713aSLionel Sambuc // CHECK: 44 | struct D2 (virtual base) 618*f4a2713aSLionel Sambuc // CHECK: 44 | int [8] a 619*f4a2713aSLionel Sambuc // CHECK: 80 | struct B2 (virtual base) (empty) 620*f4a2713aSLionel Sambuc // CHECK: 88 | struct B3 (virtual base) (empty) 621*f4a2713aSLionel Sambuc // CHECK: 104 | struct B4 (virtual base) (empty) 622*f4a2713aSLionel Sambuc // CHECK: | [sizeof=112, align=16 623*f4a2713aSLionel Sambuc // CHECK: | nvsize=32, nvalign=16] 624*f4a2713aSLionel Sambuc // CHECK-X64: *** Dumping AST Record Layout 625*f4a2713aSLionel Sambuc // CHECK-X64: 0 | struct T 626*f4a2713aSLionel Sambuc // CHECK-X64: 0 | (T vbtable pointer) 627*f4a2713aSLionel Sambuc // CHECK-X64: 16 | int a 628*f4a2713aSLionel Sambuc // CHECK-X64: 32 | struct B0 (virtual base) (empty) 629*f4a2713aSLionel Sambuc // CHECK-X64: 40 | struct B1 (virtual base) (empty) 630*f4a2713aSLionel Sambuc // CHECK-X64: 40 | struct C0 (virtual base) 631*f4a2713aSLionel Sambuc // CHECK-X64: 40 | int a 632*f4a2713aSLionel Sambuc // CHECK-X64: 44 | struct D2 (virtual base) 633*f4a2713aSLionel Sambuc // CHECK-X64: 44 | int [8] a 634*f4a2713aSLionel Sambuc // CHECK-X64: 80 | struct B2 (virtual base) (empty) 635*f4a2713aSLionel Sambuc // CHECK-X64: 88 | struct B3 (virtual base) (empty) 636*f4a2713aSLionel Sambuc // CHECK-X64: 104 | struct B4 (virtual base) (empty) 637*f4a2713aSLionel Sambuc // CHECK-X64: | [sizeof=112, align=16 638*f4a2713aSLionel Sambuc // CHECK-X64: | nvsize=32, nvalign=16] 639*f4a2713aSLionel Sambuc 640*f4a2713aSLionel Sambuc struct __declspec(align(32)) U : virtual B0, virtual B1 { 641*f4a2713aSLionel Sambuc int a; 642*f4a2713aSLionel Sambuc U() : a(0xf0000023) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} 643*f4a2713aSLionel Sambuc }; 644*f4a2713aSLionel Sambuc 645*f4a2713aSLionel Sambuc // CHECK: *** Dumping AST Record Layout 646*f4a2713aSLionel Sambuc // CHECK: 0 | struct U 647*f4a2713aSLionel Sambuc // CHECK: 0 | (U vbtable pointer) 648*f4a2713aSLionel Sambuc // CHECK: 4 | int a 649*f4a2713aSLionel Sambuc // CHECK: 8 | struct B0 (virtual base) (empty) 650*f4a2713aSLionel Sambuc // CHECK: 40 | struct B1 (virtual base) (empty) 651*f4a2713aSLionel Sambuc // CHECK: | [sizeof=64, align=32 652*f4a2713aSLionel Sambuc // CHECK: | nvsize=8, nvalign=4] 653*f4a2713aSLionel Sambuc // CHECK-X64: *** Dumping AST Record Layout 654*f4a2713aSLionel Sambuc // CHECK-X64: 0 | struct U 655*f4a2713aSLionel Sambuc // CHECK-X64: 0 | (U vbtable pointer) 656*f4a2713aSLionel Sambuc // CHECK-X64: 8 | int a 657*f4a2713aSLionel Sambuc // CHECK-X64: 16 | struct B0 (virtual base) (empty) 658*f4a2713aSLionel Sambuc // CHECK-X64: 40 | struct B1 (virtual base) (empty) 659*f4a2713aSLionel Sambuc // CHECK-X64: | [sizeof=64, align=32 660*f4a2713aSLionel Sambuc // CHECK-X64: | nvsize=16, nvalign=8] 661*f4a2713aSLionel Sambuc 662*f4a2713aSLionel Sambuc struct __declspec(align(32)) V : virtual D1 { 663*f4a2713aSLionel Sambuc int a; 664*f4a2713aSLionel Sambuc V() : a(0xf0000024) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} 665*f4a2713aSLionel Sambuc }; 666*f4a2713aSLionel Sambuc 667*f4a2713aSLionel Sambuc // CHECK: *** Dumping AST Record Layout 668*f4a2713aSLionel Sambuc // CHECK: 0 | struct V 669*f4a2713aSLionel Sambuc // CHECK: 0 | (V vbtable pointer) 670*f4a2713aSLionel Sambuc // CHECK: 4 | int a 671*f4a2713aSLionel Sambuc // CHECK: 8 | struct D1 (virtual base) (empty) 672*f4a2713aSLionel Sambuc // CHECK: | [sizeof=32, align=32 673*f4a2713aSLionel Sambuc // CHECK: | nvsize=8, nvalign=4] 674*f4a2713aSLionel Sambuc // CHECK-X64: *** Dumping AST Record Layout 675*f4a2713aSLionel Sambuc // CHECK-X64: 0 | struct V 676*f4a2713aSLionel Sambuc // CHECK-X64: 0 | (V vbtable pointer) 677*f4a2713aSLionel Sambuc // CHECK-X64: 8 | int a 678*f4a2713aSLionel Sambuc // CHECK-X64: 16 | struct D1 (virtual base) (empty) 679*f4a2713aSLionel Sambuc // CHECK-X64: | [sizeof=32, align=32 680*f4a2713aSLionel Sambuc // CHECK-X64: | nvsize=16, nvalign=8] 681*f4a2713aSLionel Sambuc 682*f4a2713aSLionel Sambuc int a[ 683*f4a2713aSLionel Sambuc sizeof(A)+ 684*f4a2713aSLionel Sambuc sizeof(B)+ 685*f4a2713aSLionel Sambuc sizeof(C)+ 686*f4a2713aSLionel Sambuc sizeof(D)+ 687*f4a2713aSLionel Sambuc sizeof(E)+ 688*f4a2713aSLionel Sambuc sizeof(F)+ 689*f4a2713aSLionel Sambuc sizeof(G)+ 690*f4a2713aSLionel Sambuc sizeof(H)+ 691*f4a2713aSLionel Sambuc sizeof(I)+ 692*f4a2713aSLionel Sambuc sizeof(J)+ 693*f4a2713aSLionel Sambuc sizeof(K)+ 694*f4a2713aSLionel Sambuc sizeof(L)+ 695*f4a2713aSLionel Sambuc sizeof(M)+ 696*f4a2713aSLionel Sambuc sizeof(N)+ 697*f4a2713aSLionel Sambuc sizeof(O)+ 698*f4a2713aSLionel Sambuc sizeof(P)+ 699*f4a2713aSLionel Sambuc sizeof(Q)+ 700*f4a2713aSLionel Sambuc sizeof(R)+ 701*f4a2713aSLionel Sambuc sizeof(S)+ 702*f4a2713aSLionel Sambuc sizeof(T)+ 703*f4a2713aSLionel Sambuc sizeof(U)+ 704*f4a2713aSLionel Sambuc sizeof(V)];