From: Warren Hunt Date: Thu, 12 Dec 2013 22:33:37 +0000 (+0000) Subject: [ms-abi] Refactoring Non-virtual base layout in record layout X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4248ceef32e469eaa046394dd7d8c371f2a2380d;p=clang [ms-abi] Refactoring Non-virtual base layout in record layout This refactor addresses bugzilla bug 18167 and simplifies the code at the same time. Also I add a test case for the bug. Also I make a non-functional change to the basic layout lit tests to make them more reliable (using CHECK-NEXT instead of CHECK). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197183 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/RecordLayoutBuilder.cpp b/lib/AST/RecordLayoutBuilder.cpp index 5e68ad249e..0cb8bd8151 100644 --- a/lib/AST/RecordLayoutBuilder.cpp +++ b/lib/AST/RecordLayoutBuilder.cpp @@ -2273,7 +2273,7 @@ MicrosoftRecordLayoutBuilder::initializeCXXLayout(const CXXRecordDecl *RD) { // Handle required alignment. RequiredAlignment = std::max(RequiredAlignment, Layout.getRequiredAlignment()); - // Check for zero sized subobjects + // Check for zero sized subobjects. if (Layout.hasZeroSizedSubObject()) HasZeroSizedSubObject = true; // Handle virtual bases. @@ -2347,72 +2347,53 @@ MicrosoftRecordLayoutBuilder::layoutNonVirtualBases(const CXXRecordDecl *RD) { continue; const CXXRecordDecl *BaseDecl = cast(i->getType()->castAs()->getDecl()); + if (BaseDecl == PrimaryBase) + continue; + const ASTRecordLayout &Layout = Context.getASTRecordLayout(BaseDecl); if (!LeadingBase) { - const ASTRecordLayout &Layout = Context.getASTRecordLayout(BaseDecl); LeadsWithZeroSizedBase = Layout.leadsWithZeroSizedBase(); LeadingBase = BaseDecl; } - if (BaseDecl != PrimaryBase) + + if (LazyEmptyBase) { + layoutNonVirtualBase(LazyEmptyBase); + LazyEmptyBase = 0; + } + // Insert padding between two bases if the left first one is zero sized or + // contains a zero sized subobject and the right is zero sized or one leads + // with a zero sized base. + if (PreviousBaseLayout && PreviousBaseLayout->hasZeroSizedSubObject() && + Layout.leadsWithZeroSizedBase()) + Size++; + if (Layout.getNonVirtualSize().isZero()) + LazyEmptyBase = BaseDecl; + else layoutNonVirtualBase(BaseDecl); } } void MicrosoftRecordLayoutBuilder::layoutNonVirtualBase(const CXXRecordDecl *RD) { - const ASTRecordLayout *Layout = RD ? &Context.getASTRecordLayout(RD) : 0; - - // If we have a lazy empty base we haven't laid out yet, do that now. - if (LazyEmptyBase) { - const ASTRecordLayout &LazyLayout = - Context.getASTRecordLayout(LazyEmptyBase); - Size = Size.RoundUpToAlignment(getBaseAlignment(LazyLayout)); - // If the last non-virtual base has a vbptr we add a byte of padding for no - // obvious reason. - if (PreviousBaseLayout && PreviousBaseLayout->hasVBPtr()) - Size++; - Bases.insert(std::make_pair(LazyEmptyBase, Size)); - // Empty bases only consume space when followed by another empty base. - if (RD && Layout->getNonVirtualSize().isZero()) - Size++; - LazyEmptyBase = 0; - PreviousBaseLayout = &LazyLayout; - } - - // RD is null when flushing the final lazy base. - if (!RD) - return; - - if (Layout->getNonVirtualSize().isZero()) { - LazyEmptyBase = RD; - return; - } - - // Insert padding between two bases if the left first one is zero sized or - // contains a zero sized subobject and the right is zero sized or one leads - // with a zero sized base. - if (PreviousBaseLayout && PreviousBaseLayout->hasZeroSizedSubObject() && - Layout->leadsWithZeroSizedBase()) - Size++; + const ASTRecordLayout &Layout = Context.getASTRecordLayout(RD); // Insert the base here. - CharUnits BaseOffset = Size.RoundUpToAlignment(getBaseAlignment(*Layout)); + CharUnits BaseOffset = Size.RoundUpToAlignment(getBaseAlignment(Layout)); Bases.insert(std::make_pair(RD, BaseOffset)); - Size = BaseOffset + Layout->getDataSize(); - // Note: we don't update alignment here because it was accounted - // for during initalization. - PreviousBaseLayout = Layout; + Size = BaseOffset + Layout.getDataSize(); + // Alignment was upadated in InitializeCXXLayout. + PreviousBaseLayout = &Layout; } void MicrosoftRecordLayoutBuilder::layoutVBPtr(const CXXRecordDecl *RD) { if (!HasVBPtr) VBPtrOffset = CharUnits::fromQuantity(-1); - else if (SharedVBPtrBase) { - const ASTRecordLayout &Layout = Context.getASTRecordLayout(SharedVBPtrBase); - VBPtrOffset = Bases[SharedVBPtrBase] + Layout.getVBPtrOffset(); - } else { + else if (SharedVBPtrBase) + VBPtrOffset = Bases[SharedVBPtrBase] + + Context.getASTRecordLayout(SharedVBPtrBase).getVBPtrOffset(); + else { VBPtrOffset = Size.RoundUpToAlignment(PointerAlignment); CharUnits OldSize = Size; Size = VBPtrOffset + PointerSize; - if (BasesAndFieldsAlignment <= PointerAlignment) { + if (BasesAndFieldsAlignment <= PointerAlignment) // Handle strange padding rules for the lazily placed base. I have no // explanation for why the last virtual base is padded in such an odd way. // Two things to note about this padding are that the rules are different @@ -2420,7 +2401,7 @@ void MicrosoftRecordLayoutBuilder::layoutVBPtr(const CXXRecordDecl *RD) { // pointer and that the rule in 64-bit mode behaves differently depending // on if the second to last base was also zero sized. Size += OldSize % BasesAndFieldsAlignment.getQuantity(); - } else { + else { if (!Is64BitMode) Size = OldSize + BasesAndFieldsAlignment; else if (PreviousBaseLayout && @@ -2429,9 +2410,8 @@ void MicrosoftRecordLayoutBuilder::layoutVBPtr(const CXXRecordDecl *RD) { } updateAlignment(PointerAlignment); } - - // Flush the lazy empty base. - layoutNonVirtualBase(0); + if (LazyEmptyBase) + layoutNonVirtualBase(LazyEmptyBase); } void MicrosoftRecordLayoutBuilder::layoutFields(const RecordDecl *RD) { @@ -2541,12 +2521,14 @@ void MicrosoftRecordLayoutBuilder::fixSizeAndAlignment(const RecordDecl *RD) { NonVirtualAlignment = Alignment; RequiredAlignment = std::max(RequiredAlignment, Context.toCharUnitsFromBits(RD->getMaxAlignment())); + updateAlignment(RequiredAlignment); } void MicrosoftRecordLayoutBuilder::layoutVirtualBases(const CXXRecordDecl *RD) { if (!HasVBPtr) return; + // Update the alignment for (CXXRecordDecl::base_class_const_iterator i = RD->vbases_begin(), e = RD->vbases_end(); i != e; ++i) { @@ -2557,11 +2539,6 @@ void MicrosoftRecordLayoutBuilder::layoutVirtualBases(const CXXRecordDecl *RD) { } PreviousBaseLayout = 0; - // Zero-sized v-bases obey the alignment attribute so apply it here. The - // alignment attribute is normally accounted for in FinalizeLayout. - if (unsigned MaxAlign = RD->getMaxAlignment()) - updateAlignment(Context.toCharUnitsFromBits(MaxAlign)); - llvm::SmallPtrSet HasVtordisp = computeVtorDispSet(RD); @@ -2582,30 +2559,25 @@ void MicrosoftRecordLayoutBuilder::layoutVirtualBases(const CXXRecordDecl *RD) { void MicrosoftRecordLayoutBuilder::layoutVirtualBase(const CXXRecordDecl *RD, bool HasVtordisp) { const ASTRecordLayout &Layout = Context.getASTRecordLayout(RD); + const CharUnits Four = CharUnits::fromQuantity(4); // Insert padding between two bases if the left first one is zero sized or // contains a zero sized subobject and the right is zero sized or one leads // with a zero sized base. The minimal padding between virtual bases is 4 // bytes (in both 32 and 64 bits modes), we don't know why. if (PreviousBaseLayout && PreviousBaseLayout->hasZeroSizedSubObject() && Layout.leadsWithZeroSizedBase()) - Size = Size.RoundUpToAlignment(std::max(CharUnits::fromQuantity(4), - RequiredAlignment)) + - CharUnits::fromQuantity(4); - - CharUnits BaseNVSize = Layout.getNonVirtualSize(); - CharUnits BaseAlign = getBaseAlignment(Layout); + Size = Size.RoundUpToAlignment(std::max(Four, RequiredAlignment)) + Four; // vtordisps are always 4 bytes (even in 64-bit mode) if (HasVtordisp) - Size = Size.RoundUpToAlignment(Alignment) + CharUnits::fromQuantity(4); + Size = Size.RoundUpToAlignment(Alignment) + Four; // Insert the base here. - Size = Size.RoundUpToAlignment(BaseAlign); + Size = Size.RoundUpToAlignment(getBaseAlignment(Layout)); VBases.insert( std::make_pair(RD, ASTRecordLayout::VBaseInfo(Size, HasVtordisp))); - Size += BaseNVSize; + Size += Layout.getNonVirtualSize(); // Alignment was upadated in InitializeCXXLayout. - PreviousBaseLayout = &Layout; } @@ -2616,10 +2588,8 @@ void MicrosoftRecordLayoutBuilder::finalizeLayout(const RecordDecl *RD) { Size = Alignment; } - if (!RequiredAlignment.isZero()) { - updateAlignment(RequiredAlignment); + if (!RequiredAlignment.isZero()) Size = Size.RoundUpToAlignment(Alignment); - } } static bool diff --git a/test/Layout/ms-x86-basic-layout.cpp b/test/Layout/ms-x86-basic-layout.cpp index 86b3553b0b..b65930b450 100644 --- a/test/Layout/ms-x86-basic-layout.cpp +++ b/test/Layout/ms-x86-basic-layout.cpp @@ -38,25 +38,29 @@ struct TestF0 : A4, virtual B4 { }; // CHECK: *** Dumping AST Record Layout -// CHECK: 0 | struct TestF0 -// CHECK: 0 | struct A4 (base) -// CHECK: 0 | int a -// CHECK: 4 | (TestF0 vbtable pointer) -// CHECK: 8 | int a -// CHECK: 12 | struct B4 (virtual base) -// CHECK: 12 | int a -// CHECK: | [sizeof=16, align=4 -// CHECK: | nvsize=12, nvalign=4] +// CHECK: *** Dumping AST Record Layout +// CHECK: *** Dumping AST Record Layout +// CHECK-NEXT: 0 | struct TestF0 +// CHECK-NEXT: 0 | struct A4 (base) +// CHECK-NEXT: 0 | int a +// CHECK-NEXT: 4 | (TestF0 vbtable pointer) +// CHECK-NEXT: 8 | int a +// CHECK-NEXT: 12 | struct B4 (virtual base) +// CHECK-NEXT: 12 | int a +// CHECK-NEXT: | [sizeof=16, align=4 +// CHECK-NEXT: | nvsize=12, nvalign=4] +// CHECK-X64: *** Dumping AST Record Layout // CHECK-X64: *** Dumping AST Record Layout -// CHECK-X64: 0 | struct TestF0 -// CHECK-X64: 0 | struct A4 (base) -// CHECK-X64: 0 | int a -// CHECK-X64: 8 | (TestF0 vbtable pointer) -// CHECK-X64: 16 | int a -// CHECK-X64: 24 | struct B4 (virtual base) -// CHECK-X64: 24 | int a -// CHECK-X64: | [sizeof=32, align=8 -// CHECK-X64: | nvsize=24, nvalign=8] +// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64-NEXT: 0 | struct TestF0 +// CHECK-X64-NEXT: 0 | struct A4 (base) +// CHECK-X64-NEXT: 0 | int a +// CHECK-X64-NEXT: 8 | (TestF0 vbtable pointer) +// CHECK-X64-NEXT: 16 | int a +// CHECK-X64-NEXT: 24 | struct B4 (virtual base) +// CHECK-X64-NEXT: 24 | int a +// CHECK-X64-NEXT: | [sizeof=32, align=8 +// CHECK-X64-NEXT: | nvsize=24, nvalign=8] struct TestF1 : A4, virtual A16 { int a; @@ -64,25 +68,27 @@ struct TestF1 : A4, virtual A16 { }; // CHECK: *** Dumping AST Record Layout -// CHECK: 0 | struct TestF1 -// CHECK: 0 | struct A4 (base) -// CHECK: 0 | int a -// CHECK: 4 | (TestF1 vbtable pointer) -// CHECK: 8 | int a -// CHECK: 16 | struct A16 (virtual base) -// CHECK: 16 | int a -// CHECK: | [sizeof=32, align=16 -// CHECK: | nvsize=12, nvalign=4] +// CHECK: *** Dumping AST Record Layout +// CHECK-NEXT: 0 | struct TestF1 +// CHECK-NEXT: 0 | struct A4 (base) +// CHECK-NEXT: 0 | int a +// CHECK-NEXT: 4 | (TestF1 vbtable pointer) +// CHECK-NEXT: 8 | int a +// CHECK-NEXT: 16 | struct A16 (virtual base) +// CHECK-NEXT: 16 | int a +// CHECK-NEXT: | [sizeof=32, align=16 +// CHECK-NEXT: | nvsize=12, nvalign=4] // CHECK-X64: *** Dumping AST Record Layout -// CHECK-X64: 0 | struct TestF1 -// CHECK-X64: 0 | struct A4 (base) -// CHECK-X64: 0 | int a -// CHECK-X64: 8 | (TestF1 vbtable pointer) -// CHECK-X64: 16 | int a -// CHECK-X64: 32 | struct A16 (virtual base) -// CHECK-X64: 32 | int a -// CHECK-X64: | [sizeof=48, align=16 -// CHECK-X64: | nvsize=24, nvalign=8] +// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64-NEXT: 0 | struct TestF1 +// CHECK-X64-NEXT: 0 | struct A4 (base) +// CHECK-X64-NEXT: 0 | int a +// CHECK-X64-NEXT: 8 | (TestF1 vbtable pointer) +// CHECK-X64-NEXT: 16 | int a +// CHECK-X64-NEXT: 32 | struct A16 (virtual base) +// CHECK-X64-NEXT: 32 | int a +// CHECK-X64-NEXT: | [sizeof=48, align=16 +// CHECK-X64-NEXT: | nvsize=24, nvalign=8] struct TestF2 : A4, virtual C4 { int a; @@ -90,27 +96,29 @@ struct TestF2 : A4, virtual C4 { }; // CHECK: *** Dumping AST Record Layout -// CHECK: 0 | struct TestF2 -// CHECK: 0 | struct A4 (base) -// CHECK: 0 | int a -// CHECK: 4 | (TestF2 vbtable pointer) -// CHECK: 8 | int a -// CHECK: 12 | struct C4 (virtual base) -// CHECK: 12 | (C4 vftable pointer) -// CHECK: 16 | int a -// CHECK: | [sizeof=20, align=4 -// CHECK: | nvsize=12, nvalign=4] +// CHECK: *** Dumping AST Record Layout +// CHECK-NEXT: 0 | struct TestF2 +// CHECK-NEXT: 0 | struct A4 (base) +// CHECK-NEXT: 0 | int a +// CHECK-NEXT: 4 | (TestF2 vbtable pointer) +// CHECK-NEXT: 8 | int a +// CHECK-NEXT: 12 | struct C4 (virtual base) +// CHECK-NEXT: 12 | (C4 vftable pointer) +// CHECK-NEXT: 16 | int a +// CHECK-NEXT: | [sizeof=20, align=4 +// CHECK-NEXT: | nvsize=12, nvalign=4] // CHECK-X64: *** Dumping AST Record Layout -// CHECK-X64: 0 | struct TestF2 -// CHECK-X64: 0 | struct A4 (base) -// CHECK-X64: 0 | int a -// CHECK-X64: 8 | (TestF2 vbtable pointer) -// CHECK-X64: 16 | int a -// CHECK-X64: 24 | struct C4 (virtual base) -// CHECK-X64: 24 | (C4 vftable pointer) -// CHECK-X64: 32 | int a -// CHECK-X64: | [sizeof=40, align=8 -// CHECK-X64: | nvsize=24, nvalign=8] +// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64-NEXT: 0 | struct TestF2 +// CHECK-X64-NEXT: 0 | struct A4 (base) +// CHECK-X64-NEXT: 0 | int a +// CHECK-X64-NEXT: 8 | (TestF2 vbtable pointer) +// CHECK-X64-NEXT: 16 | int a +// CHECK-X64-NEXT: 24 | struct C4 (virtual base) +// CHECK-X64-NEXT: 24 | (C4 vftable pointer) +// CHECK-X64-NEXT: 32 | int a +// CHECK-X64-NEXT: | [sizeof=40, align=8 +// CHECK-X64-NEXT: | nvsize=24, nvalign=8] struct TestF3 : A4, virtual C16 { int a; @@ -118,27 +126,29 @@ struct TestF3 : A4, virtual C16 { }; // CHECK: *** Dumping AST Record Layout -// CHECK: 0 | struct TestF3 -// CHECK: 0 | struct A4 (base) -// CHECK: 0 | int a -// CHECK: 4 | (TestF3 vbtable pointer) -// CHECK: 8 | int a -// CHECK: 16 | struct C16 (virtual base) -// CHECK: 16 | (C16 vftable pointer) -// CHECK: 32 | int a -// CHECK: | [sizeof=48, align=16 -// CHECK: | nvsize=12, nvalign=4] +// CHECK: *** Dumping AST Record Layout +// CHECK-NEXT: 0 | struct TestF3 +// CHECK-NEXT: 0 | struct A4 (base) +// CHECK-NEXT: 0 | int a +// CHECK-NEXT: 4 | (TestF3 vbtable pointer) +// CHECK-NEXT: 8 | int a +// CHECK-NEXT: 16 | struct C16 (virtual base) +// CHECK-NEXT: 16 | (C16 vftable pointer) +// CHECK-NEXT: 32 | int a +// CHECK-NEXT: | [sizeof=48, align=16 +// CHECK-NEXT: | nvsize=12, nvalign=4] // CHECK-X64: *** Dumping AST Record Layout -// CHECK-X64: 0 | struct TestF3 -// CHECK-X64: 0 | struct A4 (base) -// CHECK-X64: 0 | int a -// CHECK-X64: 8 | (TestF3 vbtable pointer) -// CHECK-X64: 16 | int a -// CHECK-X64: 32 | struct C16 (virtual base) -// CHECK-X64: 32 | (C16 vftable pointer) -// CHECK-X64: 48 | int a -// CHECK-X64: | [sizeof=64, align=16 -// CHECK-X64: | nvsize=24, nvalign=8] +// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64-NEXT: 0 | struct TestF3 +// CHECK-X64-NEXT: 0 | struct A4 (base) +// CHECK-X64-NEXT: 0 | int a +// CHECK-X64-NEXT: 8 | (TestF3 vbtable pointer) +// CHECK-X64-NEXT: 16 | int a +// CHECK-X64-NEXT: 32 | struct C16 (virtual base) +// CHECK-X64-NEXT: 32 | (C16 vftable pointer) +// CHECK-X64-NEXT: 48 | int a +// CHECK-X64-NEXT: | [sizeof=64, align=16 +// CHECK-X64-NEXT: | nvsize=24, nvalign=8] struct TestF4 : TestF3, A4 { int a; @@ -146,35 +156,35 @@ struct TestF4 : TestF3, A4 { }; // CHECK: *** Dumping AST Record Layout -// CHECK: 0 | struct TestF4 -// CHECK: 0 | struct TestF3 (base) -// CHECK: 0 | struct A4 (base) -// CHECK: 0 | int a -// CHECK: 4 | (TestF3 vbtable pointer) -// CHECK: 8 | int a -// CHECK: 12 | struct A4 (base) -// CHECK: 12 | int a -// CHECK: 16 | int a -// CHECK: 32 | struct C16 (virtual base) -// CHECK: 32 | (C16 vftable pointer) -// CHECK: 48 | int a -// CHECK: | [sizeof=64, align=16 -// CHECK: | nvsize=32, nvalign=16] +// CHECK-NEXT: 0 | struct TestF4 +// CHECK-NEXT: 0 | struct TestF3 (base) +// CHECK-NEXT: 0 | struct A4 (base) +// CHECK-NEXT: 0 | int a +// CHECK-NEXT: 4 | (TestF3 vbtable pointer) +// CHECK-NEXT: 8 | int a +// CHECK-NEXT: 12 | struct A4 (base) +// CHECK-NEXT: 12 | int a +// CHECK-NEXT: 16 | int a +// CHECK-NEXT: 32 | struct C16 (virtual base) +// CHECK-NEXT: 32 | (C16 vftable pointer) +// CHECK-NEXT: 48 | int a +// CHECK-NEXT: | [sizeof=64, align=16 +// CHECK-NEXT: | nvsize=32, nvalign=16] // CHECK-X64: *** Dumping AST Record Layout -// CHECK-X64: 0 | struct TestF4 -// CHECK-X64: 0 | struct TestF3 (base) -// CHECK-X64: 0 | struct A4 (base) -// CHECK-X64: 0 | int a -// CHECK-X64: 8 | (TestF3 vbtable pointer) -// CHECK-X64: 16 | int a -// CHECK-X64: 24 | struct A4 (base) -// CHECK-X64: 24 | int a -// CHECK-X64: 28 | int a -// CHECK-X64: 32 | struct C16 (virtual base) -// CHECK-X64: 32 | (C16 vftable pointer) -// CHECK-X64: 48 | int a -// CHECK-X64: | [sizeof=64, align=16 -// CHECK-X64: | nvsize=32, nvalign=16] +// CHECK-X64-NEXT: 0 | struct TestF4 +// CHECK-X64-NEXT: 0 | struct TestF3 (base) +// CHECK-X64-NEXT: 0 | struct A4 (base) +// CHECK-X64-NEXT: 0 | int a +// CHECK-X64-NEXT: 8 | (TestF3 vbtable pointer) +// CHECK-X64-NEXT: 16 | int a +// CHECK-X64-NEXT: 24 | struct A4 (base) +// CHECK-X64-NEXT: 24 | int a +// CHECK-X64-NEXT: 28 | int a +// CHECK-X64-NEXT: 32 | struct C16 (virtual base) +// CHECK-X64-NEXT: 32 | (C16 vftable pointer) +// CHECK-X64-NEXT: 48 | int a +// CHECK-X64-NEXT: | [sizeof=64, align=16 +// CHECK-X64-NEXT: | nvsize=32, nvalign=16] struct TestF5 : TestF3, A4 { int a; @@ -183,37 +193,37 @@ struct TestF5 : TestF3, A4 { }; // CHECK: *** Dumping AST Record Layout -// CHECK: 0 | struct TestF5 -// CHECK: 0 | (TestF5 vftable pointer) -// CHECK: 16 | struct TestF3 (base) -// CHECK: 16 | struct A4 (base) -// CHECK: 16 | int a -// CHECK: 20 | (TestF3 vbtable pointer) -// CHECK: 24 | int a -// CHECK: 28 | struct A4 (base) -// CHECK: 28 | int a -// CHECK: 32 | int a -// CHECK: 48 | struct C16 (virtual base) -// CHECK: 48 | (C16 vftable pointer) -// CHECK: 64 | int a -// CHECK: | [sizeof=80, align=16 -// CHECK: | nvsize=48, nvalign=16] +// CHECK-NEXT: 0 | struct TestF5 +// CHECK-NEXT: 0 | (TestF5 vftable pointer) +// CHECK-NEXT: 16 | struct TestF3 (base) +// CHECK-NEXT: 16 | struct A4 (base) +// CHECK-NEXT: 16 | int a +// CHECK-NEXT: 20 | (TestF3 vbtable pointer) +// CHECK-NEXT: 24 | int a +// CHECK-NEXT: 28 | struct A4 (base) +// CHECK-NEXT: 28 | int a +// CHECK-NEXT: 32 | int a +// CHECK-NEXT: 48 | struct C16 (virtual base) +// CHECK-NEXT: 48 | (C16 vftable pointer) +// CHECK-NEXT: 64 | int a +// CHECK-NEXT: | [sizeof=80, align=16 +// CHECK-NEXT: | nvsize=48, nvalign=16] // CHECK-X64: *** Dumping AST Record Layout -// CHECK-X64: 0 | struct TestF5 -// CHECK-X64: 0 | (TestF5 vftable pointer) -// CHECK-X64: 16 | struct TestF3 (base) -// CHECK-X64: 16 | struct A4 (base) -// CHECK-X64: 16 | int a -// CHECK-X64: 24 | (TestF3 vbtable pointer) -// CHECK-X64: 32 | int a -// CHECK-X64: 40 | struct A4 (base) -// CHECK-X64: 40 | int a -// CHECK-X64: 44 | int a -// CHECK-X64: 48 | struct C16 (virtual base) -// CHECK-X64: 48 | (C16 vftable pointer) -// CHECK-X64: 64 | int a -// CHECK-X64: | [sizeof=80, align=16 -// CHECK-X64: | nvsize=48, nvalign=16] +// CHECK-X64-NEXT: 0 | struct TestF5 +// CHECK-X64-NEXT: 0 | (TestF5 vftable pointer) +// CHECK-X64-NEXT: 16 | struct TestF3 (base) +// CHECK-X64-NEXT: 16 | struct A4 (base) +// CHECK-X64-NEXT: 16 | int a +// CHECK-X64-NEXT: 24 | (TestF3 vbtable pointer) +// CHECK-X64-NEXT: 32 | int a +// CHECK-X64-NEXT: 40 | struct A4 (base) +// CHECK-X64-NEXT: 40 | int a +// CHECK-X64-NEXT: 44 | int a +// CHECK-X64-NEXT: 48 | struct C16 (virtual base) +// CHECK-X64-NEXT: 48 | (C16 vftable pointer) +// CHECK-X64-NEXT: 64 | int a +// CHECK-X64-NEXT: | [sizeof=80, align=16 +// CHECK-X64-NEXT: | nvsize=48, nvalign=16] struct TestF6 : TestF3, A4 { int a; @@ -222,37 +232,37 @@ struct TestF6 : TestF3, A4 { }; // CHECK: *** Dumping AST Record Layout -// CHECK: 0 | struct TestF6 -// CHECK: 0 | struct TestF3 (base) -// CHECK: 0 | struct A4 (base) -// CHECK: 0 | int a -// CHECK: 4 | (TestF3 vbtable pointer) -// CHECK: 8 | int a -// CHECK: 12 | struct A4 (base) -// CHECK: 12 | int a -// CHECK: 16 | int a -// CHECK: 44 | (vtordisp for vbase C16) -// CHECK: 48 | struct C16 (virtual base) -// CHECK: 48 | (C16 vftable pointer) -// CHECK: 64 | int a -// CHECK: | [sizeof=80, align=16 -// CHECK: | nvsize=32, nvalign=16] +// CHECK-NEXT: 0 | struct TestF6 +// CHECK-NEXT: 0 | struct TestF3 (base) +// CHECK-NEXT: 0 | struct A4 (base) +// CHECK-NEXT: 0 | int a +// CHECK-NEXT: 4 | (TestF3 vbtable pointer) +// CHECK-NEXT: 8 | int a +// CHECK-NEXT: 12 | struct A4 (base) +// CHECK-NEXT: 12 | int a +// CHECK-NEXT: 16 | int a +// CHECK-NEXT: 44 | (vtordisp for vbase C16) +// CHECK-NEXT: 48 | struct C16 (virtual base) +// CHECK-NEXT: 48 | (C16 vftable pointer) +// CHECK-NEXT: 64 | int a +// CHECK-NEXT: | [sizeof=80, align=16 +// CHECK-NEXT: | nvsize=32, nvalign=16] // CHECK-X64: *** Dumping AST Record Layout -// CHECK-X64: 0 | struct TestF6 -// CHECK-X64: 0 | struct TestF3 (base) -// CHECK-X64: 0 | struct A4 (base) -// CHECK-X64: 0 | int a -// CHECK-X64: 8 | (TestF3 vbtable pointer) -// CHECK-X64: 16 | int a -// CHECK-X64: 24 | struct A4 (base) -// CHECK-X64: 24 | int a -// CHECK-X64: 28 | int a -// CHECK-X64: 44 | (vtordisp for vbase C16) -// CHECK-X64: 48 | struct C16 (virtual base) -// CHECK-X64: 48 | (C16 vftable pointer) -// CHECK-X64: 64 | int a -// CHECK-X64: | [sizeof=80, align=16 -// CHECK-X64: | nvsize=32, nvalign=16] +// CHECK-X64-NEXT: 0 | struct TestF6 +// CHECK-X64-NEXT: 0 | struct TestF3 (base) +// CHECK-X64-NEXT: 0 | struct A4 (base) +// CHECK-X64-NEXT: 0 | int a +// CHECK-X64-NEXT: 8 | (TestF3 vbtable pointer) +// CHECK-X64-NEXT: 16 | int a +// CHECK-X64-NEXT: 24 | struct A4 (base) +// CHECK-X64-NEXT: 24 | int a +// CHECK-X64-NEXT: 28 | int a +// CHECK-X64-NEXT: 44 | (vtordisp for vbase C16) +// CHECK-X64-NEXT: 48 | struct C16 (virtual base) +// CHECK-X64-NEXT: 48 | (C16 vftable pointer) +// CHECK-X64-NEXT: 64 | int a +// CHECK-X64-NEXT: | [sizeof=80, align=16 +// CHECK-X64-NEXT: | nvsize=32, nvalign=16] struct TestF7 : A4, virtual C16 { int a; @@ -261,29 +271,29 @@ struct TestF7 : A4, virtual C16 { }; // CHECK: *** Dumping AST Record Layout -// CHECK: 0 | struct TestF7 -// CHECK: 0 | struct A4 (base) -// CHECK: 0 | int a -// CHECK: 4 | (TestF7 vbtable pointer) -// CHECK: 8 | int a -// CHECK: 28 | (vtordisp for vbase C16) -// CHECK: 32 | struct C16 (virtual base) -// CHECK: 32 | (C16 vftable pointer) -// CHECK: 48 | int a -// CHECK: | [sizeof=64, align=16 -// CHECK: | nvsize=12, nvalign=4] +// CHECK-NEXT: 0 | struct TestF7 +// CHECK-NEXT: 0 | struct A4 (base) +// CHECK-NEXT: 0 | int a +// CHECK-NEXT: 4 | (TestF7 vbtable pointer) +// CHECK-NEXT: 8 | int a +// CHECK-NEXT: 28 | (vtordisp for vbase C16) +// CHECK-NEXT: 32 | struct C16 (virtual base) +// CHECK-NEXT: 32 | (C16 vftable pointer) +// CHECK-NEXT: 48 | int a +// CHECK-NEXT: | [sizeof=64, align=16 +// CHECK-NEXT: | nvsize=12, nvalign=4] // CHECK-X64: *** Dumping AST Record Layout -// CHECK-X64: 0 | struct TestF7 -// CHECK-X64: 0 | struct A4 (base) -// CHECK-X64: 0 | int a -// CHECK-X64: 8 | (TestF7 vbtable pointer) -// CHECK-X64: 16 | int a -// CHECK-X64: 44 | (vtordisp for vbase C16) -// CHECK-X64: 48 | struct C16 (virtual base) -// CHECK-X64: 48 | (C16 vftable pointer) -// CHECK-X64: 64 | int a -// CHECK-X64: | [sizeof=80, align=16 -// CHECK-X64: | nvsize=24, nvalign=8] +// CHECK-X64-NEXT: 0 | struct TestF7 +// CHECK-X64-NEXT: 0 | struct A4 (base) +// CHECK-X64-NEXT: 0 | int a +// CHECK-X64-NEXT: 8 | (TestF7 vbtable pointer) +// CHECK-X64-NEXT: 16 | int a +// CHECK-X64-NEXT: 44 | (vtordisp for vbase C16) +// CHECK-X64-NEXT: 48 | struct C16 (virtual base) +// CHECK-X64-NEXT: 48 | (C16 vftable pointer) +// CHECK-X64-NEXT: 64 | int a +// CHECK-X64-NEXT: | [sizeof=80, align=16 +// CHECK-X64-NEXT: | nvsize=24, nvalign=8] struct TestF8 : TestF7, A4 { int a; @@ -292,37 +302,37 @@ struct TestF8 : TestF7, A4 { }; // CHECK: *** Dumping AST Record Layout -// CHECK: 0 | struct TestF8 -// CHECK: 0 | struct TestF7 (base) -// CHECK: 0 | struct A4 (base) -// CHECK: 0 | int a -// CHECK: 4 | (TestF7 vbtable pointer) -// CHECK: 8 | int a -// CHECK: 12 | struct A4 (base) -// CHECK: 12 | int a -// CHECK: 16 | int a -// CHECK: 44 | (vtordisp for vbase C16) -// CHECK: 48 | struct C16 (virtual base) -// CHECK: 48 | (C16 vftable pointer) -// CHECK: 64 | int a -// CHECK: | [sizeof=80, align=16 -// CHECK: | nvsize=32, nvalign=16] +// CHECK-NEXT: 0 | struct TestF8 +// CHECK-NEXT: 0 | struct TestF7 (base) +// CHECK-NEXT: 0 | struct A4 (base) +// CHECK-NEXT: 0 | int a +// CHECK-NEXT: 4 | (TestF7 vbtable pointer) +// CHECK-NEXT: 8 | int a +// CHECK-NEXT: 12 | struct A4 (base) +// CHECK-NEXT: 12 | int a +// CHECK-NEXT: 16 | int a +// CHECK-NEXT: 44 | (vtordisp for vbase C16) +// CHECK-NEXT: 48 | struct C16 (virtual base) +// CHECK-NEXT: 48 | (C16 vftable pointer) +// CHECK-NEXT: 64 | int a +// CHECK-NEXT: | [sizeof=80, align=16 +// CHECK-NEXT: | nvsize=32, nvalign=16] // CHECK-X64: *** Dumping AST Record Layout -// CHECK-X64: 0 | struct TestF8 -// CHECK-X64: 0 | struct TestF7 (base) -// CHECK-X64: 0 | struct A4 (base) -// CHECK-X64: 0 | int a -// CHECK-X64: 8 | (TestF7 vbtable pointer) -// CHECK-X64: 16 | int a -// CHECK-X64: 24 | struct A4 (base) -// CHECK-X64: 24 | int a -// CHECK-X64: 28 | int a -// CHECK-X64: 44 | (vtordisp for vbase C16) -// CHECK-X64: 48 | struct C16 (virtual base) -// CHECK-X64: 48 | (C16 vftable pointer) -// CHECK-X64: 64 | int a -// CHECK-X64: | [sizeof=80, align=16 -// CHECK-X64: | nvsize=32, nvalign=16] +// CHECK-X64-NEXT: 0 | struct TestF8 +// CHECK-X64-NEXT: 0 | struct TestF7 (base) +// CHECK-X64-NEXT: 0 | struct A4 (base) +// CHECK-X64-NEXT: 0 | int a +// CHECK-X64-NEXT: 8 | (TestF7 vbtable pointer) +// CHECK-X64-NEXT: 16 | int a +// CHECK-X64-NEXT: 24 | struct A4 (base) +// CHECK-X64-NEXT: 24 | int a +// CHECK-X64-NEXT: 28 | int a +// CHECK-X64-NEXT: 44 | (vtordisp for vbase C16) +// CHECK-X64-NEXT: 48 | struct C16 (virtual base) +// CHECK-X64-NEXT: 48 | (C16 vftable pointer) +// CHECK-X64-NEXT: 64 | int a +// CHECK-X64-NEXT: | [sizeof=80, align=16 +// CHECK-X64-NEXT: | nvsize=32, nvalign=16] struct TestF9 : A4, virtual C16 { int a; @@ -331,29 +341,29 @@ struct TestF9 : A4, virtual C16 { }; // CHECK: *** Dumping AST Record Layout -// CHECK: 0 | struct TestF9 -// CHECK: 0 | (TestF9 vftable pointer) -// CHECK: 4 | struct A4 (base) -// CHECK: 4 | int a -// CHECK: 8 | (TestF9 vbtable pointer) -// CHECK: 12 | int a -// CHECK: 16 | struct C16 (virtual base) -// CHECK: 16 | (C16 vftable pointer) -// CHECK: 32 | int a -// CHECK: | [sizeof=48, align=16 -// CHECK: | nvsize=16, nvalign=4] +// CHECK-NEXT: 0 | struct TestF9 +// CHECK-NEXT: 0 | (TestF9 vftable pointer) +// CHECK-NEXT: 4 | struct A4 (base) +// CHECK-NEXT: 4 | int a +// CHECK-NEXT: 8 | (TestF9 vbtable pointer) +// CHECK-NEXT: 12 | int a +// CHECK-NEXT: 16 | struct C16 (virtual base) +// CHECK-NEXT: 16 | (C16 vftable pointer) +// CHECK-NEXT: 32 | int a +// CHECK-NEXT: | [sizeof=48, align=16 +// CHECK-NEXT: | nvsize=16, nvalign=4] // CHECK-X64: *** Dumping AST Record Layout -// CHECK-X64: 0 | struct TestF9 -// CHECK-X64: 0 | (TestF9 vftable pointer) -// CHECK-X64: 8 | struct A4 (base) -// CHECK-X64: 8 | int a -// CHECK-X64: 16 | (TestF9 vbtable pointer) -// CHECK-X64: 24 | int a -// CHECK-X64: 32 | struct C16 (virtual base) -// CHECK-X64: 32 | (C16 vftable pointer) -// CHECK-X64: 48 | int a -// CHECK-X64: | [sizeof=64, align=16 -// CHECK-X64: | nvsize=32, nvalign=8] +// CHECK-X64-NEXT: 0 | struct TestF9 +// CHECK-X64-NEXT: 0 | (TestF9 vftable pointer) +// CHECK-X64-NEXT: 8 | struct A4 (base) +// CHECK-X64-NEXT: 8 | int a +// CHECK-X64-NEXT: 16 | (TestF9 vbtable pointer) +// CHECK-X64-NEXT: 24 | int a +// CHECK-X64-NEXT: 32 | struct C16 (virtual base) +// CHECK-X64-NEXT: 32 | (C16 vftable pointer) +// CHECK-X64-NEXT: 48 | int a +// CHECK-X64-NEXT: | [sizeof=64, align=16 +// CHECK-X64-NEXT: | nvsize=32, nvalign=8] struct TestFA : TestF9, A4 { int a; @@ -362,37 +372,37 @@ struct TestFA : TestF9, A4 { }; // CHECK: *** Dumping AST Record Layout -// CHECK: 0 | struct TestFA -// CHECK: 0 | struct TestF9 (primary base) -// CHECK: 0 | (TestF9 vftable pointer) -// CHECK: 4 | struct A4 (base) -// CHECK: 4 | int a -// CHECK: 8 | (TestF9 vbtable pointer) -// CHECK: 12 | int a -// CHECK: 16 | struct A4 (base) -// CHECK: 16 | int a -// CHECK: 20 | int a -// CHECK: 32 | struct C16 (virtual base) -// CHECK: 32 | (C16 vftable pointer) -// CHECK: 48 | int a -// CHECK: | [sizeof=64, align=16 -// CHECK: | nvsize=32, nvalign=16] +// CHECK-NEXT: 0 | struct TestFA +// CHECK-NEXT: 0 | struct TestF9 (primary base) +// CHECK-NEXT: 0 | (TestF9 vftable pointer) +// CHECK-NEXT: 4 | struct A4 (base) +// CHECK-NEXT: 4 | int a +// CHECK-NEXT: 8 | (TestF9 vbtable pointer) +// CHECK-NEXT: 12 | int a +// CHECK-NEXT: 16 | struct A4 (base) +// CHECK-NEXT: 16 | int a +// CHECK-NEXT: 20 | int a +// CHECK-NEXT: 32 | struct C16 (virtual base) +// CHECK-NEXT: 32 | (C16 vftable pointer) +// CHECK-NEXT: 48 | int a +// CHECK-NEXT: | [sizeof=64, align=16 +// CHECK-NEXT: | nvsize=32, nvalign=16] // CHECK-X64: *** Dumping AST Record Layout -// CHECK-X64: 0 | struct TestFA -// CHECK-X64: 0 | struct TestF9 (primary base) -// CHECK-X64: 0 | (TestF9 vftable pointer) -// CHECK-X64: 8 | struct A4 (base) -// CHECK-X64: 8 | int a -// CHECK-X64: 16 | (TestF9 vbtable pointer) -// CHECK-X64: 24 | int a -// CHECK-X64: 32 | struct A4 (base) -// CHECK-X64: 32 | int a -// CHECK-X64: 36 | int a -// CHECK-X64: 48 | struct C16 (virtual base) -// CHECK-X64: 48 | (C16 vftable pointer) -// CHECK-X64: 64 | int a -// CHECK-X64: | [sizeof=80, align=16 -// CHECK-X64: | nvsize=48, nvalign=16] +// CHECK-X64-NEXT: 0 | struct TestFA +// CHECK-X64-NEXT: 0 | struct TestF9 (primary base) +// CHECK-X64-NEXT: 0 | (TestF9 vftable pointer) +// CHECK-X64-NEXT: 8 | struct A4 (base) +// CHECK-X64-NEXT: 8 | int a +// CHECK-X64-NEXT: 16 | (TestF9 vbtable pointer) +// CHECK-X64-NEXT: 24 | int a +// CHECK-X64-NEXT: 32 | struct A4 (base) +// CHECK-X64-NEXT: 32 | int a +// CHECK-X64-NEXT: 36 | int a +// CHECK-X64-NEXT: 48 | struct C16 (virtual base) +// CHECK-X64-NEXT: 48 | (C16 vftable pointer) +// CHECK-X64-NEXT: 64 | int a +// CHECK-X64-NEXT: | [sizeof=80, align=16 +// CHECK-X64-NEXT: | nvsize=48, nvalign=16] struct TestFB : A16, virtual C16 { int a; @@ -401,29 +411,29 @@ struct TestFB : A16, virtual C16 { }; // CHECK: *** Dumping AST Record Layout -// CHECK: 0 | struct TestFB -// CHECK: 0 | (TestFB vftable pointer) -// CHECK: 16 | struct A16 (base) -// CHECK: 16 | int a -// CHECK: 32 | (TestFB vbtable pointer) -// CHECK: 48 | int a -// CHECK: 64 | struct C16 (virtual base) -// CHECK: 64 | (C16 vftable pointer) -// CHECK: 80 | int a -// CHECK: | [sizeof=96, align=16 -// CHECK: | nvsize=64, nvalign=16] +// CHECK-NEXT: 0 | struct TestFB +// CHECK-NEXT: 0 | (TestFB vftable pointer) +// CHECK-NEXT: 16 | struct A16 (base) +// CHECK-NEXT: 16 | int a +// CHECK-NEXT: 32 | (TestFB vbtable pointer) +// CHECK-NEXT: 48 | int a +// CHECK-NEXT: 64 | struct C16 (virtual base) +// CHECK-NEXT: 64 | (C16 vftable pointer) +// CHECK-NEXT: 80 | int a +// CHECK-NEXT: | [sizeof=96, align=16 +// CHECK-NEXT: | nvsize=64, nvalign=16] // CHECK-X64: *** Dumping AST Record Layout -// CHECK-X64: 0 | struct TestFB -// CHECK-X64: 0 | (TestFB vftable pointer) -// CHECK-X64: 16 | struct A16 (base) -// CHECK-X64: 16 | int a -// CHECK-X64: 32 | (TestFB vbtable pointer) -// CHECK-X64: 40 | int a -// CHECK-X64: 48 | struct C16 (virtual base) -// CHECK-X64: 48 | (C16 vftable pointer) -// CHECK-X64: 64 | int a -// CHECK-X64: | [sizeof=80, align=16 -// CHECK-X64: | nvsize=48, nvalign=16] +// CHECK-X64-NEXT: 0 | struct TestFB +// CHECK-X64-NEXT: 0 | (TestFB vftable pointer) +// CHECK-X64-NEXT: 16 | struct A16 (base) +// CHECK-X64-NEXT: 16 | int a +// CHECK-X64-NEXT: 32 | (TestFB vbtable pointer) +// CHECK-X64-NEXT: 40 | int a +// CHECK-X64-NEXT: 48 | struct C16 (virtual base) +// CHECK-X64-NEXT: 48 | (C16 vftable pointer) +// CHECK-X64-NEXT: 64 | int a +// CHECK-X64-NEXT: | [sizeof=80, align=16 +// CHECK-X64-NEXT: | nvsize=48, nvalign=16] struct TestFC : TestFB, A4 { int a; @@ -432,37 +442,37 @@ struct TestFC : TestFB, A4 { }; // CHECK: *** Dumping AST Record Layout -// CHECK: 0 | struct TestFC -// CHECK: 0 | struct TestFB (primary base) -// CHECK: 0 | (TestFB vftable pointer) -// CHECK: 16 | struct A16 (base) -// CHECK: 16 | int a -// CHECK: 32 | (TestFB vbtable pointer) -// CHECK: 48 | int a -// CHECK: 64 | struct A4 (base) -// CHECK: 64 | int a -// CHECK: 68 | int a -// CHECK: 80 | struct C16 (virtual base) -// CHECK: 80 | (C16 vftable pointer) -// CHECK: 96 | int a -// CHECK: | [sizeof=112, align=16 -// CHECK: | nvsize=80, nvalign=16] +// CHECK-NEXT: 0 | struct TestFC +// CHECK-NEXT: 0 | struct TestFB (primary base) +// CHECK-NEXT: 0 | (TestFB vftable pointer) +// CHECK-NEXT: 16 | struct A16 (base) +// CHECK-NEXT: 16 | int a +// CHECK-NEXT: 32 | (TestFB vbtable pointer) +// CHECK-NEXT: 48 | int a +// CHECK-NEXT: 64 | struct A4 (base) +// CHECK-NEXT: 64 | int a +// CHECK-NEXT: 68 | int a +// CHECK-NEXT: 80 | struct C16 (virtual base) +// CHECK-NEXT: 80 | (C16 vftable pointer) +// CHECK-NEXT: 96 | int a +// CHECK-NEXT: | [sizeof=112, align=16 +// CHECK-NEXT: | nvsize=80, nvalign=16] // CHECK-X64: *** Dumping AST Record Layout -// CHECK-X64: 0 | struct TestFC -// CHECK-X64: 0 | struct TestFB (primary base) -// CHECK-X64: 0 | (TestFB vftable pointer) -// CHECK-X64: 16 | struct A16 (base) -// CHECK-X64: 16 | int a -// CHECK-X64: 32 | (TestFB vbtable pointer) -// CHECK-X64: 40 | int a -// CHECK-X64: 48 | struct A4 (base) -// CHECK-X64: 48 | int a -// CHECK-X64: 52 | int a -// CHECK-X64: 64 | struct C16 (virtual base) -// CHECK-X64: 64 | (C16 vftable pointer) -// CHECK-X64: 80 | int a -// CHECK-X64: | [sizeof=96, align=16 -// CHECK-X64: | nvsize=64, nvalign=16] +// CHECK-X64-NEXT: 0 | struct TestFC +// CHECK-X64-NEXT: 0 | struct TestFB (primary base) +// CHECK-X64-NEXT: 0 | (TestFB vftable pointer) +// CHECK-X64-NEXT: 16 | struct A16 (base) +// CHECK-X64-NEXT: 16 | int a +// CHECK-X64-NEXT: 32 | (TestFB vbtable pointer) +// CHECK-X64-NEXT: 40 | int a +// CHECK-X64-NEXT: 48 | struct A4 (base) +// CHECK-X64-NEXT: 48 | int a +// CHECK-X64-NEXT: 52 | int a +// CHECK-X64-NEXT: 64 | struct C16 (virtual base) +// CHECK-X64-NEXT: 64 | (C16 vftable pointer) +// CHECK-X64-NEXT: 80 | int a +// CHECK-X64-NEXT: | [sizeof=96, align=16 +// CHECK-X64-NEXT: | nvsize=64, nvalign=16] struct A16f { @@ -486,43 +496,51 @@ struct F0 : A4, B { }; // CHECK: *** Dumping AST Record Layout -// CHECK: 0 | struct F0 -// CHECK: 0 | (F0 vftable pointer) -// CHECK: 16 | struct A4 (base) -// CHECK: 16 | int a -// CHECK: 32 | struct B (base) -// CHECK: 32 | struct A4 (base) -// CHECK: 32 | int a -// CHECK: 36 | struct Y (base) -// CHECK: 36 | char y -// CHECK: 48 | struct X (base) -// CHECK: 48 | (X vbtable pointer) -// CHECK: 52 | int a -// CHECK: 64 | int a -// CHECK: 80 | struct A16f (virtual base) -// CHECK: 80 | (A16f vftable pointer) -// CHECK: 96 | int a -// CHECK: | [sizeof=112, align=16 -// CHECK: | nvsize=80, nvalign=16] +// CHECK: *** Dumping AST Record Layout +// CHECK: *** Dumping AST Record Layout +// CHECK: *** Dumping AST Record Layout +// CHECK: *** Dumping AST Record Layout +// CHECK-NEXT: 0 | struct F0 +// CHECK-NEXT: 0 | (F0 vftable pointer) +// CHECK-NEXT: 16 | struct A4 (base) +// CHECK-NEXT: 16 | int a +// CHECK-NEXT: 32 | struct B (base) +// CHECK-NEXT: 32 | struct A4 (base) +// CHECK-NEXT: 32 | int a +// CHECK-NEXT: 36 | struct Y (base) +// CHECK-NEXT: 36 | char y +// CHECK-NEXT: 48 | struct X (base) +// CHECK-NEXT: 48 | (X vbtable pointer) +// CHECK-NEXT: 52 | int a +// CHECK-NEXT: 64 | int a +// CHECK-NEXT: 80 | struct A16f (virtual base) +// CHECK-NEXT: 80 | (A16f vftable pointer) +// CHECK-NEXT: 96 | int a +// CHECK-NEXT: | [sizeof=112, align=16 +// CHECK-NEXT: | nvsize=80, nvalign=16] +// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64: *** Dumping AST Record Layout // CHECK-X64: *** Dumping AST Record Layout -// CHECK-X64: 0 | struct F0 -// CHECK-X64: 0 | (F0 vftable pointer) -// CHECK-X64: 8 | struct A4 (base) -// CHECK-X64: 8 | int a -// CHECK-X64: 16 | struct B (base) -// CHECK-X64: 16 | struct A4 (base) -// CHECK-X64: 16 | int a -// CHECK-X64: 20 | struct Y (base) -// CHECK-X64: 20 | char y -// CHECK-X64: 32 | struct X (base) -// CHECK-X64: 32 | (X vbtable pointer) -// CHECK-X64: 40 | int a -// CHECK-X64: 48 | int a -// CHECK-X64: 64 | struct A16f (virtual base) -// CHECK-X64: 64 | (A16f vftable pointer) -// CHECK-X64: 80 | int a -// CHECK-X64: | [sizeof=96, align=16 -// CHECK-X64: | nvsize=64, nvalign=16] +// CHECK-X64-NEXT: 0 | struct F0 +// CHECK-X64-NEXT: 0 | (F0 vftable pointer) +// CHECK-X64-NEXT: 8 | struct A4 (base) +// CHECK-X64-NEXT: 8 | int a +// CHECK-X64-NEXT: 16 | struct B (base) +// CHECK-X64-NEXT: 16 | struct A4 (base) +// CHECK-X64-NEXT: 16 | int a +// CHECK-X64-NEXT: 20 | struct Y (base) +// CHECK-X64-NEXT: 20 | char y +// CHECK-X64-NEXT: 32 | struct X (base) +// CHECK-X64-NEXT: 32 | (X vbtable pointer) +// CHECK-X64-NEXT: 40 | int a +// CHECK-X64-NEXT: 48 | int a +// CHECK-X64-NEXT: 64 | struct A16f (virtual base) +// CHECK-X64-NEXT: 64 | (A16f vftable pointer) +// CHECK-X64-NEXT: 80 | int a +// CHECK-X64-NEXT: | [sizeof=96, align=16 +// CHECK-X64-NEXT: | nvsize=64, nvalign=16] struct F1 : B, A4 { int a; @@ -531,43 +549,43 @@ struct F1 : B, A4 { }; // CHECK: *** Dumping AST Record Layout -// CHECK: 0 | struct F1 -// CHECK: 0 | (F1 vftable pointer) -// CHECK: 16 | struct B (base) -// CHECK: 16 | struct A4 (base) -// CHECK: 16 | int a -// CHECK: 20 | struct Y (base) -// CHECK: 20 | char y -// CHECK: 32 | struct X (base) -// CHECK: 32 | (X vbtable pointer) -// CHECK: 36 | int a -// CHECK: 48 | struct A4 (base) -// CHECK: 48 | int a -// CHECK: 52 | int a -// CHECK: 64 | struct A16f (virtual base) -// CHECK: 64 | (A16f vftable pointer) -// CHECK: 80 | int a -// CHECK: | [sizeof=96, align=16 -// CHECK: | nvsize=64, nvalign=16] +// CHECK-NEXT: 0 | struct F1 +// CHECK-NEXT: 0 | (F1 vftable pointer) +// CHECK-NEXT: 16 | struct B (base) +// CHECK-NEXT: 16 | struct A4 (base) +// CHECK-NEXT: 16 | int a +// CHECK-NEXT: 20 | struct Y (base) +// CHECK-NEXT: 20 | char y +// CHECK-NEXT: 32 | struct X (base) +// CHECK-NEXT: 32 | (X vbtable pointer) +// CHECK-NEXT: 36 | int a +// CHECK-NEXT: 48 | struct A4 (base) +// CHECK-NEXT: 48 | int a +// CHECK-NEXT: 52 | int a +// CHECK-NEXT: 64 | struct A16f (virtual base) +// CHECK-NEXT: 64 | (A16f vftable pointer) +// CHECK-NEXT: 80 | int a +// CHECK-NEXT: | [sizeof=96, align=16 +// CHECK-NEXT: | nvsize=64, nvalign=16] // CHECK-X64: *** Dumping AST Record Layout -// CHECK-X64: 0 | struct F1 -// CHECK-X64: 0 | (F1 vftable pointer) -// CHECK-X64: 16 | struct B (base) -// CHECK-X64: 16 | struct A4 (base) -// CHECK-X64: 16 | int a -// CHECK-X64: 20 | struct Y (base) -// CHECK-X64: 20 | char y -// CHECK-X64: 32 | struct X (base) -// CHECK-X64: 32 | (X vbtable pointer) -// CHECK-X64: 40 | int a -// CHECK-X64: 48 | struct A4 (base) -// CHECK-X64: 48 | int a -// CHECK-X64: 52 | int a -// CHECK-X64: 64 | struct A16f (virtual base) -// CHECK-X64: 64 | (A16f vftable pointer) -// CHECK-X64: 80 | int a -// CHECK-X64: | [sizeof=96, align=16 -// CHECK-X64: | nvsize=64, nvalign=16] +// CHECK-X64-NEXT: 0 | struct F1 +// CHECK-X64-NEXT: 0 | (F1 vftable pointer) +// CHECK-X64-NEXT: 16 | struct B (base) +// CHECK-X64-NEXT: 16 | struct A4 (base) +// CHECK-X64-NEXT: 16 | int a +// CHECK-X64-NEXT: 20 | struct Y (base) +// CHECK-X64-NEXT: 20 | char y +// CHECK-X64-NEXT: 32 | struct X (base) +// CHECK-X64-NEXT: 32 | (X vbtable pointer) +// CHECK-X64-NEXT: 40 | int a +// CHECK-X64-NEXT: 48 | struct A4 (base) +// CHECK-X64-NEXT: 48 | int a +// CHECK-X64-NEXT: 52 | int a +// CHECK-X64-NEXT: 64 | struct A16f (virtual base) +// CHECK-X64-NEXT: 64 | (A16f vftable pointer) +// CHECK-X64-NEXT: 80 | int a +// CHECK-X64-NEXT: | [sizeof=96, align=16 +// CHECK-X64-NEXT: | nvsize=64, nvalign=16] struct F2 : A4, virtual A16f { int a; @@ -576,29 +594,29 @@ struct F2 : A4, virtual A16f { }; // CHECK: *** Dumping AST Record Layout -// CHECK: 0 | struct F2 -// CHECK: 0 | (F2 vftable pointer) -// CHECK: 4 | struct A4 (base) -// CHECK: 4 | int a -// CHECK: 8 | (F2 vbtable pointer) -// CHECK: 12 | int a -// CHECK: 16 | struct A16f (virtual base) -// CHECK: 16 | (A16f vftable pointer) -// CHECK: 32 | int a -// CHECK: | [sizeof=48, align=16 -// CHECK: | nvsize=16, nvalign=4] +// CHECK-NEXT: 0 | struct F2 +// CHECK-NEXT: 0 | (F2 vftable pointer) +// CHECK-NEXT: 4 | struct A4 (base) +// CHECK-NEXT: 4 | int a +// CHECK-NEXT: 8 | (F2 vbtable pointer) +// CHECK-NEXT: 12 | int a +// CHECK-NEXT: 16 | struct A16f (virtual base) +// CHECK-NEXT: 16 | (A16f vftable pointer) +// CHECK-NEXT: 32 | int a +// CHECK-NEXT: | [sizeof=48, align=16 +// CHECK-NEXT: | nvsize=16, nvalign=4] // CHECK-X64: *** Dumping AST Record Layout -// CHECK-X64: 0 | struct F2 -// CHECK-X64: 0 | (F2 vftable pointer) -// CHECK-X64: 8 | struct A4 (base) -// CHECK-X64: 8 | int a -// CHECK-X64: 16 | (F2 vbtable pointer) -// CHECK-X64: 24 | int a -// CHECK-X64: 32 | struct A16f (virtual base) -// CHECK-X64: 32 | (A16f vftable pointer) -// CHECK-X64: 48 | int a -// CHECK-X64: | [sizeof=64, align=16 -// CHECK-X64: | nvsize=32, nvalign=8] +// CHECK-X64-NEXT: 0 | struct F2 +// CHECK-X64-NEXT: 0 | (F2 vftable pointer) +// CHECK-X64-NEXT: 8 | struct A4 (base) +// CHECK-X64-NEXT: 8 | int a +// CHECK-X64-NEXT: 16 | (F2 vbtable pointer) +// CHECK-X64-NEXT: 24 | int a +// CHECK-X64-NEXT: 32 | struct A16f (virtual base) +// CHECK-X64-NEXT: 32 | (A16f vftable pointer) +// CHECK-X64-NEXT: 48 | int a +// CHECK-X64-NEXT: | [sizeof=64, align=16 +// CHECK-X64-NEXT: | nvsize=32, nvalign=8] struct F3 : A4, virtual A16f { __declspec(align(16)) int a; @@ -607,29 +625,29 @@ struct F3 : A4, virtual A16f { }; // CHECK: *** Dumping AST Record Layout -// CHECK: 0 | struct F3 -// CHECK: 0 | (F3 vftable pointer) -// CHECK: 16 | struct A4 (base) -// CHECK: 16 | int a -// CHECK: 20 | (F3 vbtable pointer) -// CHECK: 48 | int a -// CHECK: 64 | struct A16f (virtual base) -// CHECK: 64 | (A16f vftable pointer) -// CHECK: 80 | int a -// CHECK: | [sizeof=96, align=16 -// CHECK: | nvsize=64, nvalign=16] +// CHECK-NEXT: 0 | struct F3 +// CHECK-NEXT: 0 | (F3 vftable pointer) +// CHECK-NEXT: 16 | struct A4 (base) +// CHECK-NEXT: 16 | int a +// CHECK-NEXT: 20 | (F3 vbtable pointer) +// CHECK-NEXT: 48 | int a +// CHECK-NEXT: 64 | struct A16f (virtual base) +// CHECK-NEXT: 64 | (A16f vftable pointer) +// CHECK-NEXT: 80 | int a +// CHECK-NEXT: | [sizeof=96, align=16 +// CHECK-NEXT: | nvsize=64, nvalign=16] // CHECK-X64: *** Dumping AST Record Layout -// CHECK-X64: 0 | struct F3 -// CHECK-X64: 0 | (F3 vftable pointer) -// CHECK-X64: 8 | struct A4 (base) -// CHECK-X64: 8 | int a -// CHECK-X64: 16 | (F3 vbtable pointer) -// CHECK-X64: 32 | int a -// CHECK-X64: 48 | struct A16f (virtual base) -// CHECK-X64: 48 | (A16f vftable pointer) -// CHECK-X64: 64 | int a -// CHECK-X64: | [sizeof=80, align=16 -// CHECK-X64: | nvsize=48, nvalign=16] +// CHECK-X64-NEXT: 0 | struct F3 +// CHECK-X64-NEXT: 0 | (F3 vftable pointer) +// CHECK-X64-NEXT: 8 | struct A4 (base) +// CHECK-X64-NEXT: 8 | int a +// CHECK-X64-NEXT: 16 | (F3 vbtable pointer) +// CHECK-X64-NEXT: 32 | int a +// CHECK-X64-NEXT: 48 | struct A16f (virtual base) +// CHECK-X64-NEXT: 48 | (A16f vftable pointer) +// CHECK-X64-NEXT: 64 | int a +// CHECK-X64-NEXT: | [sizeof=80, align=16 +// CHECK-X64-NEXT: | nvsize=48, nvalign=16] struct F4 : A4, B { __declspec(align(16)) int a; @@ -638,43 +656,43 @@ struct F4 : A4, B { }; // CHECK: *** Dumping AST Record Layout -// CHECK: 0 | struct F4 -// CHECK: 0 | (F4 vftable pointer) -// CHECK: 16 | struct A4 (base) -// CHECK: 16 | int a -// CHECK: 32 | struct B (base) -// CHECK: 32 | struct A4 (base) -// CHECK: 32 | int a -// CHECK: 36 | struct Y (base) -// CHECK: 36 | char y -// CHECK: 48 | struct X (base) -// CHECK: 48 | (X vbtable pointer) -// CHECK: 52 | int a -// CHECK: 64 | int a -// CHECK: 80 | struct A16f (virtual base) -// CHECK: 80 | (A16f vftable pointer) -// CHECK: 96 | int a -// CHECK: | [sizeof=112, align=16 -// CHECK: | nvsize=80, nvalign=16] +// CHECK-NEXT: 0 | struct F4 +// CHECK-NEXT: 0 | (F4 vftable pointer) +// CHECK-NEXT: 16 | struct A4 (base) +// CHECK-NEXT: 16 | int a +// CHECK-NEXT: 32 | struct B (base) +// CHECK-NEXT: 32 | struct A4 (base) +// CHECK-NEXT: 32 | int a +// CHECK-NEXT: 36 | struct Y (base) +// CHECK-NEXT: 36 | char y +// CHECK-NEXT: 48 | struct X (base) +// CHECK-NEXT: 48 | (X vbtable pointer) +// CHECK-NEXT: 52 | int a +// CHECK-NEXT: 64 | int a +// CHECK-NEXT: 80 | struct A16f (virtual base) +// CHECK-NEXT: 80 | (A16f vftable pointer) +// CHECK-NEXT: 96 | int a +// CHECK-NEXT: | [sizeof=112, align=16 +// CHECK-NEXT: | nvsize=80, nvalign=16] // CHECK-X64: *** Dumping AST Record Layout -// CHECK-X64: 0 | struct F4 -// CHECK-X64: 0 | (F4 vftable pointer) -// CHECK-X64: 8 | struct A4 (base) -// CHECK-X64: 8 | int a -// CHECK-X64: 16 | struct B (base) -// CHECK-X64: 16 | struct A4 (base) -// CHECK-X64: 16 | int a -// CHECK-X64: 20 | struct Y (base) -// CHECK-X64: 20 | char y -// CHECK-X64: 32 | struct X (base) -// CHECK-X64: 32 | (X vbtable pointer) -// CHECK-X64: 40 | int a -// CHECK-X64: 48 | int a -// CHECK-X64: 64 | struct A16f (virtual base) -// CHECK-X64: 64 | (A16f vftable pointer) -// CHECK-X64: 80 | int a -// CHECK-X64: | [sizeof=96, align=16 -// CHECK-X64: | nvsize=64, nvalign=16] +// CHECK-X64-NEXT: 0 | struct F4 +// CHECK-X64-NEXT: 0 | (F4 vftable pointer) +// CHECK-X64-NEXT: 8 | struct A4 (base) +// CHECK-X64-NEXT: 8 | int a +// CHECK-X64-NEXT: 16 | struct B (base) +// CHECK-X64-NEXT: 16 | struct A4 (base) +// CHECK-X64-NEXT: 16 | int a +// CHECK-X64-NEXT: 20 | struct Y (base) +// CHECK-X64-NEXT: 20 | char y +// CHECK-X64-NEXT: 32 | struct X (base) +// CHECK-X64-NEXT: 32 | (X vbtable pointer) +// CHECK-X64-NEXT: 40 | int a +// CHECK-X64-NEXT: 48 | int a +// CHECK-X64-NEXT: 64 | struct A16f (virtual base) +// CHECK-X64-NEXT: 64 | (A16f vftable pointer) +// CHECK-X64-NEXT: 80 | int a +// CHECK-X64-NEXT: | [sizeof=96, align=16 +// CHECK-X64-NEXT: | nvsize=64, nvalign=16] struct F5 : A16f, virtual A4 { int a; @@ -683,27 +701,27 @@ struct F5 : A16f, virtual A4 { }; // CHECK: *** Dumping AST Record Layout -// CHECK: 0 | struct F5 -// CHECK: 0 | struct A16f (primary base) -// CHECK: 0 | (A16f vftable pointer) -// CHECK: 16 | int a -// CHECK: 32 | (F5 vbtable pointer) -// CHECK: 48 | int a -// CHECK: 64 | struct A4 (virtual base) -// CHECK: 64 | int a -// CHECK: | [sizeof=80, align=16 -// CHECK: | nvsize=64, nvalign=16] +// CHECK-NEXT: 0 | struct F5 +// CHECK-NEXT: 0 | struct A16f (primary base) +// CHECK-NEXT: 0 | (A16f vftable pointer) +// CHECK-NEXT: 16 | int a +// CHECK-NEXT: 32 | (F5 vbtable pointer) +// CHECK-NEXT: 48 | int a +// CHECK-NEXT: 64 | struct A4 (virtual base) +// CHECK-NEXT: 64 | int a +// CHECK-NEXT: | [sizeof=80, align=16 +// CHECK-NEXT: | nvsize=64, nvalign=16] // CHECK-X64: *** Dumping AST Record Layout -// CHECK-X64: 0 | struct F5 -// CHECK-X64: 0 | struct A16f (primary base) -// CHECK-X64: 0 | (A16f vftable pointer) -// CHECK-X64: 16 | int a -// CHECK-X64: 32 | (F5 vbtable pointer) -// CHECK-X64: 40 | int a -// CHECK-X64: 48 | struct A4 (virtual base) -// CHECK-X64: 48 | int a -// CHECK-X64: | [sizeof=64, align=16 -// CHECK-X64: | nvsize=48, nvalign=16] +// CHECK-X64-NEXT: 0 | struct F5 +// CHECK-X64-NEXT: 0 | struct A16f (primary base) +// CHECK-X64-NEXT: 0 | (A16f vftable pointer) +// CHECK-X64-NEXT: 16 | int a +// CHECK-X64-NEXT: 32 | (F5 vbtable pointer) +// CHECK-X64-NEXT: 40 | int a +// CHECK-X64-NEXT: 48 | struct A4 (virtual base) +// CHECK-X64-NEXT: 48 | int a +// CHECK-X64-NEXT: | [sizeof=64, align=16 +// CHECK-X64-NEXT: | nvsize=48, nvalign=16] struct F6 : virtual A16f, A4, virtual B { int a; @@ -712,45 +730,45 @@ struct F6 : virtual A16f, A4, virtual B { }; // CHECK: *** Dumping AST Record Layout -// CHECK: 0 | struct F6 -// CHECK: 0 | (F6 vftable pointer) -// CHECK: 4 | struct A4 (base) -// CHECK: 4 | int a -// CHECK: 8 | (F6 vbtable pointer) -// CHECK: 12 | int a -// CHECK: 16 | struct A16f (virtual base) -// CHECK: 16 | (A16f vftable pointer) -// CHECK: 32 | int a -// CHECK: 48 | struct B (virtual base) -// CHECK: 48 | struct A4 (base) -// CHECK: 48 | int a -// CHECK: 52 | struct Y (base) -// CHECK: 52 | char y -// CHECK: 64 | struct X (base) -// CHECK: 64 | (X vbtable pointer) -// CHECK: 68 | int a -// CHECK: | [sizeof=80, align=16 -// CHECK: | nvsize=16, nvalign=4] +// CHECK-NEXT: 0 | struct F6 +// CHECK-NEXT: 0 | (F6 vftable pointer) +// CHECK-NEXT: 4 | struct A4 (base) +// CHECK-NEXT: 4 | int a +// CHECK-NEXT: 8 | (F6 vbtable pointer) +// CHECK-NEXT: 12 | int a +// CHECK-NEXT: 16 | struct A16f (virtual base) +// CHECK-NEXT: 16 | (A16f vftable pointer) +// CHECK-NEXT: 32 | int a +// CHECK-NEXT: 48 | struct B (virtual base) +// CHECK-NEXT: 48 | struct A4 (base) +// CHECK-NEXT: 48 | int a +// CHECK-NEXT: 52 | struct Y (base) +// CHECK-NEXT: 52 | char y +// CHECK-NEXT: 64 | struct X (base) +// CHECK-NEXT: 64 | (X vbtable pointer) +// CHECK-NEXT: 68 | int a +// CHECK-NEXT: | [sizeof=80, align=16 +// CHECK-NEXT: | nvsize=16, nvalign=4] // CHECK-X64: *** Dumping AST Record Layout -// CHECK-X64: 0 | struct F6 -// CHECK-X64: 0 | (F6 vftable pointer) -// CHECK-X64: 8 | struct A4 (base) -// CHECK-X64: 8 | int a -// CHECK-X64: 16 | (F6 vbtable pointer) -// CHECK-X64: 24 | int a -// CHECK-X64: 32 | struct A16f (virtual base) -// CHECK-X64: 32 | (A16f vftable pointer) -// CHECK-X64: 48 | int a -// CHECK-X64: 64 | struct B (virtual base) -// CHECK-X64: 64 | struct A4 (base) -// CHECK-X64: 64 | int a -// CHECK-X64: 68 | struct Y (base) -// CHECK-X64: 68 | char y -// CHECK-X64: 80 | struct X (base) -// CHECK-X64: 80 | (X vbtable pointer) -// CHECK-X64: 88 | int a -// CHECK-X64: | [sizeof=96, align=16 -// CHECK-X64: | nvsize=32, nvalign=8] +// CHECK-X64-NEXT: 0 | struct F6 +// CHECK-X64-NEXT: 0 | (F6 vftable pointer) +// CHECK-X64-NEXT: 8 | struct A4 (base) +// CHECK-X64-NEXT: 8 | int a +// CHECK-X64-NEXT: 16 | (F6 vbtable pointer) +// CHECK-X64-NEXT: 24 | int a +// CHECK-X64-NEXT: 32 | struct A16f (virtual base) +// CHECK-X64-NEXT: 32 | (A16f vftable pointer) +// CHECK-X64-NEXT: 48 | int a +// CHECK-X64-NEXT: 64 | struct B (virtual base) +// CHECK-X64-NEXT: 64 | struct A4 (base) +// CHECK-X64-NEXT: 64 | int a +// CHECK-X64-NEXT: 68 | struct Y (base) +// CHECK-X64-NEXT: 68 | char y +// CHECK-X64-NEXT: 80 | struct X (base) +// CHECK-X64-NEXT: 80 | (X vbtable pointer) +// CHECK-X64-NEXT: 88 | int a +// CHECK-X64-NEXT: | [sizeof=96, align=16 +// CHECK-X64-NEXT: | nvsize=32, nvalign=8] int a[ sizeof(TestF0)+ diff --git a/test/Layout/ms-x86-lazy-empty-nonvirtual-base.cpp b/test/Layout/ms-x86-lazy-empty-nonvirtual-base.cpp index 7dd3fad5bf..a4741e9705 100644 --- a/test/Layout/ms-x86-lazy-empty-nonvirtual-base.cpp +++ b/test/Layout/ms-x86-lazy-empty-nonvirtual-base.cpp @@ -706,6 +706,28 @@ struct DX : B8X, B1X, virtual B0X { // CHECK-X64: | [sizeof=24, align=8 // CHECK-X64: | nvsize=24, nvalign=8] + +struct C0 {}; +struct C1 : public C0 { int C1F0; }; +struct C2 : public C1, public C0 {}; + +// CHECK: *** Dumping AST Record Layout +// CHECK: 0 | struct C2 +// CHECK: 0 | struct C1 (base) +// CHECK: 0 | struct C0 (base) (empty) +// CHECK: 0 | int C1F0 +// CHECK: 5 | struct C0 (base) (empty) +// CHECK: | [sizeof=8, align=4 +// CHECK: | nvsize=8, nvalign=4] +// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64: 0 | struct C2 +// CHECK-X64: 0 | struct C1 (base) +// CHECK-X64: 0 | struct C0 (base) (empty) +// CHECK-X64: 0 | int C1F0 +// CHECK-X64: 5 | struct C0 (base) (empty) +// CHECK-X64: | [sizeof=8, align=4 +// CHECK-X64: | nvsize=8, nvalign=4] + int a[ sizeof(AA)+ sizeof(AB)+ @@ -732,4 +754,5 @@ sizeof(G)+ sizeof(AX)+ sizeof(BX)+ sizeof(CX)+ -sizeof(DX)]; +sizeof(DX)+ +sizeof(C2)];