Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.dg / pr36017.c
blobd18c97ddfadb16c055074ad19ac8f214f4b342da
1 /* PR rtl-optimization/36017 */
2 /* { dg-do run } */
3 /* { dg-options "-O2" } */
5 #if defined (__AVR__) && (__SIZEOF_DOUBLE__ == __SIZEOF_FLOAT__)
6 extern double sqrt (double) __asm ("sqrtf");
7 #else
8 extern double sqrt (double);
9 #endif
10 extern void abort (void);
12 __attribute__((noinline)) double
13 foo (double a)
15 double b, c, d = 0.7;
16 if (a <= d)
17 b = sqrt (d * a);
18 else
20 c = (1.0 - d) * (1.0 - a);
21 b = c > 0 ? 1.0 - sqrt (c) : 1.0;
23 return b;
26 int
27 main (void)
29 double c = foo (0.5);
30 if (c > 0.5917)
31 abort ();
32 return 0;