Fix a bunch of issues found in a testcase from 400.perlbench.
[oota-llvm.git] / test / Transforms / TailCallElim / dont-tce-tail-marked-call.ll
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -tailcallelim | llvm-dis | \
2 ; RUN:    grep {call i32 @foo}
3
4 declare void %bar(int*)
5 int %foo(uint %N) {
6   %A = alloca int, uint %N             ;; Should stay in entry block because of 'tail' marker
7   store int 17, int* %A
8   call void %bar(int* %A)
9
10   %X = tail call int %foo(uint %N)  ;; Cannot -tailcallelim this without increasing stack usage!
11   ret int %X
12 }