| 1 |
/* Copyright (C) 2003 Free Software Foundation. |
| 2 |
|
| 3 |
Check that constant folding of built-in math functions doesn't |
| 4 |
break anything and produces the expected results. |
| 5 |
|
| 6 |
Written by Roger Sayle, 25th May 2003. */ |
| 7 |
|
| 8 |
/* { dg-do link } */ |
| 9 |
/* { dg-options "-O2 -ffast-math" } */ |
| 10 |
|
| 11 |
extern void link_error(void); |
| 12 |
|
| 13 |
extern double exp(double); |
| 14 |
extern double atan(double); |
| 15 |
|
| 16 |
int main() |
| 17 |
{ |
| 18 |
if (exp (1.0) < 2.71 || exp (1.0) > 2.72) |
| 19 |
link_error (); |
| 20 |
if (exp (2.0) < 7.38 || exp (2.0) > 7.39) |
| 21 |
link_error (); |
| 22 |
if (exp (-2.0) < 0.13 || exp (-2.0) > 0.14) |
| 23 |
link_error (); |
| 24 |
if (atan (1.0) < 0.78 || atan (1.0) > 0.79) |
| 25 |
link_error (); |
| 26 |
|
| 27 |
return 0; |
| 28 |
} |
| 29 |
|