[llvm] r180032 - Extra paranoid test for r179925 (verify that tail calls are not generated to 'this'-returning constructors of objects with different 'this' pointers than the caller)

Stephen Lin stephenwlin at gmail.com
Mon Apr 22 10:23:49 PDT 2013


Author: stephenwlin
Date: Mon Apr 22 12:23:49 2013
New Revision: 180032

URL: http://llvm.org/viewvc/llvm-project?rev=180032&view=rev
Log:
Extra paranoid test for r179925 (verify that tail calls are not generated to 'this'-returning constructors of objects with different 'this' pointers than the caller)

Modified:
    llvm/trunk/test/CodeGen/ARM/this-return.ll

Modified: llvm/trunk/test/CodeGen/ARM/this-return.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/this-return.ll?rev=180032&r1=180031&r2=180032&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/this-return.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/this-return.ll Mon Apr 22 12:23:49 2013
@@ -5,6 +5,7 @@
 %struct.B = type { i32 }
 %struct.C = type { %struct.B }
 %struct.D = type { %struct.B }
+%struct.E = type { %struct.B, %struct.B }
 
 declare %struct.A* @A_ctor_base(%struct.A* returned)
 declare %struct.B* @B_ctor_base(%struct.B* returned, i32)
@@ -89,3 +90,16 @@ entry:
   %call2 = tail call %struct.B* @B_ctor_complete(%struct.B* %b, i32 %x)
   ret %struct.D* %this
 }
+
+define %struct.E* @E_ctor_base(%struct.E* %this, i32 %x) {
+entry:
+; CHECKELF: E_ctor_base:
+; CHECKELF-NOT: b B_ctor_complete
+; CHECKT2D: E_ctor_base:
+; CHECKT2D-NOT: b.w _B_ctor_complete
+  %b = getelementptr inbounds %struct.E* %this, i32 0, i32 0
+  %call = tail call %struct.B* @B_ctor_complete(%struct.B* %b, i32 %x)
+  %b2 = getelementptr inbounds %struct.E* %this, i32 0, i32 1
+  %call2 = tail call %struct.B* @B_ctor_complete(%struct.B* %b2, i32 %x)
+  ret %struct.E* %this
+}





More information about the llvm-commits mailing list