diff options
author | Anders Carlsson <andersca@mac.com> | 2010-02-16 04:59:55 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-02-16 04:59:55 +0000 |
commit | 852213e54a1b2c2246776b4bb4e9527d70c98807 (patch) | |
tree | 8895f84f84a7a2bda7a9dd9286c6febd049506d8 /test/CodeGenCXX/vtable-layout.cpp | |
parent | a661a54d50e33d8b58735ef4ded06b1ad639b165 (diff) |
Emit vbase offsets.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96329 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/vtable-layout.cpp')
-rw-r--r-- | test/CodeGenCXX/vtable-layout.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/CodeGenCXX/vtable-layout.cpp b/test/CodeGenCXX/vtable-layout.cpp index a41aad41f9..8fbe486faa 100644 --- a/test/CodeGenCXX/vtable-layout.cpp +++ b/test/CodeGenCXX/vtable-layout.cpp @@ -340,3 +340,28 @@ struct B : A { void B::f() { } } + +namespace Test9 { + +// Simple test of vbase offsets. + +struct A1 { int a1; }; +struct A2 { int a2; }; + +// CHECK: Vtable for 'Test9::B' (5 entries). +// CHECK-NEXT: 0 | vbase_offset (16) +// CHECK-NEXT: 1 | vbase_offset (12) +// CHECK-NEXT: 2 | offset_to_top (0) +// CHECK-NEXT: 3 | Test9::B RTTI +// CHECK-NEXT: -- (Test9::B, 0) vtable address -- +// CHECK-NEXT: 4 | void Test9::B::f() +struct B : virtual A1, virtual A2 { + int b; + + virtual void f(); +}; + + +void B::f() { } + +} |