1; RUN: opt %loadPolly -S  -polly-codegen < %s | FileCheck %s
2;
3;    void f(int *A, int c, int N) {
4;      int tmp;
5;      for (int i = 0; i < N; i++) {
6;        if (i > c)
7;          tmp = 3;
8;        else
9;          tmp = 5;
10;        A[i] = tmp;
11;      }
12;    }
13;
14; CHECK-LABEL: bb:
15; CHECK-DAG:   %tmp.0.s2a = alloca i32
16; CHECK-DAG:   %tmp.0.phiops = alloca i32
17; CHECK-LABEL: polly.stmt.bb8:
18; CHECK:       %tmp.0.phiops.reload = load i32, i32* %tmp.0.phiops
19; CHECK:       store i32 %tmp.0.phiops.reload, i32* %tmp.0.s2a
20; CHECK-LABEL: polly.stmt.bb8b:
21; CHECK:       %tmp.0.s2a.reload = load i32, i32* %tmp.0.s2a
22; CHECK:       store i32 %tmp.0.s2a.reload,
23; CHECK-LABEL: polly.stmt.bb7:
24; CHECK:       store i32 5, i32* %tmp.0.phiops
25; CHECK-LABEL: polly.stmt.bb6:
26; CHECK:       store i32 3, i32* %tmp.0.phiops
27
28target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
29
30define void @f(i32* %A, i32 %c, i32 %N) {
31bb:
32  %tmp = sext i32 %N to i64
33  %tmp1 = sext i32 %c to i64
34  br label %bb2
35
36bb2:                                              ; preds = %bb10, %bb
37  %indvars.iv = phi i64 [ %indvars.iv.next, %bb10 ], [ 0, %bb ]
38  %tmp3 = icmp slt i64 %indvars.iv, %tmp
39  br i1 %tmp3, label %bb4, label %bb11
40
41bb4:                                              ; preds = %bb2
42  %tmp5 = icmp sgt i64 %indvars.iv, %tmp1
43  br i1 %tmp5, label %bb6, label %bb7
44
45bb6:                                              ; preds = %bb4
46  br label %bb8
47
48bb7:                                              ; preds = %bb4
49  br label %bb8
50
51bb8:                                              ; preds = %bb7, %bb6
52  %tmp.0 = phi i32 [ 3, %bb6 ], [ 5, %bb7 ]
53  br label %bb8b
54
55bb8b:
56  %tmp9 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv
57  store i32 %tmp.0, i32* %tmp9, align 4
58  br label %bb10
59
60bb10:                                             ; preds = %bb8
61  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
62  br label %bb2
63
64bb11:                                             ; preds = %bb2
65  ret void
66}
67