OSDN Git Service

* lib/target-supports.exp (check_effective_target_vect_int): New
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / vect / pr16105.c
1 /* { dg-do compile } */
2 /* { dg-require-effective-target vect_float } */
3
4 #define VECTOR_SIZE 512
5 typedef float afloat __attribute__ ((__aligned__(16)));
6
7 extern void check(const afloat * __restrict__ v);
8
9 void square(const afloat * __restrict__ a,
10             afloat * __restrict__ out)
11 {
12     unsigned int i;
13     for (i = 0; i < VECTOR_SIZE; i++) {
14         float ai = a[i];
15         float a2 = ai * ai;
16         out[i] = a2; 
17     }
18     check(out);
19 }
20
21 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"} } */