PR tree-optimization/84740
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-5.c
blob17f3b2fac9a72f11b512659046dd8710d2e2f9a2
1 /* { dg-require-effective-target vect_float } */
2 /* { dg-add-options bind_pic_locally } */
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 #define N 16
9 float a[N];
10 float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
11 float d[N] = {0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30};
13 __attribute__ ((noinline))
14 int main1 ()
16 int i, j;
18 i = 0;
19 j = 0;
20 while (i < 5*N)
22 a[j] = c[j];
23 i += 5;
24 j++;
27 /* check results: */
28 for (i = 0; i <N; i++)
30 if (a[i] != c[i])
31 abort ();
35 for (i = N; i > 0; i--)
37 a[N-i] = d[N-i];
40 /* check results: */
41 for (i = 0; i < N; i++)
43 if (a[i] != d[i])
44 abort ();
47 return 0;
50 int main (void)
52 check_vect ();
54 return main1 ();
57 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
58 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */