Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame^] | 1 | ; RUN: llvm-upgrade < %s | llvm-as | opt -indvars | llvm-dis | %prcontext Loop: 1 | grep %indvar |
| 2 | |
| 3 | ; The indvar simplification code should ensure that the first PHI in the block |
| 4 | ; is the canonical one! |
| 5 | |
| 6 | int %test() { |
| 7 | br label %Loop |
| 8 | Loop: |
| 9 | %NonIndvar = phi int [200, %0], [%NonIndvarNext, %Loop] |
| 10 | %Canonical = phi int [0, %0], [%CanonicalNext, %Loop] |
| 11 | |
| 12 | %NonIndvarNext = div int %NonIndvar, 2 |
| 13 | %CanonicalNext = add int %Canonical, 1 |
| 14 | br label %Loop |
| 15 | } |
| 16 | |