c3af29bf436f797bab4a835b5e484e592f51d573
[oota-llvm.git] / test / Transforms / LICM / 2008-07-22-LoadGlobalConstant.ll
1 ; RUN: llvm-as < %s | opt -licm | llvm-dis | grep -A 1 entry | grep load.*@a
2 @a = external constant float*
3
4 define void @test(i32 %count) {
5 entry:
6         br label %forcond
7
8 forcond:
9         %i.0 = phi i32 [ 0, %entry ], [ %inc, %forbody ]
10         %cmp = icmp ult i32 %i.0, %count
11         br i1 %cmp, label %forbody, label %afterfor
12
13 forbody:
14         %tmp3 = load float** @a
15         %arrayidx = getelementptr float* %tmp3, i32 %i.0
16         %tmp7 = uitofp i32 %i.0 to float
17         store float %tmp7, float* %arrayidx
18         %inc = add i32 %i.0, 1
19         br label %forcond
20
21 afterfor:
22         ret void
23 }