1*5c028081SMichael Kruse; RUN: opt %loadPolly -basic-aa -polly-print-import-jscop -disable-output < %s | FileCheck %s
235f70200SMichael Kruse;
335f70200SMichael Kruse; Check that we allow the new access functions even though they access
435f70200SMichael Kruse; different locations than the original ones (but the alignment is the
535f70200SMichael Kruse; default, thus there is no problem).
635f70200SMichael Kruse;
735f70200SMichael Kruse; CHECK-DAG: New access function '{ Stmt_for_body[i0] -> MemRef_B[0] }' detected in JSCOP file
835f70200SMichael Kruse; CHECK-DAG: New access function '{ Stmt_for_body[i0] -> MemRef_A[i0] }' detected in JSCOP file
935f70200SMichael Kruse;
1035f70200SMichael Kruse;    void simple_stride(int *restrict A, int *restrict B) {
1135f70200SMichael Kruse;      for (int i = 0; i < 16; i++)
1235f70200SMichael Kruse;        A[i * 2] = B[i * 2];
1335f70200SMichael Kruse;    }
1435f70200SMichael Kruse;
1535f70200SMichael Krusetarget datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
1635f70200SMichael Kruse
1735f70200SMichael Krusedefine void @simple_stride(i32* noalias %A, i32* noalias %B) {
1835f70200SMichael Kruseentry:
1935f70200SMichael Kruse  br label %for.cond
2035f70200SMichael Kruse
2135f70200SMichael Krusefor.cond:                                         ; preds = %for.inc, %entry
2235f70200SMichael Kruse  %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
2335f70200SMichael Kruse  %exitcond = icmp ne i64 %indvars.iv, 16
2435f70200SMichael Kruse  br i1 %exitcond, label %for.body, label %for.end
2535f70200SMichael Kruse
2635f70200SMichael Krusefor.body:                                         ; preds = %for.cond
2735f70200SMichael Kruse  %tmp = shl nsw i64 %indvars.iv, 1
2835f70200SMichael Kruse  %arrayidx = getelementptr inbounds i32, i32* %B, i64 %tmp
2935f70200SMichael Kruse  %tmp4 = load i32, i32* %arrayidx, align 4
3035f70200SMichael Kruse  %tmp5 = shl nsw i64 %indvars.iv, 1
3135f70200SMichael Kruse  %arrayidx3 = getelementptr inbounds i32, i32* %A, i64 %tmp5
3235f70200SMichael Kruse  store i32 %tmp4, i32* %arrayidx3, align 4
3335f70200SMichael Kruse  br label %for.inc
3435f70200SMichael Kruse
3535f70200SMichael Krusefor.inc:                                          ; preds = %for.body
3635f70200SMichael Kruse  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
3735f70200SMichael Kruse  br label %for.cond
3835f70200SMichael Kruse
3935f70200SMichael Krusefor.end:                                          ; preds = %for.cond
4035f70200SMichael Kruse  ret void
4135f70200SMichael Kruse}
42