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