openmp: Add testcases for omp_max_vf
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / no-vfa-vect-dv-2.c
blob3bf0688dcc04aecbe224d20561e1fbed1871d6bd
1 /* Disabling epilogues until we find a better way to deal with scans. */
2 /* { dg-additional-options "--param vect-epilogues-nomask=0 --param vect-max-version-for-alias-checks=0" } */
3 /* { dg-require-effective-target vect_int } */
5 #include <stdarg.h>
6 #include "tree-vect.h"
8 #define N 64
9 #define MAX 42
11 extern void abort(void);
13 int main ()
15 int A[N];
16 int B[N];
17 int C[N];
18 int D[N];
19 int E[N] = {0,1,2,0};
21 int i, j;
23 check_vect ();
25 for (i = 0; i < N; i++)
27 A[i] = i;
28 B[i] = i;
29 C[i] = i;
30 D[i] = i;
33 /* Vectorizable */
34 for (i = 0; i < N-20; i++)
36 A[i] = A[i+20];
39 /* check results: */
40 #pragma GCC novector
41 for (i = 0; i < N-20; i++)
43 if (A[i] != D[i+20])
44 abort ();
47 /* Vectorizable */
48 for (i = 0; i < 16; i++)
50 B[i] = B[i] + 5;
53 /* check results: */
54 #pragma GCC novector
55 for (i = 0; i < 16; i++)
57 if (B[i] != C[i] + 5)
58 abort ();
61 /* Not vectorizable */
62 for (i = 0; i < 4; i++)
64 C[i+3] = C[i];
67 /* check results: */
68 #pragma GCC novector
69 for (i = 0; i < 4; i++)
71 if (C[i] != E[i])
72 abort ();
75 return 0;
79 /* The initialization induction loop (with aligned access) is also vectorized. */
80 /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */