summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/float-range-5.c
diff options
context:
space:
mode:
authordanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2007-10-02 02:17:50 +0000
committerdanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2007-10-02 02:17:50 +0000
commita3026e61894b8b805e871f77235b68eaa275e897 (patch)
treefda7c11fa578fff2b126ae4f67d74bc6a8d7ac82 /gcc/testsuite/gcc.dg/float-range-5.c
parent8c796c7c31f65a6a69e141c0ff4ba7b27aadf31d (diff)
downloadgcc-a3026e61894b8b805e871f77235b68eaa275e897.tar.gz
PR testsuite/31828
gcc.dg/float-range-3.c (INFINITY): Define if not defined. (overflow): Use INFINITY, not FP_INFINITE. gcc.dg/float-range-4.c: Likewise. gcc.dg/float-range-5.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128947 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/float-range-5.c')
-rw-r--r--gcc/testsuite/gcc.dg/float-range-5.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/testsuite/gcc.dg/float-range-5.c b/gcc/testsuite/gcc.dg/float-range-5.c
index c3a2a9ee271..49742e322bf 100644
--- a/gcc/testsuite/gcc.dg/float-range-5.c
+++ b/gcc/testsuite/gcc.dg/float-range-5.c
@@ -4,17 +4,21 @@
/* { dg-options "-pedantic-errors -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)