diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/float-range-3.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/float-range-3.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/testsuite/gcc.dg/float-range-3.c b/gcc/testsuite/gcc.dg/float-range-3.c index 6a224e1..7fa766f 100644 --- a/gcc/testsuite/gcc.dg/float-range-3.c +++ b/gcc/testsuite/gcc.dg/float-range-3.c @@ -3,17 +3,21 @@ /* { dg-options "-std=c99" } */ #include <math.h> +#ifndef INFINITY +#define INFINITY (__builtin_inff ()) +#endif + void overflow(void) { float f1 = 3.5E+38f; /* { dg-warning "floating constant exceeds range" } */ float f2 = -3.5E+38f; /* { dg-warning "floating constant exceeds range" } */ - float f3 = FP_INFINITE; - float f4 = -FP_INFINITE; + float f3 = INFINITY; + float f4 = -INFINITY; double d1 = 1.9E+308; /* { dg-warning "floating constant exceeds range" } */ double d2 = -1.9E+308; /* { dg-warning "floating constant exceeds range" } */ - double d3 = FP_INFINITE; - double d4 = -FP_INFINITE; + double d3 = INFINITY; + double d4 = -INFINITY; } void underflow(void) |