blob: d715f688f1922e5a5a75c108a01c077154a26409 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; 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
6int %test() {
7 br label %Loop
8Loop:
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