Debian Codegraph @

gcc/testsuite/gcc.target/powerpc/pr46728-11.c

raw
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 } */
4
5 #include <math.h>
6
7 extern void abort (void);
8
9 #define NVALS 6
10
11 static double
12 convert_it (double x)
13 {
14 return pow (x, 0.75);
15 }
16
17 int
18 main (int argc, char *argv[])
19 {
20 double values[NVALS] = { 3.0, 1.95, 2.227, 4.0, 256.0, .0008797 };
21 double PREC = 0.999999;
22 unsigned i;
23
24 for (i = 0; i < NVALS; i++)
25 {
26 volatile double x, y;
27 x = sqrt (values[i]);
28 y = sqrt (sqrt (values[i]));
29
30 if (fabs (convert_it (values[i]) / (x * y)) < PREC)
31 abort ();
32 }
33
34 return 0;
35 }