From 2fdbbe307dd7a3fb0a0cbe5294c6eefbb1e5c32d Mon Sep 17 00:00:00 2001 From: Stephen Lin Date: Mon, 22 Apr 2013 17:23:49 +0000 Subject: [PATCH] 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) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180032 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/ARM/this-return.ll | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/CodeGen/ARM/this-return.ll b/test/CodeGen/ARM/this-return.ll index 0266153b941..f06e4a4f8dd 100644 --- a/test/CodeGen/ARM/this-return.ll +++ b/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 +} -- 2.34.1