[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / pr46728-11.c
blobd0e3d60212194b8358413804d5d461bc913ed03d
1 /* { dg-do run } */
2 /* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm -mpowerpc-gpopt" } */
3 /* { dg-require-effective-target sqrt_insn } */
5 #include <math.h>
7 extern void abort (void);
9 #define NVALS 6
11 static double
12 convert_it (double x)
14 return pow (x, 0.75);
17 int
18 main (int argc, char *argv[])
20 double values[NVALS] = { 3.0, 1.95, 2.227, 4.0, 256.0, .0008797 };
21 double PREC = 0.999999;
22 unsigned i;
24 for (i = 0; i < NVALS; i++)
26 volatile double x, y;
27 x = sqrt (values[i]);
28 y = sqrt (sqrt (values[i]));
30 if (fabs (convert_it (values[i]) / (x * y)) < PREC)
31 abort ();
34 return 0;