Merge to HEAD at tree-cleanup-merge-20041024 .
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-53.c
blob89bdd6e6d597426241a6d277f04a357a2a28bdb9
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 (const float *pa, const float *pb, const 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 (int n, afloat *pa, float *pb, float *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+1] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
52 check_vect ();
54 main1 (N,a,&b[1],c);
55 main1 (N,a,&b[1],&c[1]);
56 return 0;
59 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */