Merge -r 127928:132243 from trunk
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-iv-9.c
blob28ce927bf89918428cca9b0f8b651eef64d3c912
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" { 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" } } */