Merged with mainline at revision 128810.
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / costmodel / spu / costmodel-vect-iv-9.c
blobe01b67e48e1fe3615665f12076b5f5e790c4265e
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 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" { target vect_int_mult } } } */
37 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target {! vect_int_mult } } } } */
38 /* { dg-final { cleanup-tree-dump "vect" } } */