llvm.org GIT mirror llvm / fdc7c29
New testcase git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2419 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 17 years ago
1 changed file(s) with 27 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; Simple sanity check testcase. Both alloca's should be eliminated.
1 ; RUN: if as < %s | opt -mem2reg | dis | grep 'alloca'
2 ; RUN: then exit 1
3 ; RUN: else exit 0
4 ; RUN: fi
5
6 implementation
7
8 double "testfunc"(int %i, double %j)
9 begin
10 %I = alloca int
11 %J = alloca double
12
13 store int %i, int* %I
14 store double %j, double* %J
15
16 %t1 = load int* %I
17 %t2 = add int %t1, 1
18 store int %t2, int* %I
19
20 %t3 = load int* %I
21 %t4 = cast int %t3 to double
22 %t5 = load double* %J
23 %t6 = mul double %t4, %t5
24
25 ret double %t6
26 end