1; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s
2;
3; The constraint that r2 has to be bigger than r1 is implicitly containted in
4; the domain, hence we do not want to see it explicitly.
5;
6; CHECK-NOT:  r2 >= 1 + r1
7;
8;    void wraps(int *A, int p, short q, char r1, char r2) {
9;      for (char i = r1; i < r2; i++)
10;        A[p + q] = A[(int)r1 + (int)r2];
11;    }
12;
13target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
14
15define void @wraps(i32* %A, i32 %p, i16 signext %q, i8 signext %r1, i8 signext %r2) {
16entry:
17  br label %for.cond
18
19for.cond:                                         ; preds = %for.inc, %entry
20  %i.0 = phi i8 [ %r1, %entry ], [ %inc, %for.inc ]
21  %cmp = icmp slt i8 %i.0, %r2
22  br i1 %cmp, label %for.body, label %for.end
23
24for.body:                                         ; preds = %for.cond
25  %conv3 = sext i8 %r1 to i64
26  %conv4 = sext i8 %r2 to i64
27  %add = add nsw i64 %conv3, %conv4
28  %arrayidx = getelementptr inbounds i32, i32* %A, i64 %add
29  %tmp = load i32, i32* %arrayidx, align 4
30  %conv5 = sext i16 %q to i32
31  %add6 = add nsw i32 %conv5, %p
32  %idxprom7 = sext i32 %add6 to i64
33  %arrayidx8 = getelementptr inbounds i32, i32* %A, i64 %idxprom7
34  store i32 %tmp, i32* %arrayidx8, align 4
35  br label %for.inc
36
37for.inc:                                          ; preds = %for.body
38  %inc = add i8 %i.0, 1
39  br label %for.cond
40
41for.end:                                          ; preds = %for.cond
42  ret void
43}
44