New testcase for automatic insertion of accumulator variables to eliminate
[oota-llvm.git] / test / Transforms / TailCallElim / accum_recursion.ll
1 ; RUN: llvm-as < %s | opt -tailcallelim | llvm-dis | not grep call
2
3 int %factorial(int %x) {
4 entry:
5         %tmp.1 = setgt int %x, 0
6         br bool %tmp.1, label %then, label %else
7
8 then:
9         %tmp.6 = add int %x, -1
10         %tmp.4 = call int %factorial( int %tmp.6 )
11         %tmp.7 = mul int %tmp.4, %x
12         ret int %tmp.7
13
14 else:
15         ret int 1
16 }
17