view gcc/testsuite/gcc.target/aarch64/sve/sqrt_1_run.c @ 19:2b5abeee2509 default tip

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
line wrap: on
line source

/* { dg-do run { target aarch64_sve_hw } } */
/* { dg-options "-Ofast -mlow-precision-sqrt" } */

#include "sqrt_1.c"

#define N 77

#define TEST_LOOP(TYPE, FN)				\
  {							\
    TYPE a[N];						\
    for (int i = 0; i < N; ++i)				\
      a[i] = i;						\
    test_##TYPE (a, N);					\
    for (int i = 0; i < N; ++i)				\
      {							\
	double diff = a[i] - __builtin_sqrt (i);	\
	if (__builtin_fabs (diff) > 0x1.0p-8)		\
	  __builtin_abort ();				\
      }							\
  }

int
main (void)
{
  TEST_ALL (TEST_LOOP);
  return 0;
}