Dan Gohman | 5bb7c7c | 2009-09-08 22:34:10 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -loop-index-split -S | not grep undef |
Devang Patel | 85a3729 | 2009-03-30 22:24:10 +0000 | [diff] [blame] | 2 | define i32 @main() { |
| 3 | entry: |
| 4 | br label %header |
| 5 | |
| 6 | header: |
| 7 | %r = phi i32 [ 0, %entry ], [ %r3, %skip ] |
| 8 | %i = phi i32 [ 0, %entry ], [ %i1, %skip ] |
| 9 | %i99 = add i32 %i, 99 |
| 10 | %cond = icmp eq i32 %i99, 3 |
| 11 | br i1 %cond, label %body, label %skip |
| 12 | |
| 13 | body: |
| 14 | br label %skip |
| 15 | |
| 16 | skip: |
| 17 | %r3 = phi i32 [ %r, %header ], [ 3, %body ] |
| 18 | %i1 = add i32 %i, 1 |
| 19 | %exitcond = icmp eq i32 %i1, 10 |
| 20 | br i1 %exitcond, label %exit, label %header |
| 21 | |
| 22 | exit: |
| 23 | ret i32 %r3 |
| 24 | } |