diff options
author | Anders Carlsson <andersca@mac.com> | 2010-03-10 19:39:11 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-03-10 19:39:11 +0000 |
commit | a96a2e961a3bce0ad2fc44a115ac949a481d42db (patch) | |
tree | a12a9291c77bd7fff9a215e4b485c665f6f38187 /test/CodeGenCXX/vtable-layout.cpp | |
parent | f2c98ce9819cb7688a86e308f82ee896694a10e5 (diff) |
We were mistakenly marking morally virtual bases as being uninteresting. Fix this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98180 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/vtable-layout.cpp')
-rw-r--r-- | test/CodeGenCXX/vtable-layout.cpp | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/test/CodeGenCXX/vtable-layout.cpp b/test/CodeGenCXX/vtable-layout.cpp index 19619d0f2b..2e08df9ed9 100644 --- a/test/CodeGenCXX/vtable-layout.cpp +++ b/test/CodeGenCXX/vtable-layout.cpp @@ -1150,4 +1150,71 @@ struct E : D { virtual void e(); }; void E::e() { } + +} + +namespace Test28 { + +// Check that we do include the vtable for B in the D-in-E construction vtable, since +// B is a base class of a virtual base (C). + +struct A { + virtual void a(); +}; + +struct B { + virtual void b(); +}; + +struct C : A, B { + virtual void c(); +}; + +struct D : virtual C { +}; + +// CHECK: Vtable for 'Test28::E' (14 entries). +// CHECK-NEXT: 0 | vbase_offset (8) +// CHECK-NEXT: 1 | offset_to_top (0) +// CHECK-NEXT: 2 | Test28::E RTTI +// CHECK-NEXT: -- (Test28::D, 0) vtable address -- +// CHECK-NEXT: -- (Test28::E, 0) vtable address -- +// CHECK-NEXT: 3 | void Test28::E::e() +// CHECK-NEXT: 4 | vcall_offset (8) +// CHECK-NEXT: 5 | vcall_offset (0) +// CHECK-NEXT: 6 | vcall_offset (0) +// CHECK-NEXT: 7 | offset_to_top (-8) +// CHECK-NEXT: 8 | Test28::E RTTI +// CHECK-NEXT: -- (Test28::A, 8) vtable address -- +// CHECK-NEXT: -- (Test28::C, 8) vtable address -- +// CHECK-NEXT: 9 | void Test28::A::a() +// CHECK-NEXT: 10 | void Test28::C::c() +// CHECK-NEXT: 11 | offset_to_top (-16) +// CHECK-NEXT: 12 | Test28::E RTTI +// CHECK-NEXT: -- (Test28::B, 16) vtable address -- +// CHECK-NEXT: 13 | void Test28::B::b() + +// CHECK: Construction vtable for ('Test28::D', 0) in 'Test28::E' (13 entries). +// CHECK-NEXT: 0 | vbase_offset (8) +// CHECK-NEXT: 1 | offset_to_top (0) +// CHECK-NEXT: 2 | Test28::D RTTI +// CHECK-NEXT: -- (Test28::D, 0) vtable address -- +// CHECK-NEXT: 3 | vcall_offset (8) +// CHECK-NEXT: 4 | vcall_offset (0) +// CHECK-NEXT: 5 | vcall_offset (0) +// CHECK-NEXT: 6 | offset_to_top (-8) +// CHECK-NEXT: 7 | Test28::D RTTI +// CHECK-NEXT: -- (Test28::A, 8) vtable address -- +// CHECK-NEXT: -- (Test28::C, 8) vtable address -- +// CHECK-NEXT: 8 | void Test28::A::a() +// CHECK-NEXT: 9 | void Test28::C::c() +// CHECK-NEXT: 10 | offset_to_top (-16) +// CHECK-NEXT: 11 | Test28::D RTTI +// CHECK-NEXT: -- (Test28::B, 16) vtable address -- +// CHECK-NEXT: 12 | void Test28::B::b() +struct E : D { + virtual void e(); +}; +void E::e() { } + } |