| 1 |
/* { dg-require-effective-target vect_float } */ |
| 2 |
|
| 3 |
#include <stdlib.h> |
| 4 |
#include <stdarg.h> |
| 5 |
#include "tree-vect.h" |
| 6 |
|
| 7 |
float x[256]; |
| 8 |
|
| 9 |
__attribute__ ((noinline)) |
| 10 |
float *foo(void) |
| 11 |
{ |
| 12 |
float *z = malloc (sizeof(float) * 256); |
| 13 |
|
| 14 |
int i; |
| 15 |
for (i=0; i<256; ++i) |
| 16 |
z[i] = x[i] + 1.0f; |
| 17 |
|
| 18 |
return z; |
| 19 |
} |
| 20 |
|
| 21 |
|
| 22 |
int main() |
| 23 |
{ |
| 24 |
int i; |
| 25 |
|
| 26 |
check_vect (); |
| 27 |
|
| 28 |
for (i = 0; i < 256; i++) |
| 29 |
x[i] = (float) i; |
| 30 |
|
| 31 |
foo(); |
| 32 |
|
| 33 |
return 0; |
| 34 |
} |
| 35 |
|
| 36 |
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_intfloat_cvt } } } */ |
| 37 |
/* { dg-final { scan-tree-dump-times "vector alignment may not be reachable" 1 "vect" { target { ! vector_alignment_reachable } } } } */ |
| 38 |
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { ! vector_alignment_reachable } } } } */ |