diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-05-01 21:35:41 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-05-01 21:35:41 +0000 |
commit | ead97576a962ab9e6dfc3d09e5aafe301acad404 (patch) | |
tree | 84191bb53dd642417b53decdf8c72b46b17edf93 /clang/test | |
parent | 0de23468590ba8db68596ac3e84a85978f890f3c (diff) | |
download | bcm5719-llvm-ead97576a962ab9e6dfc3d09e5aafe301acad404.tar.gz bcm5719-llvm-ead97576a962ab9e6dfc3d09e5aafe301acad404.zip |
[MS ABI] NV bases may indirectly contain covariant thunks from V Bases
A class might contain multiple ways of getting to a vbase, some of which
are virtual and other non-virtual. It may be the case that a
non-virtual base contains an override of a method in a vbase. This
means that we must carefully pick between a set of nvbases to determine
which is the best.
As a consequence, the findPathForVPtr algorithm is considerably simpler.
llvm-svn: 236353
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/CodeGenCXX/microsoft-abi-vtables-return-thunks.cpp | 17 | ||||
-rw-r--r-- | clang/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp | 4 |
2 files changed, 19 insertions, 2 deletions
diff --git a/clang/test/CodeGenCXX/microsoft-abi-vtables-return-thunks.cpp b/clang/test/CodeGenCXX/microsoft-abi-vtables-return-thunks.cpp index 36c6434d549..741f85cb52f 100644 --- a/clang/test/CodeGenCXX/microsoft-abi-vtables-return-thunks.cpp +++ b/clang/test/CodeGenCXX/microsoft-abi-vtables-return-thunks.cpp @@ -155,3 +155,20 @@ C::C() {} // GLOBALS: @"\01?f@B@pr21073@@WPPPPPPPI@AEPAUA@2@XZ" // GLOBALS: @"\01?f@B@pr21073@@WPPPPPPPI@AEPAU12@XZ" } + +namespace pr21073_2 { +struct A { virtual A *foo(); }; +struct B : virtual A {}; +struct C : virtual A { virtual C *foo(); }; +struct D : B, C { D(); }; +D::D() {} + +// VFTABLES-LABEL: VFTable for 'pr21073_2::A' in 'pr21073_2::C' in 'pr21073_2::D' (2 entries) +// VFTABLES-NEXT: 0 | pr21073_2::C *pr21073_2::C::foo() +// VFTABLES-NEXT: [return adjustment (to type 'struct pr21073_2::A *'): vbase #1, 0 non-virtual] +// VFTABLES-NEXT: 1 | pr21073_2::C *pr21073_2::C::foo() + +// GLOBALS-LABEL: @"\01??_7D@pr21073_2@@6B@" = {{.*}} constant [2 x i8*] +// GLOBALS: @"\01?foo@C@pr21073_2@@QAEPAUA@2@XZ" +// GLOBALS: @"\01?foo@C@pr21073_2@@UAEPAU12@XZ" +} diff --git a/clang/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp b/clang/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp index d600ebbf4c2..1a6797c80ec 100644 --- a/clang/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp +++ b/clang/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp @@ -423,7 +423,7 @@ void use(T *obj) { obj->f(); } namespace Test10 { struct X : virtual C, virtual A { - // CHECK-LABEL: VFTable for 'A' in 'Test10::X' (2 entries). + // CHECK-LABEL: VFTable for 'A' in 'C' in 'Test10::X' (2 entries). // CHECK-NEXT: 0 | void Test10::X::f() // CHECK-NEXT: 1 | void A::z() @@ -782,7 +782,7 @@ struct B : virtual A { virtual void g(void); }; struct C : virtual A, B { C(); }; C::C() {} -// CHECK-LABEL: VFTable for 'pr21031_1::A' in 'pr21031_1::B' in 'pr21031_1::C' (1 entry) +// CHECK-LABEL: VFTable for 'pr21031_1::A' in 'pr21031_1::C' (1 entry) // CHECK-NEXT: 0 | void pr21031_1::A::f() // CHECK-LABEL: VFTable for 'pr21031_1::B' in 'pr21031_1::C' (1 entry) |