| Wojciech Matyjewicz | 995624f | 2008-02-12 15:10:35 +0000 | [diff] [blame^] | 1 | ; RUN: llvm-as < %s | opt -scalar-evolution -analyze | grep {Loop header: ( 0 smax %n) iterations!} |
| Wojciech Matyjewicz | adae053 | 2008-02-11 18:37:34 +0000 | [diff] [blame] | 2 | |
| 3 | define void @foo(i32 %n) { | ||||
| 4 | entry: | ||||
| 5 | br label %header | ||||
| 6 | header: | ||||
| 7 | %i = phi i32 [ 0, %entry ], [ %i.inc, %next ] | ||||
| 8 | %cond = icmp sgt i32 %n, %i | ||||
| 9 | br i1 %cond, label %next, label %return | ||||
| 10 | next: | ||||
| 11 | %i.inc = add i32 %i, 1 | ||||
| 12 | br label %header | ||||
| 13 | return: | ||||
| 14 | ret void | ||||
| 15 | } | ||||