Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.dg / pr36017.c
blob2af71e6006e80058c2acbe19b5e0de7bfe0662f7
1 /* PR rtl-optimization/36017 */
2 /* { dg-do run } */
3 /* { dg-options "-O2" } */
5 extern double sqrt (double);
6 extern void abort (void);
8 __attribute__((noinline)) double
9 foo (double a)
11 double b, c, d = 0.7;
12 if (a <= d)
13 b = sqrt (d * a);
14 else
16 c = (1.0 - d) * (1.0 - a);
17 b = c > 0 ? 1.0 - sqrt (c) : 1.0;
19 return b;
22 int
23 main (void)
25 double c = foo (0.5);
26 if (c > 0.5917)
27 abort ();
28 return 0;