Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.dg / vect / no-vfa-vect-depend-1.c
blob5679ff765c1c6f0fdfe743ca95966a8d0d347a93
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 17
8 int ia[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48};
9 int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48};
10 int res[N] = {12,24,36,48,60,72,84,96,108,120,132,144,156,168,180,192,48};
12 __attribute__ ((noinline))
13 int main1 ()
15 int i;
17 /* Not vectorizable due to data dependence: dependence distance 1. */
18 for (i = 0; i < N - 1; i++)
20 ia[i+1] = ia[i] * 4;
23 /* check results: */
24 for (i = 0; i < N - 1; i++)
26 if (ia[i] != 0)
27 abort ();
30 /* Vectorizable. Dependence distance -1. */
31 for (i = 0; i < N - 1; i++)
33 ib[i] = ib[i+1] * 4;
36 /* check results: */
37 for (i = 0; i < N - 1; i++)
39 if (ib[i] != res[i])
40 abort ();
43 return 0;
46 int main (void)
48 check_vect();
50 return main1 ();
53 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" {xfail vect_no_align } } } */
54 /* { dg-final { scan-tree-dump-times "dependence distance negative" 1 "vect" } } */
55 /* { dg-final { cleanup-tree-dump "vect" } } */