1; RUN: opt %loadPolly -polly-process-unprofitable -polly-scops -polly-ast -analyze -S < %s | FileCheck %s --check-prefix=AST
2; RUN: opt %loadPolly -polly-process-unprofitable -polly-scops -polly-codegen -S < %s | FileCheck %s --check-prefix=CODEGEN
3
4target datalayout = "e-m:e-i64:64-i128:128-n8:16:32:64-S128"
5target triple = "aarch64--linux-gnu"
6
7; This test is to ensure that for we generate signed remainder for
8; the polly.cond check.
9
10; AST: isl ast :: foo1
11; AST: if ((a1 - b1) % 24 == 0)
12
13; CODEGEN: define void @foo1
14; CODEGEN: polly.cond:
15; CODEGEN: %pexp.zdiv_r = srem {{.*}}, 24
16
17%struct.A = type { i32, i64, i8 }
18
19; Function Attrs: norecurse nounwind
20define void @foo1(%struct.A* %a1, %struct.A* readnone %b1) #0 {
21entry:
22  br label %entry.split
23
24entry.split:                                      ; preds = %entry
25  %cmp4 = icmp eq %struct.A* %a1, %b1
26  br i1 %cmp4, label %for.cond.cleanup, label %for.body.preheader
27
28for.body.preheader:                               ; preds = %entry.split
29  br label %for.body
30
31for.cond.cleanup.loopexit:                        ; preds = %for.body
32  br label %for.cond.cleanup
33
34for.cond.cleanup:                                 ; preds = %for.cond.cleanup.loopexit, %entry.split
35  ret void
36
37for.body:                                         ; preds = %for.body.preheader, %for.body
38  %start.05 = phi %struct.A* [ %incdec.ptr, %for.body ], [ %a1, %for.body.preheader ]
39  %a = getelementptr inbounds %struct.A, %struct.A* %start.05, i64 0, i32 0
40  %0 = load i32, i32* %a, align 8
41  %add = add nsw i32 %0, 1
42  store i32 %add, i32* %a, align 8
43  %incdec.ptr = getelementptr inbounds %struct.A, %struct.A* %start.05, i64 1
44  %cmp = icmp eq %struct.A* %incdec.ptr, %b1
45  br i1 %cmp, label %for.cond.cleanup.loopexit, label %for.body
46}
47
48
49