summaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/vtable-layout.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2011-05-02 19:39:53 +0000
committerDimitry Andric <dim@FreeBSD.org>2011-05-02 19:39:53 +0000
commit01af97d3b23bded2b2b21af19bbc6e4cce49e5b3 (patch)
tree64a10f4c4154739d4a8191d7e1b52ce497f4ebd6 /test/CodeGenCXX/vtable-layout.cpp
parentc3b054d250cdca485c71845089c316e10610ebad (diff)
Notes
Diffstat (limited to 'test/CodeGenCXX/vtable-layout.cpp')
-rw-r--r--test/CodeGenCXX/vtable-layout.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/CodeGenCXX/vtable-layout.cpp b/test/CodeGenCXX/vtable-layout.cpp
index 1cf8a52d44b9..bd696813c814 100644
--- a/test/CodeGenCXX/vtable-layout.cpp
+++ b/test/CodeGenCXX/vtable-layout.cpp
@@ -41,6 +41,7 @@
// RUN: FileCheck --check-prefix=CHECK-40 %s < %t
// RUN: FileCheck --check-prefix=CHECK-41 %s < %t
// RUN: FileCheck --check-prefix=CHECK-42 %s < %t
+// RUN: FileCheck --check-prefix=CHECK-43 %s < %t
// For now, just verify this doesn't crash.
namespace test0 {
@@ -1679,3 +1680,24 @@ struct D : virtual B, C {
void D::g() { }
}
+
+namespace Test37 {
+
+// Test that we give C::f the right vtable index. (PR9660).
+struct A {
+ virtual A* f() = 0;
+};
+
+struct B : virtual A {
+ virtual B* f();
+};
+
+// CHECK-43: VTable indices for 'Test37::C' (1 entries).
+// CHECK-43-NEXT: 1 | Test37::C *Test37::C::f()
+struct C : B {
+ virtual C* f();
+};
+
+C* C::f() { return 0; }
+
+}