[cfe-commits] r97401 - /cfe/trunk/test/CodeGenCXX/vtable-layout.cpp
Anders Carlsson
andersca at mac.com
Sun Feb 28 09:59:36 PST 2010
Author: andersca
Date: Sun Feb 28 11:59:36 2010
New Revision: 97401
URL: http://llvm.org/viewvc/llvm-project?rev=97401&view=rev
Log:
Add another construction vtable test.
Modified:
cfe/trunk/test/CodeGenCXX/vtable-layout.cpp
Modified: cfe/trunk/test/CodeGenCXX/vtable-layout.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/vtable-layout.cpp?rev=97401&r1=97400&r2=97401&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/vtable-layout.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/vtable-layout.cpp Sun Feb 28 11:59:36 2010
@@ -921,3 +921,46 @@
void D::f() { }
}
+
+namespace Test24 {
+
+// Another construction vtable test.
+
+// CHECK: Vtable for 'Test24::D' (10 entries).
+// CHECK-NEXT: 0 | vbase_offset (0)
+// CHECK-NEXT: 1 | vcall_offset (0)
+// CHECK-NEXT: 2 | offset_to_top (0)
+// CHECK-NEXT: 3 | Test24::D RTTI
+// CHECK-NEXT: -- (Test24::A, 0) vtable address --
+// CHECK-NEXT: -- (Test24::B, 0) vtable address --
+// CHECK-NEXT: -- (Test24::D, 0) vtable address --
+// CHECK-NEXT: 4 | void Test24::D::f()
+// CHECK-NEXT: 5 | vbase_offset (-8)
+// CHECK-NEXT: 6 | vcall_offset (-8)
+// CHECK-NEXT: 7 | offset_to_top (-8)
+// CHECK-NEXT: 8 | Test24::D RTTI
+// CHECK-NEXT: -- (Test24::A, 8) vtable address --
+// CHECK-NEXT: -- (Test24::C, 8) vtable address --
+// CHECK-NEXT: 9 | [unused] void Test24::D::f()
+
+// CHECK: Construction vtable for ('Test24::B', 0) in 'Test24::D' (5 entries).
+// CHECK-NEXT: 0 | vbase_offset (0)
+// CHECK-NEXT: 1 | vcall_offset (0)
+// CHECK-NEXT: 2 | offset_to_top (0)
+// CHECK-NEXT: 3 | Test24::B RTTI
+// CHECK-NEXT: -- (Test24::A, 0) vtable address --
+// 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 { };
+
+struct D : B, C {
+ virtual void f();
+};
+void D::f() { }
+}
More information about the cfe-commits
mailing list