| 1 |
/* Verify that we do not inline isnanf test info -ffast-math code but that we |
| 2 |
do inline trivial functions across -Ofast boundary. */ |
| 3 |
/* { dg-do run } */ |
| 4 |
/* { dg-require-effective-target c99_runtime } */ |
| 5 |
/* { dg-options "-O2" } */ |
| 6 |
#include <math.h> |
| 7 |
extern int isnanf (float); |
| 8 |
/* Can't be inlined because isnanf will be optimized out. */ |
| 9 |
static int |
| 10 |
cmp (float a) |
| 11 |
{ |
| 12 |
return isnanf (a); |
| 13 |
} |
| 14 |
/* Can be inlined. */ |
| 15 |
static int |
| 16 |
move (int a) |
| 17 |
{ |
| 18 |
return a; |
| 19 |
} |
| 20 |
float a; |
| 21 |
void |
| 22 |
set () |
| 23 |
{ |
| 24 |
a=nan(""); |
| 25 |
} |
| 26 |
float b; |
| 27 |
__attribute__ ((optimize("Ofast"))) |
| 28 |
int |
| 29 |
main() |
| 30 |
{ |
| 31 |
b++; |
| 32 |
if (cmp(a)) |
| 33 |
__builtin_abort (); |
| 34 |
float a = move (1); |
| 35 |
if (!__builtin_constant_p (a)) |
| 36 |
__builtin_abort (); |
| 37 |
return 0; |
| 38 |
} |