From: Timur Iskhodzhanov Date: Fri, 12 Sep 2014 15:21:44 +0000 (+0000) Subject: Add a previously-missing test case for return adjustment vs pure virtual methods X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4b4db348b6ddca89e10f7a1f681dd7cd15d66986;p=clang Add a previously-missing test case for return adjustment vs pure virtual methods git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217686 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-return-adjustment.cpp b/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-return-adjustment.cpp index 2f46609d09..232c0d9c4d 100644 --- a/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-return-adjustment.cpp +++ b/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-return-adjustment.cpp @@ -296,6 +296,30 @@ struct X : E { void build_vftable(X *obj) { obj->foo(); } } +namespace test7 { +struct A { + virtual A *f() = 0; +}; +struct B { + virtual void g(); +}; +struct C : B, A { + virtual void g(); + virtual C *f() = 0; + // CHECK-LABEL: VFTable for 'test7::B' in 'test7::C' (1 entry). + // CHECK-NEXT: 0 | void test7::C::g() + + // CHECK-LABEL: VFTable for 'test7::A' in 'test7::C' (2 entries). + // CHECK-NEXT: 0 | test7::C *test7::C::f() [pure] + // CHECK-NEXT: 1 | test7::C *test7::C::f() [pure] + + // No return adjusting thunks needed for pure virtual methods. + // CHECK-NOT: Thunks for 'test7::C *test7::C::f()' +}; + +void build_vftable(C *obj) { obj->g(); } +} + namespace pr20444 { struct A { virtual A* f();