New testcase
[oota-llvm.git] / test / Transforms / Mem2Reg / PromoteMemToRegister.ll
1 ; Simple sanity check testcase.  Both alloca's should be eliminated.
2 ; RUN: if as < %s | opt -mem2reg | dis | grep 'alloca'
3 ; RUN: then exit 1
4 ; RUN: else exit 0
5 ; RUN: fi
6
7 implementation
8
9 double "testfunc"(int %i, double %j)
10 begin
11         %I = alloca int
12         %J = alloca double
13
14         store int %i, int* %I
15         store double %j, double* %J
16
17         %t1 = load int* %I
18         %t2 = add int %t1, 1
19         store int %t2, int* %I
20
21         %t3 = load int* %I
22         %t4 = cast int %t3 to double
23         %t5 = load double* %J
24         %t6 = mul double %t4, %t5
25
26         ret double %t6
27 end