Small ChangeLog tweak.
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-6-big-array.c
blob2818b7ec1fdfe9c466d2722ee20aeb37a146ac1b
1 /* { dg-require-effective-target vect_float } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 128
8 float results1[N];
9 float results2[N];
10 float a[N] = {0};
11 float e[N] = {0};
12 float b[N];
13 float c[N];
15 volatile int y = 0;
17 __attribute__ ((noinline))
18 int main1 ()
20 int i;
22 for (i=0; i<N; i++)
24 b[i] = i*3;
25 c[i] = i;
26 results1[i] = 0;
27 results2[i] = 0;
28 /* Avoid vectorization. */
29 if (y)
30 abort ();
32 for (i=0; i<N/2; i++)
34 results1[i] = b[i+N/2] * c[i+N/2] - b[i] * c[i];
35 results2[i+N/2] = b[i] * c[i+N/2] + b[i+N/2] * c[i];
36 /* Avoid vectorization. */
37 if (y)
38 abort ();
41 for (i = 0; i < N/2; i++)
43 a[i] = b[i+N/2] * c[i+N/2] - b[i] * c[i];
44 e[i+N/2] = b[i] * c[i+N/2] + b[i+N/2] * c[i];
47 /* check results: */
48 for (i=0; i<N; i++)
50 if (a[i] != results1[i] || e[i] != results2[i])
51 abort ();
55 for (i = 1; i <=N-4; i++)
57 a[i+3] = b[i-1];
60 /* check results: */
61 for (i = 1; i <=N-4; i++)
63 if (a[i+3] != b[i-1])
64 abort ();
67 return 0;
70 int main (void)
72 check_vect ();
74 return main1 ();
77 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
78 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target { { vect_aligned_arrays } && {! vect_sizes_32B_16B} } } } } */
79 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { {! vect_aligned_arrays } && {vect_sizes_32B_16B} } } } } */