OSDN Git Service

PR testsuite/21010
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / vect / vect-61.c
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-require-effective-target vect_float } */
3
4 #include <stdarg.h>
5 #include "tree-vect.h"
6
7 #define N 256
8
9 typedef float afloat __attribute__ ((__aligned__(16)));
10
11 void bar (afloat *pa, afloat *pb, afloat *pc)
12 {
13   int i;
14
15   /* check results:  */
16   for (i = 0; i < N/2; i++)
17     {
18       if (pa[i] != (pb[i+1] * pc[i+1]))
19         abort ();
20     }
21
22   return;
23 }
24
25
26 int
27 main1 (int n , afloat *  pa, afloat *  pb, afloat *  pc)
28 {
29   int i;
30
31   for (i = 0; i < n/2; i++)
32     {
33       pa[i] = pb[i+1] * pc[i+1];
34     }
35
36   bar (pa,pb,pc);
37
38   return 0;
39 }
40
41 int main (void)
42 {
43   int i;
44   int n=N;
45   afloat a[N];
46   afloat b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
47   afloat c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
48
49   check_vect ();
50
51   main1 (n,a,b,c);
52   return 0;
53 }
54
55 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
56 /* { dg-final { cleanup-tree-dump "vect" } } */