Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.dg / vect / vect-iv-7.c
blob140d903a75181dedd094c6e30681b7aac102b697
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 16
7 int result[N] = {8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38};
9 __attribute__ ((noinline)) int main1 (int X)
11 int arr[N];
12 int k = 3;
13 int m, i=0;
15 /* Vectorization of induction with non-constant step X. */
17 do {
18 m = k + 5;
19 arr[i] = m;
20 k = k + X;
21 i++;
22 } while (i < N);
24 /* check results: */
25 for (i = 0; i < N; i++)
27 if (arr[i] != result[i])
28 abort ();
31 return 0;
34 int main (void)
36 check_vect ();
38 return main1 (2);
41 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
42 /* { dg-final { cleanup-tree-dump "vect" } } */