1; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s
2target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
3
4declare void @foo()
5
6define i32 @main(i8* %A) nounwind uwtable {
7entry:
8  br label %for.cond
9
10for.cond:                                         ; preds = %for.inc5, %entry
11  %indvar_out = phi i64 [ %indvar_out.next, %for.inc5 ], [ 0, %entry ]
12  call void @foo()
13  %tmp = add i64 %indvar_out, 2
14  %exitcond5 = icmp ne i64 %indvar_out, 1023
15  br i1 %exitcond5, label %for.body, label %for.end7
16
17for.body:                                         ; preds = %for.cond
18  br label %for.cond1
19
20for.cond1:                                        ; preds = %for.inc, %for.body
21  %indvar = phi i64 [ %indvar.next, %for.inc ], [ 0, %for.body ]
22  %exitcond = icmp ne i64 %indvar, 1023
23  br i1 %exitcond, label %for.body3, label %for.end
24
25for.body3:                                        ; preds = %for.cond1
26  %tmp1 = add i64 %tmp, %indvar
27  %cmp4 = icmp sgt i64 %tmp1, 1000
28  br i1 %cmp4, label %if.then, label %if.end
29
30if.then:                                          ; preds = %for.body3
31  %arrayidx = getelementptr i8, i8* %A, i64 %indvar
32  store i8 5, i8* %arrayidx
33  br label %if.end
34
35if.end:                                           ; preds = %if.end.single_exit
36  br label %for.inc
37
38for.inc:                                          ; preds = %if.end
39  %indvar.next = add i64 %indvar, 1
40  br label %for.cond1
41
42for.end:                                          ; preds = %for.cond1
43  br label %for.inc5
44
45for.inc5:                                         ; preds = %for.end
46  %indvar_out.next = add i64 %indvar_out, 1
47  br label %for.cond
48
49for.end7:                                         ; preds = %for.cond
50  ret i32 0
51}
52
53; CHECK:      p0: {0,+,1}<%for.cond>
54;
55; CHECK:      Statements {
56; CHECK-NEXT:     Stmt_if_then
57; CHECK-NEXT:         Domain :=
58; CHECK-NEXT:             [p_0] -> { Stmt_if_then[i0] : i0 >= 0 and 999 - p_0 <= i0 <= 1022 };
59; CHECK-NEXT:         Schedule :=
60; CHECK-NEXT:             [p_0] -> { Stmt_if_then[i0] -> [0, i0] };
61; CHECK-NEXT:         MustWriteAccess :=    [Reduction Type: NONE] [Scalar: 0]
62; CHECK-NEXT:             [p_0] -> { Stmt_if_then[i0] -> MemRef_A[i0] };
63; CHECK-NEXT:     Stmt_for_inc5
64; CHECK-NEXT:         Domain :=
65; CHECK-NEXT:             [p_0] -> { Stmt_for_inc5[] };
66; CHECK-NEXT:         Schedule :=
67; CHECK-NEXT:             [p_0] -> { Stmt_for_inc5[] -> [1, 0] };
68; CHECK-NEXT:         MustWriteAccess :=    [Reduction Type: NONE] [Scalar: 1]
69; CHECK-NEXT:             [p_0] -> { Stmt_for_inc5[] -> MemRef_indvar_out_next[] };
70; CHECK-NEXT: }
71
72