1 ; RUN: opt < %s -passes=indvars -S | FileCheck %s
3 ; Provide legal integer types.
4 target datalayout = "e-p:32:32:32-n8:16:32:64"
7 define void @foo(ptr nocapture %x, i32 %n) nounwind {
13 %tmp102 = icmp sgt i32 %n, 0 ; <i1> [#uses=1]
14 br i1 %tmp102, label %bb.nph, label %return
16 bb.nph: ; preds = %entry
19 bb: ; preds = %bb7, %bb.nph
20 %i.01 = phi i32 [ %tmp6, %bb7 ], [ 0, %bb.nph ] ; <i32> [#uses=3]
21 %tmp1 = sext i32 %i.01 to i64 ; <i64> [#uses=1]
22 %tmp4 = getelementptr i64, ptr %x, i32 %i.01 ; <ptr> [#uses=1]
23 store i64 %tmp1, ptr %tmp4, align 8
24 %tmp6 = add i32 %i.01, 1 ; <i32> [#uses=2]
28 %tmp10 = icmp slt i32 %tmp6, %n ; <i1> [#uses=1]
29 br i1 %tmp10, label %bb, label %bb7.return_crit_edge
31 bb7.return_crit_edge: ; preds = %bb7
34 return: ; preds = %bb7.return_crit_edge, %entry