aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/TailCallElim/inf-recursion.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/TailCallElim/inf-recursion.ll')
-rw-r--r--test/Transforms/TailCallElim/inf-recursion.ll21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/Transforms/TailCallElim/inf-recursion.ll b/test/Transforms/TailCallElim/inf-recursion.ll
index 157226f..c121c25 100644
--- a/test/Transforms/TailCallElim/inf-recursion.ll
+++ b/test/Transforms/TailCallElim/inf-recursion.ll
@@ -31,3 +31,24 @@ define float @fabsf(float %f) {
}
declare x86_fp80 @fabsl(x86_fp80 %f)
+
+; Don't crash while transforming a function with infinite recursion.
+define i32 @PR22704(i1 %bool) {
+entry:
+ br i1 %bool, label %t, label %f
+
+t:
+ %call1 = call i32 @PR22704(i1 1)
+ br label %return
+
+f:
+ %call = call i32 @PR22704(i1 1)
+ br label %return
+
+return:
+ ret i32 0
+
+; CHECK-LABEL: @PR22704(
+; CHECK: %bool.tr = phi i1 [ %bool, %entry ], [ true, %t ], [ true, %f ]
+; CHECK: br i1 %bool.tr, label %t, label %f
+}