1; RUN: opt %loadPolly -polly-codegen-ppcg  -polly-acc-fail-on-verify-module-failure \
2; RUN: -disable-output < %s
3
4; Make sure that if -polly-acc-fail-on-verify-module-failure is on, we actually
5; fail on an illegal module.
6
7; REQUIRES: pollyacc, asserts
8; XFAIL: *
9;
10;    void foo(long A[1024], long B[1024]) {
11;      for (long i = 0; i < 1024; i++)
12;        A[i] += (B[i] + (long)&B[i]);
13;    }
14
15
16; RUN: opt %loadPolly -polly-codegen-ppcg -S < %s
17
18target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
19
20define void @foo(i64* %A, i64* %B) {
21bb:
22  br label %bb1
23
24bb1:                                              ; preds = %bb10, %bb
25  %i.0 = phi i64 [ 0, %bb ], [ %tmp11, %bb10 ]
26  %exitcond = icmp ne i64 %i.0, 1024
27  br i1 %exitcond, label %bb2, label %bb12
28
29bb2:                                              ; preds = %bb1
30  %tmp = getelementptr inbounds i64, i64* %B, i64 %i.0
31  %tmp3 = load i64, i64* %tmp, align 8
32  %tmp4 = getelementptr inbounds i64, i64* %B, i64 %i.0
33  %tmp5 = ptrtoint i64* %tmp4 to i64
34  %tmp6 = add nsw i64 %tmp3, %tmp5
35  %tmp7 = getelementptr inbounds i64, i64* %A, i64 %i.0
36  %tmp8 = load i64, i64* %tmp7, align 8
37  %tmp9 = add nsw i64 %tmp8, %tmp6
38  store i64 %tmp9, i64* %tmp7, align 8
39  br label %bb10
40
41bb10:                                             ; preds = %bb2
42  %tmp11 = add nuw nsw i64 %i.0, 1
43  br label %bb1
44
45bb12:                                             ; preds = %bb1
46  ret void
47}
48