Merge to HEAD at tree-cleanup-merge-20041024 .
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-48.c
blobbe00088d2919527283ebaac07ddb4f23f925d960
1 /* { dg-do run { target powerpc*-*-* } } */
2 /* { dg-do run { target i?86-*-* x86_64-*-* } } */
3 /* { dg-do run { target mipsisa64*-*-* } } */
4 /* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -maltivec" { target powerpc*-*-* } } */
5 /* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -msse2" { target i?86-*-* x86_64-*-* } } */
6 /* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -mpaired-single" { target mipsisa64*-*-* } } */
8 #include <stdarg.h>
9 #include "tree-vect.h"
11 #define N 256
13 typedef float afloat __attribute__ ((__aligned__(16)));
15 void bar (float *pa, float *pb, float *pc)
17 int i;
19 /* check results: */
20 for (i = 0; i < N; i++)
22 if (pa[i] != (pb[i] * pc[i]))
23 abort ();
26 return;
30 int
31 main1 (afloat * __restrict__ pa, float * __restrict__ pb, float * __restrict__ pc)
33 int i;
35 for (i = 0; i < N; i++)
37 pa[i] = pb[i] * pc[i];
40 bar (pa,pb,pc);
42 return 0;
45 int main (void)
47 int i;
48 afloat a[N];
49 afloat b[N+1] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60};
50 afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
52 check_vect ();
54 main1 (a,b,c);
55 main1 (a,&b[1],c);
57 return 0;
60 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail i?86-*-* x86_64-*-* mipsisa64*-*-* } } } */