blob: 59b51093f40a90760066b5ae3aebeb15015be086 [file] [log] [blame]
Dan Gohman559254b2009-06-17 20:56:26 +00001; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output | grep umax
Nick Lewycky3e630762008-02-20 06:48:22 +00002; PR2003
3
4define i32 @foo(i32 %n) {
5entry:
6 br label %header
7header:
8 %i = phi i32 [ 100, %entry ], [ %i.inc, %next ]
9 %cond = icmp ult i32 %i, %n
10 br i1 %cond, label %next, label %return
11next:
12 %i.inc = add i32 %i, 1
13 br label %header
14return:
15 ret i32 %i
16}
17