diff options
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) |