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