diff options
author | Anders Carlsson <andersca@mac.com> | 2011-04-10 18:00:32 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2011-04-10 18:00:32 +0000 |
commit | b8bced0b75fa4188c91753d5a1de6d164af45450 (patch) | |
tree | 259ae3d7e88221c1aa235b99da2b1a38c3d9dd92 /test/CodeGenCXX/vtable-layout.cpp | |
parent | d24e50c2e6c3f6e85965ef7b860c62a6bd7bcbb3 (diff) |
Change CollectPrimaryBases to collect the bases in the right order. Fixes one half of PR9660.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129252 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/vtable-layout.cpp')
-rw-r--r-- | test/CodeGenCXX/vtable-layout.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/CodeGenCXX/vtable-layout.cpp b/test/CodeGenCXX/vtable-layout.cpp index 1cf8a52d44..bd696813c8 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; } + +} |