1; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s
2;
3; CHECK: Reduction Type: +
4;
5; void f(int *sum) {
6;   for (int i = 0; i < 100; i++)
7;     sum[i] = sum[99-i] + i;
8; }
9target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
10
11define void @f(i32* %sum) {
12entry:
13  br label %for.cond
14
15for.cond:                                         ; preds = %for.inc, %entry
16  %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
17  %exitcond = icmp ne i32 %i.0, 100
18  br i1 %exitcond, label %for.body, label %for.end
19
20for.body:                                         ; preds = %for.cond
21  %sub = sub nsw i32 99, %i.0
22  %arrayidx = getelementptr inbounds i32, i32* %sum, i32 %sub
23  %tmp = load i32, i32* %arrayidx, align 4
24  %add = add nsw i32 %tmp, %i.0
25  %arrayidx1 = getelementptr inbounds i32, i32* %sum, i32 %i.0
26  store i32 %add, i32* %arrayidx1, align 4
27  br label %for.inc
28
29for.inc:                                          ; preds = %for.body
30  %inc = add nsw i32 %i.0, 1
31  br label %for.cond
32
33for.end:                                          ; preds = %for.cond
34  ret void
35}
36