blob: 47164d86047e6544f1d96591554f9e7def47a61f [file] [log] [blame]
Andrew Trick685f07f2011-04-27 23:00:03 +00001; RUN: opt < %s -indvars -S | FileCheck %s
Dale Johannesen617d1082009-04-27 21:03:15 +00002; PR4086
3declare void @foo()
4
5define void @test() {
6entry:
7 br label %loop_body
8
Andrew Trick685f07f2011-04-27 23:00:03 +00009loop_body:
10 %i = phi float [ %nexti, %loop_body ], [ 0.0, %entry ]
Dale Johannesen617d1082009-04-27 21:03:15 +000011 tail call void @foo()
Dan Gohmanae3a0be2009-06-04 22:49:04 +000012 %nexti = fadd float %i, 1.0
Andrew Trick685f07f2011-04-27 23:00:03 +000013 ; CHECK: icmp ne i32 %{{[a-zA-Z$._0-9]+}}, 2
14 %less = fcmp olt float %nexti, 2.0
Dale Johannesen617d1082009-04-27 21:03:15 +000015 br i1 %less, label %loop_body, label %done
16
Andrew Trick685f07f2011-04-27 23:00:03 +000017done:
Dale Johannesen617d1082009-04-27 21:03:15 +000018 ret void
19}