Fix PR7328: when turning a tail recursion into a loop, need to preserve
[oota-llvm.git] / test / Transforms / TailCallElim / 2010-06-26-MultipleReturnValues.ll
1 ; RUN: opt < %s -tailcallelim -S | FileCheck %s
2 ; PR7328
3 define i32 @foo(i32 %x) {
4 ; CHECK: define i32 @foo
5 entry:
6   %cond = icmp ugt i32 %x, 0                      ; <i1> [#uses=1]
7   br i1 %cond, label %return, label %body
8
9 body:                                             ; preds = %entry
10   %y = add i32 %x, 1                              ; <i32> [#uses=1]
11   %tmp = call i32 @foo(i32 %y)                    ; <i32> [#uses=0]
12   ret i32 0
13 ; CHECK: ret i32 0
14
15 return:                                           ; preds = %entry
16   ret i32 1
17 }