summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/vtable-layout.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-02-28 18:08:38 +0000
committerAnders Carlsson <andersca@mac.com>2010-02-28 18:08:38 +0000
commit0378bf0840335c6d56b2f1b51079522054f7da4f (patch)
treebef3cddcd50845f05c452efee3e18a515d6731d8 /test/CodeGenCXX/vtable-layout.cpp
parent293126becf78ef56bfaa446385af8a368eb8d1c2 (diff)
When laying out vtables for virtual bases in construction vtables, we need to check if the vtable is a primary base in the layout class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97402 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/vtable-layout.cpp')
-rw-r--r--test/CodeGenCXX/vtable-layout.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/test/CodeGenCXX/vtable-layout.cpp b/test/CodeGenCXX/vtable-layout.cpp
index dce7461e04..615ab6f564 100644
--- a/test/CodeGenCXX/vtable-layout.cpp
+++ b/test/CodeGenCXX/vtable-layout.cpp
@@ -926,6 +926,13 @@ namespace Test24 {
// Another construction vtable test.
+struct A {
+ virtual void f();
+};
+
+struct B : virtual A { };
+struct C : virtual A { };
+
// CHECK: Vtable for 'Test24::D' (10 entries).
// CHECK-NEXT: 0 | vbase_offset (0)
// CHECK-NEXT: 1 | vcall_offset (0)
@@ -952,13 +959,13 @@ namespace Test24 {
// CHECK-NEXT: -- (Test24::B, 0) vtable address --
// CHECK-NEXT: 4 | void Test24::A::f()
-struct A {
- virtual void f();
-};
-
-struct B : virtual A { };
-struct C : virtual A { };
-
+// CHECK: Construction vtable for ('Test24::C', 8) in 'Test24::D' (9 entries).
+// CHECK-NEXT: 0 | vbase_offset (-8)
+// CHECK-NEXT: 1 | vcall_offset (-8)
+// CHECK-NEXT: 2 | offset_to_top (0)
+// CHECK-NEXT: 3 | Test24::C RTTI
+// CHECK-NEXT: -- (Test24::A, 8) vtable address --
+// CHECK-NEXT: -- (Test24::C, 8) vtable address --
struct D : B, C {
virtual void f();
};