blob: f45bdab4be5876b4e41026318e40f598ec51e261 [file] [log] [blame]
Dan Gohman3c7d3082009-09-11 18:01:28 +00001; RUN: opt < %s -indvars -S | grep indvar
Dan Gohmanf17a25c2007-07-18 16:29:46 +00002
Tanya Lattner4c4d0b82008-03-01 09:15:35 +00003@G = global i64 0 ; <i64*> [#uses=1]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00004
Tanya Lattner4c4d0b82008-03-01 09:15:35 +00005define void @test(i64 %V) {
6; <label>:0
7 br label %Loop
8
9Loop: ; preds = %Loop, %0
10 %X = phi i64 [ 1, %0 ], [ %X.next, %Loop ] ; <i64> [#uses=2]
11 %X.next = sub i64 %X, %V ; <i64> [#uses=1]
12 store i64 %X, i64* @G
13 br label %Loop
Dan Gohmanf17a25c2007-07-18 16:29:46 +000014}
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000015