1; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s
2;
3; TODO: FIXME: Investigate why we need a InvalidContext here.
4;
5;    void f(int *A, int *B) {
6;      while (A != B) {
7;        *A = *A + 1;
8;        A++;
9;      }
10;    }
11;
12; CHECK:      Invalid Context:
13; CHECK-NEXT:   [A, B] -> { : (4*floor((A - B)/4) < A - B) or ((-A + B) mod 4 = 0 and B >= 9223372036854775808 + A) or ((-A + B) mod 4 = 0 and B <= -4 + A) }
14;
15; CHECK:      Domain :=
16; CHECK-NEXT:   [A, B] -> { Stmt_while_body[i0] : (-A + B) mod 4 = 0 and i0 >= 0 and 4i0 <= -4 - A + B };
17;
18target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
19
20define void @f(i32* %A, i32* %B) {
21entry:
22  br label %while.cond
23
24while.cond:                                       ; preds = %while.body, %entry
25  %A.addr.0 = phi i32* [ %A, %entry ], [ %incdec.ptr, %while.body ]
26  %cmp = icmp eq i32* %A.addr.0, %B
27  br i1 %cmp, label %while.end, label %while.body
28
29while.body:                                       ; preds = %while.cond
30  %tmp = load i32, i32* %A.addr.0, align 4
31  %add = add nsw i32 %tmp, 1
32  store i32 %add, i32* %A.addr.0, align 4
33  %incdec.ptr = getelementptr inbounds i32, i32* %A.addr.0, i64 1
34  br label %while.cond
35
36while.end:                                        ; preds = %while.cond
37  ret void
38}
39