OSDN Git Service

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