Update Polly tests to handle explicitly typed gep changes in LLVM
[polly-mirror.git] / test / Isl / CodeGen / MemAccess / bad_alignment.ll
blob61afde7a09d967804c36e01dc58a8c7af796f3a1
1 ; RUN: opt %loadPolly -polly-detect-unprofitable -polly-import-jscop -polly-import-jscop-dir=%S -analyze 2>&1 < %s | FileCheck %s
3 ; Check that we do not allow to access elements not accessed before because the
4 ; alignment information would become invalid.
6 ; CHECK: JScop file changes the accessed memory
8 ;    void bad_alignment(int *A) {
9 ;      for (int i = 0; i < 1024; i += 2)
10 ;        A[i] = i;
11 ;    }
13 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
15 define void @bad_alignment(i32* %A) {
16 entry:
17   br label %for.cond
19 for.cond:                                         ; preds = %for.inc, %entry
20   %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
21   %cmp = icmp slt i64 %indvars.iv, 1024
22   br i1 %cmp, label %for.body, label %for.end
24 for.body:                                         ; preds = %for.cond
25   %arrayidx = getelementptr inbounds i32, i32* %A, i64 %indvars.iv
26   %tmp = trunc i64 %indvars.iv to i32
27   store i32 %tmp, i32* %arrayidx, align 8
28   br label %for.inc
30 for.inc:                                          ; preds = %for.body
31   %indvars.iv.next = add nuw nsw i64 %indvars.iv, 2
32   br label %for.cond
34 for.end:                                          ; preds = %for.cond
35   ret void