From: Anders Carlsson Date: Thu, 18 Feb 2010 17:28:16 +0000 (+0000) Subject: Add another class from cxx-vtable-ex.html X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=54d9a78b2ca41b89f5dc8ec6688086db59667495;p=clang Add another class from cxx-vtable-ex.html git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96588 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGenCXX/vtable-layout-abi-examples.cpp b/test/CodeGenCXX/vtable-layout-abi-examples.cpp index 52c8bc6d8f..5dabe29a21 100644 --- a/test/CodeGenCXX/vtable-layout-abi-examples.cpp +++ b/test/CodeGenCXX/vtable-layout-abi-examples.cpp @@ -46,5 +46,29 @@ struct B: public virtual A { int ib; }; void B::f() {} - + +// CHECK: Vtable for 'Test1::C' (13 entries). +// CHECK-NEXT: 0 | vbase_offset (16) +// CHECK-NEXT: 1 | offset_to_top (0) +// CHECK-NEXT: 2 | Test1::C RTTI +// CHECK-NEXT: -- (Test1::C, 0) vtable address -- +// CHECK-NEXT: 3 | void Test1::C::g() +// CHECK-NEXT: 4 | void Test1::C::h() +// CHECK-NEXT: 5 | vcall_offset (-16) +// CHECK-NEXT: 6 | vcall_offset (-16) +// CHECK-NEXT: 7 | vcall_offset (0) +// CHECK-NEXT: 8 | offset_to_top (-16) +// CHECK-NEXT: 9 | Test1::C RTTI +// CHECK-NEXT: -- (Test1::A, 16) vtable address -- +// CHECK-NEXT: 10 | void Test1::A::f() +// CHECK-NEXT: 11 | void Test1::C::g() +// CHECK-NEXT: [this adjustment: 0 non-virtual, -32 vcall offset offset] +// CHECK-NEXT: 12 | void Test1::C::h() +// CHECK-NEXT: [this adjustment: 0 non-virtual, -40 vcall offset offset] +struct C: public virtual A { + void g (); + void h (); + int ic; +}; +void C::g() {} }