Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-43.c
blob317d9ada90c18c72a56e13991247d89ed71b95b8
1 /* { dg-require-effective-target vect_float } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 256
8 typedef float afloat __attribute__ ((__aligned__(16)));
10 void bar (afloat *pa, afloat *pb, afloat *pc)
12 int i;
14 /* check results: */
15 for (i = 0; i < N; i++)
17 if (pa[i] != (pb[i] * pc[i]))
18 abort ();
21 return;
25 int
26 main1 (afloat * pa)
28 int i;
29 afloat pb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
30 afloat pc[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
33 for (i = 0; i < N; i++)
35 pa[i] = pb[i] * pc[i];
38 bar (pa,pb,pc);
40 return 0;
43 int main (void)
45 int i;
46 afloat a[N];
47 afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
48 afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
50 check_vect ();
52 main1 (a);
53 return 0;
56 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
57 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */