PR tree-optimization/84740
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-iv-9.c
blobe548b81b922fccc738f217a37a67042ee8e1856f
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 26
7 int a[N];
9 __attribute__ ((noinline)) int main1 (int X)
11 int s = X;
12 int i;
14 /* vectorization of reduction with induction. */
15 for (i = 0; i < N; i++)
16 s += (i + a[i]);
18 return s;
21 int main (void)
23 int s, i;
24 check_vect ();
26 for (i = 0; i < N; i++)
27 a[i] = 2*i;
29 s = main1 (3);
30 if (s != 978)
31 abort ();
33 return 0;
36 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } } */