view gcc/testsuite/gcc.dg/vect/pr31699.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* { dg-require-effective-target vect_float } */

#include <stdlib.h>
#include <stdarg.h>
#include "tree-vect.h"

float x[256];

__attribute__ ((noinline))
float *foo(void)
{
 float *z = malloc (sizeof(float) * 256);

 int i;
 for (i=0; i<256; ++i)
   z[i] = x[i] + 1.0f;

 return z;
}


int main()
{
 int i;

 check_vect ();

 for (i = 0; i < 256; i++)
   x[i] = (float) i;

 foo();

 return 0;
}

/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_intfloat_cvt } } } */
/* { dg-final { scan-tree-dump-times "vector alignment may not be reachable" 1 "vect" { target { ! vector_alignment_reachable } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { ! vector_alignment_reachable } } } } */