summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorStephen Lin <stephenwlin@gmail.com>2013-04-22 17:23:49 +0000
committerStephen Lin <stephenwlin@gmail.com>2013-04-22 17:23:49 +0000
commit2ec1b100a477326b5ab2a6cb2dd41658e4bb49a7 (patch)
tree118a1266f61f38e865dcf6b2f1e76185b9412384 /llvm/test
parent0577df4aec15c6959ab3984f930946ef5d6220a4 (diff)
downloadbcm5719-llvm-2ec1b100a477326b5ab2a6cb2dd41658e4bb49a7.tar.gz
bcm5719-llvm-2ec1b100a477326b5ab2a6cb2dd41658e4bb49a7.zip
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)
llvm-svn: 180032
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/ARM/this-return.ll14
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/this-return.ll b/llvm/test/CodeGen/ARM/this-return.ll
index 0266153b941..f06e4a4f8dd 100644
--- a/llvm/test/CodeGen/ARM/this-return.ll
+++ b/llvm/test/CodeGen/ARM/this-return.ll
@@ -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
+}
OpenPOWER on IntegriCloud