1; RUN: opt %loadPolly -polly-allow-nonaffine -polly-dce -polly-ast -analyze < %s | FileCheck %s
2;
3; CHECK: for (int c0 = 0; c0 <= 1023; c0 += 1)
4;
5;    void f(int *A) {
6;      for (int i = 0; i < 1024; i++)
7;        A[bar(i)] = i;
8;    }
9;
10target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
11
12declare i32 @bar(i32) #1
13
14define void @f(i32* %A) {
15entry:
16  br label %for.cond
17
18for.cond:                                         ; preds = %for.inc, %entry
19  %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
20  %exitcond = icmp ne i32 %i.0, 1024
21  br i1 %exitcond, label %for.body, label %for.end
22
23for.body:                                         ; preds = %for.cond
24  %nonaff = call i32 @bar(i32 %i.0)
25  %arrayidx = getelementptr inbounds i32, i32* %A, i32 %nonaff
26  store i32 %i.0, i32* %arrayidx, align 4
27  br label %for.inc
28
29for.inc:                                          ; preds = %for.body
30  %inc = add nsw i32 %i.0, 1
31  br label %for.cond
32
33for.end:                                          ; preds = %for.cond
34  ret void
35}
36
37attributes #1 = { nounwind readnone }
38