1 ; Check that the index of 'P[outer]' is pulled out of the loop.
2 ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | \
3 ; RUN: not grep {getelementptr.*%outer.*%INDVAR}
8 void %test([10000 x int]* %P) {
9 %outer = call int %foo()
12 %INDVAR = phi int [0, %0], [%INDVAR2, %Loop]
14 %STRRED = getelementptr [10000 x int]* %P, int %outer, int %INDVAR
15 store int 0, int* %STRRED
17 %INDVAR2 = add int %INDVAR, 1
18 %cond = call bool %pred()
19 br bool %cond, label %Loop, label %Out