summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/vtable-layout.cpp
diff options
context:
space:
mode:
authorTimur Iskhodzhanov <timurrrr@google.com>2013-06-05 13:49:11 +0000
committerTimur Iskhodzhanov <timurrrr@google.com>2013-06-05 13:49:11 +0000
commitd38dda9130a1bf6f8727b2ca5cf153ffdbfcf580 (patch)
treeb450bcb02e0f08a2e2ba3573eabe828b6f108ec8 /test/CodeGenCXX/vtable-layout.cpp
parent4c44d2f5c5953cbd6772638e9d06bfa26ae31f41 (diff)
Add a test for the breakage from r183298
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183308 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/vtable-layout.cpp')
-rw-r--r--test/CodeGenCXX/vtable-layout.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/CodeGenCXX/vtable-layout.cpp b/test/CodeGenCXX/vtable-layout.cpp
index 7bbade4b04..474bf2b57f 100644
--- a/test/CodeGenCXX/vtable-layout.cpp
+++ b/test/CodeGenCXX/vtable-layout.cpp
@@ -1889,3 +1889,37 @@ namespace Test39 {
void B::foo2() {
}
}
+
+namespace Test40 {
+ struct A {
+ virtual void foo() = 0;
+ };
+
+ struct B : public A {
+ virtual void foo();
+ };
+
+ struct C: public B {
+ // CHECK-46: VTable indices for 'Test40::C' (8 entries).
+ // CHECK-46-NEXT: 1 | int Test40::C::f(int)
+ // CHECK-46-NEXT: 2 | int Test40::C::f()
+ // CHECK-46-NEXT: 3 | int Test40::C::g(int)
+ // CHECK-46-NEXT: 4 | int Test40::C::g()
+ // CHECK-46-NEXT: 5 | int Test40::C::h(int)
+ // CHECK-46-NEXT: 6 | int Test40::C::h()
+ // CHECK-46-NEXT: 7 | int Test40::C::i(int)
+ // CHECK-46-NEXT: 8 | int Test40::C::i()
+ virtual int f(int);
+ virtual int f();
+ virtual int g(int);
+ virtual int g();
+ virtual int h(int);
+ virtual int h();
+ virtual int i(int);
+ virtual int i();
+ };
+
+ class D : C {};
+
+ D d;
+}