summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2010-01-31 06:44:49 +0000
committerEvan Cheng <evan.cheng@apple.com>2010-01-31 06:44:49 +0000
commit7f62def0f9d019493cdcaf014dc4c4774f9fa01a (patch)
tree4c5987d68cf3956b3d4f639f0b85243c850d9b32 /llvm/test
parent0de0b3677ac91f0f864181220c8da7333e113d5a (diff)
downloadbcm5719-llvm-7f62def0f9d019493cdcaf014dc4c4774f9fa01a.tar.gz
bcm5719-llvm-7f62def0f9d019493cdcaf014dc4c4774f9fa01a.zip
Avoid recursive sibcall's.
llvm-svn: 94946
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/X86/tailcall2.ll24
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/tailcall2.ll b/llvm/test/CodeGen/X86/tailcall2.ll
index 6b0916fc675..e78e213d646 100644
--- a/llvm/test/CodeGen/X86/tailcall2.ll
+++ b/llvm/test/CodeGen/X86/tailcall2.ll
@@ -65,3 +65,27 @@ entry:
tail call void %x() nounwind
ret void
}
+
+define i32 @t6(i32 %x) nounwind ssp {
+entry:
+; 32: t6:
+; 32: call {{_?}}t6
+; 32: call {{_?}}bar
+
+; 64: t6:
+; 64: callq {{_?}}t6
+; 64: jmp {{_?}}bar
+ %0 = icmp slt i32 %x, 10
+ br i1 %0, label %bb, label %bb1
+
+bb:
+ %1 = add nsw i32 %x, -1
+ %2 = tail call i32 @t6(i32 %1) nounwind ssp
+ ret i32 %2
+
+bb1:
+ %3 = tail call i32 @bar(i32 %x) nounwind
+ ret i32 %3
+}
+
+declare i32 @bar(i32)
OpenPOWER on IntegriCloud