111
|
1 /* { dg-require-effective-target vect_int } */
|
|
2
|
|
3 #include <stdarg.h>
|
|
4 #include "tree-vect.h"
|
|
5
|
|
6 #define N 26
|
|
7 int a[N];
|
|
8
|
|
9 __attribute__ ((noinline)) int main1 (int X)
|
|
10 {
|
|
11 int s = X;
|
|
12 int i;
|
|
13
|
|
14 /* vectorization of reduction with induction. */
|
|
15 for (i = 0; i < N; i++)
|
|
16 s += (i + a[i]);
|
|
17
|
|
18 return s;
|
|
19 }
|
|
20
|
|
21 int main (void)
|
|
22 {
|
|
23 int s, i;
|
|
24 check_vect ();
|
|
25
|
|
26 for (i = 0; i < N; i++)
|
|
27 a[i] = 2*i;
|
|
28
|
|
29 s = main1 (3);
|
|
30 if (s != 978)
|
|
31 abort ();
|
|
32
|
|
33 return 0;
|
|
34 }
|
|
35
|
|
36 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } } */
|