view gcc/testsuite/gcc.dg/pow-sqrt.x @ 131:84e7813d76e9

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


extern void abort (void);


__attribute__((noinline)) double
real_pow (double x, double pow_exp)
{
  return __builtin_pow (x, pow_exp);
}

#define EPS (0.000000000000000000001)

#define SYNTH_POW(X, Y) __builtin_pow (X, Y)
volatile double arg;

int
main (void)
{
  double i_arg = 0.1;

  for (arg = i_arg; arg < 100.0; arg += 1.0)
    {
      double synth_res = SYNTH_POW (arg, EXPN);
      double real_res = real_pow (arg, EXPN);

      if (__builtin_abs (SYNTH_POW (arg, EXPN) - real_pow (arg, EXPN)) > EPS)
	abort ();
    }
  return 0;
}