summaryrefslogtreecommitdiffstats
path: root/clang/test
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
commit8b37bb7c48a6033f027231c029ec96766d0f193a (patch)
treec74e9c8481c738651b87a273e0a9aa6f7b382012 /clang/test
parentb15d8c57adb89766b20ec15e6b2ea6fdad104534 (diff)
downloadbcm5719-llvm-8b37bb7c48a6033f027231c029ec96766d0f193a.tar.gz
bcm5719-llvm-8b37bb7c48a6033f027231c029ec96766d0f193a.zip
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.
llvm-svn: 97402
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CodeGenCXX/vtable-layout.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/clang/test/CodeGenCXX/vtable-layout.cpp b/clang/test/CodeGenCXX/vtable-layout.cpp
index dce7461e042..615ab6f5645 100644
--- a/clang/test/CodeGenCXX/vtable-layout.cpp
+++ b/clang/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();
};
OpenPOWER on IntegriCloud