summaryrefslogtreecommitdiffstats
path: root/clang/test/Layout/ms-x86-lazy-empty-nonvirtual-base.cpp
diff options
context:
space:
mode:
authorWarren Hunt <whunt@google.com>2013-12-12 22:33:37 +0000
committerWarren Hunt <whunt@google.com>2013-12-12 22:33:37 +0000
commit4431fe6becb0f87723cb7c008b6909355e414d80 (patch)
tree72c98b97d7fe50d427fe38d16a6879d21b4ad3dc /clang/test/Layout/ms-x86-lazy-empty-nonvirtual-base.cpp
parent3a7c3d1bf83f5da60927b89c99e14691e7109999 (diff)
downloadbcm5719-llvm-4431fe6becb0f87723cb7c008b6909355e414d80.tar.gz
bcm5719-llvm-4431fe6becb0f87723cb7c008b6909355e414d80.zip
[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). llvm-svn: 197183
Diffstat (limited to 'clang/test/Layout/ms-x86-lazy-empty-nonvirtual-base.cpp')
-rw-r--r--clang/test/Layout/ms-x86-lazy-empty-nonvirtual-base.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/clang/test/Layout/ms-x86-lazy-empty-nonvirtual-base.cpp b/clang/test/Layout/ms-x86-lazy-empty-nonvirtual-base.cpp
index 7dd3fad5bf4..a4741e97056 100644
--- a/clang/test/Layout/ms-x86-lazy-empty-nonvirtual-base.cpp
+++ b/clang/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)];
OpenPOWER on IntegriCloud