1; RUN: opt %loadPolly -polly-codegen \
2; RUN:     -S < %s | FileCheck %s
3;
4; This will just check that we generate valid code here.
5;
6; CHECK: polly.start:
7;
8;    void f(int *A, int *B) {
9;      for (int i = 0; i < 1024; i++)
10;        A[i % 3] = B[i / 42];
11;    }
12;
13target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
14
15define void @f(i32* %A, i32* %B, i32 %N) {
16bb:
17  br label %bb1
18
19bb1:                                              ; preds = %bb9, %bb
20  %i.0 = phi i32 [ 0, %bb ], [ %tmp10, %bb9 ]
21  %exitcond = icmp ne i32 %i.0, %N
22  br i1 %exitcond, label %bb2, label %bb11
23
24bb2:                                              ; preds = %bb1
25  %tmp = sdiv i32 %i.0, 42
26  %tmp3 = sext i32 %tmp to i64
27  %tmp4 = getelementptr inbounds i32, i32* %B, i64 %tmp3
28  %tmp5 = load i32, i32* %tmp4, align 4
29  %tmp6 = srem i32 %i.0, 3
30  %tmp7 = sext i32 %tmp6 to i64
31  %tmp8 = getelementptr inbounds i32, i32* %A, i64 %tmp7
32  store i32 %tmp5, i32* %tmp8, align 4
33  br label %bb9
34
35bb9:                                              ; preds = %bb2
36  %tmp10 = add nuw nsw i32 %i.0, 1
37  br label %bb1
38
39bb11:                                             ; preds = %bb1
40  ret void
41}
42