1; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s
2;
3; CHECK:         Context:
4; CHECK-NEXT:    [N] -> {  : -2147483648 <= N <= 2147483647 }
5; CHECK-NEXT:    Assumed Context:
6; CHECK-NEXT:    [N] -> {  :  }
7; CHECK-NEXT:    Invalid Context:
8; CHECK-NEXT:    [N] -> {  : N >= 514 }
9;
10; CHECK:         Statements {
11; CHECK-NEXT:    	Stmt_if_end
12; CHECK-NEXT:            Domain :=
13; CHECK-NEXT:                [N] -> { Stmt_if_end[i0] : 0 <= i0 < N };
14; CHECK-NEXT:            Schedule :=
15; CHECK-NEXT:                [N] -> { Stmt_if_end[i0] -> [i0] };
16; CHECK-NEXT:            ReadAccess :=	[Reduction Type: +] [Scalar: 0]
17; CHECK-NEXT:                [N] -> { Stmt_if_end[i0] -> MemRef_A[i0] };
18; CHECK-NEXT:            MustWriteAccess :=	[Reduction Type: +] [Scalar: 0]
19; CHECK-NEXT:                [N] -> { Stmt_if_end[i0] -> MemRef_A[i0] };
20; CHECK-NEXT:    }
21;
22;    void f();
23;    void g(int *A, int N) {
24;      for (int i = 0; i < N; i++) {
25;        if (i > 512) {
26;          f();
27;          A[i]++;
28;        }
29;        A[i]++;
30;      }
31;    }
32;
33target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
34
35define void @g(i32* %A, i32 %N) {
36entry:
37  %tmp = sext i32 %N to i64
38  br label %for.cond
39
40for.cond:                                         ; preds = %for.inc, %entry
41  %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
42  %cmp = icmp slt i64 %indvars.iv, %tmp
43  br i1 %cmp, label %for.body, label %for.end
44
45for.body:                                         ; preds = %for.cond
46  %cmp1 = icmp sgt i64 %indvars.iv, 512
47  br i1 %cmp1, label %if.then, label %if.end
48
49if.then:                                          ; preds = %for.body
50  call void (...) @f() #2
51  %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv
52  %tmp12 = load i32, i32* %arrayidx2, align 4
53  %inc2 = add nsw i32 %tmp12, 1
54  store i32 %inc2, i32* %arrayidx2, align 4
55  br label %if.end
56
57if.end:                                           ; preds = %if.then, %for.body
58  %arrayidx = getelementptr inbounds i32, i32* %A, i64 %indvars.iv
59  %tmp1 = load i32, i32* %arrayidx, align 4
60  %inc = add nsw i32 %tmp1, 1
61  store i32 %inc, i32* %arrayidx, align 4
62  br label %for.inc
63
64for.inc:                                          ; preds = %if.end
65  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
66  br label %for.cond
67
68for.end:                                          ; preds = %for.cond
69  ret void
70}
71
72declare void @f(...)
73