blob: fca974f7c2389d8c481c04af8eae4a9f36980147 [file] [log] [blame]
Wojciech Matyjewicz52c7a382008-02-12 15:12:40 +00001; RUN: llvm-as < %s | opt -analyze -scalar-evolution | grep {Loop bb: 100 iterations}
Dan Gohmanf17a25c2007-07-18 16:29:46 +00002; PR1533
3
4@array = weak global [101 x i32] zeroinitializer, align 32 ; <[100 x i32]*> [#uses=1]
5
6define void @loop(i32 %x) {
7entry:
8 br label %bb
9
10bb: ; preds = %bb, %entry
11 %i.01.0 = phi i32 [ 100, %entry ], [ %tmp4, %bb ] ; <i32> [#uses=2]
12 %tmp1 = getelementptr [101 x i32]* @array, i32 0, i32 %i.01.0 ; <i32*> [#uses=1]
13 store i32 %x, i32* %tmp1
14 %tmp4 = add i32 %i.01.0, -1 ; <i32> [#uses=2]
15 %tmp7 = icmp sgt i32 %tmp4, -1 ; <i1> [#uses=1]
16 br i1 %tmp7, label %bb, label %return
17
18return: ; preds = %bb
19 ret void
20}