Dan Gohman | e93b1ee | 2009-06-17 20:56:26 +0000 | [diff] [blame] | 1 | ; RUN: llvm-as < %s | opt -scalar-evolution -analyze -disable-output | grep {Loop loop: backedge-taken count is (100 + (-100 smax %n))} |
Wojciech Matyjewicz | a5718fc | 2008-02-12 15:09:36 +0000 | [diff] [blame] | 2 | ; PR2002 |
| 3 | |
| 4 | define void @foo(i8 %n) { |
| 5 | entry: |
| 6 | br label %loop |
| 7 | loop: |
| 8 | %i = phi i8 [ -100, %entry ], [ %i.inc, %next ] |
| 9 | %cond = icmp slt i8 %i, %n |
| 10 | br i1 %cond, label %next, label %return |
| 11 | next: |
| 12 | %i.inc = add i8 %i, 1 |
| 13 | br label %loop |
| 14 | return: |
| 15 | ret void |
| 16 | } |