1 ; RUN: opt < %s -indvars -S | FileCheck %s
3 ; Provide legal integer types.
4 target datalayout = "n8:16:32:64"
7 target triple = "x86_64-apple-darwin"
14 ; One trunc for the gep.
15 ; CHECK: trunc i64 %indvars.iv to i32
16 ; One trunc for the dummy() call.
17 ; CHECK-LABEL: exit24:
18 ; CHECK: trunc i64 {{.*}}lcssa.wide to i32
19 define void @sloop(i32* %a) {
21 br i1 undef, label %B18, label %B6
23 B18: ; preds = %B24, %Prologue
24 %.02 = phi i32 [ 0, %Prologue ], [ %tmp33, %B24 ]
25 %tmp23 = zext i32 %.02 to i64
26 %tmp33 = add i32 %.02, 1
27 %o = getelementptr i32, i32* %a, i32 %.02
28 %v = load i32, i32* %o
29 %t = icmp eq i32 %v, 0
30 br i1 %t, label %exit24, label %B24
33 %t2 = icmp eq i32 %tmp33, 20
34 br i1 %t2, label %B6, label %B18
36 B6: ; preds = %Prologue
39 exit24: ; preds = %B18
40 call void @dummy(i32 %.02)
44 declare void @dummy(i32)