blob: 53f4b9d5b9fff2a5c0e2e87a28b768d06fc63f52 [file] [log] [blame]
Chris Lattner9cd727c2005-03-06 21:47:40 +00001; Check that this test makes INDVAR and related stuff dead.
Dan Gohman18800922009-09-11 18:01:28 +00002; RUN: opt < %s -loop-reduce -S | not grep INDVAR
Chris Lattner9cd727c2005-03-06 21:47:40 +00003
Tanya Lattnerab7872c2008-03-19 07:28:33 +00004declare i1 @pred()
Chris Lattner9cd727c2005-03-06 21:47:40 +00005
Tanya Lattnerab7872c2008-03-19 07:28:33 +00006define void @test(i32* %P) {
7; <label>:0
Chris Lattner9cd727c2005-03-06 21:47:40 +00008 br label %Loop
Tanya Lattnerab7872c2008-03-19 07:28:33 +00009Loop: ; preds = %Loop, %0
10 %INDVAR = phi i32 [ 0, %0 ], [ %INDVAR2, %Loop ] ; <i32> [#uses=2]
11 %STRRED = getelementptr i32* %P, i32 %INDVAR ; <i32*> [#uses=1]
12 store i32 0, i32* %STRRED
13 %INDVAR2 = add i32 %INDVAR, 1 ; <i32> [#uses=1]
14 %cond = call i1 @pred( ) ; <i1> [#uses=1]
15 br i1 %cond, label %Loop, label %Out
16Out: ; preds = %Loop
Chris Lattner9cd727c2005-03-06 21:47:40 +000017 ret void
18}
Tanya Lattnerab7872c2008-03-19 07:28:33 +000019