r217686 - Add a previously-missing test case for return adjustment vs pure virtual methods

Timur Iskhodzhanov timurrrr at google.com
Fri Sep 12 08:21:44 PDT 2014


Author: timurrrr
Date: Fri Sep 12 10:21:44 2014
New Revision: 217686

URL: http://llvm.org/viewvc/llvm-project?rev=217686&view=rev
Log:
Add a previously-missing test case for return adjustment vs pure virtual methods

Modified:
    cfe/trunk/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-return-adjustment.cpp

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-return-adjustment.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-return-adjustment.cpp?rev=217686&r1=217685&r2=217686&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-return-adjustment.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-return-adjustment.cpp Fri Sep 12 10:21:44 2014
@@ -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();





More information about the cfe-commits mailing list