Commit 298f4064 by Kaveh R. Ghazi Committed by Kaveh Ghazi

c99-math-double-1.c, [...]: Test subnormals.

	* gcc.dg/c99-math-double-1.c, gcc.dg/c99-math-float-1.c,
	c99-math-long-double-1.c, c99-math.h: Test subnormals.

From-SVN: r126463
parent 9f06d330
2007-07-08 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gcc.dg/c99-math-double-1.c, gcc.dg/c99-math-float-1.c,
c99-math-long-double-1.c, c99-math.h: Test subnormals.
2007-07-08 Manuel Lopez-Ibanez <manu@gcc.gnu.org> 2007-07-08 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR testsuite/25241 PR testsuite/25241
...@@ -10,9 +10,10 @@ int main(void) ...@@ -10,9 +10,10 @@ int main(void)
double inf = INFINITY; double inf = INFINITY;
double huge = HUGE_VAL; double huge = HUGE_VAL;
double norm = __DBL_MIN__; double norm = __DBL_MIN__;
double sub = __DBL_MIN__ / 2;
double zero = 0.0; double zero = 0.0;
C99_MATH_TESTS (nan, inf, huge, norm, zero) C99_MATH_TESTS (nan, inf, huge, norm, sub, zero)
return 0; return 0;
} }
...@@ -10,9 +10,10 @@ int main(void) ...@@ -10,9 +10,10 @@ int main(void)
float inf = INFINITY; float inf = INFINITY;
float huge = HUGE_VALF; float huge = HUGE_VALF;
float norm = __FLT_MIN__; float norm = __FLT_MIN__;
float sub = __FLT_MIN__ / 2;
float zero = 0.0f; float zero = 0.0f;
C99_MATH_TESTS (nan, inf, huge, norm, zero) C99_MATH_TESTS (nan, inf, huge, norm, sub, zero)
return 0; return 0;
} }
...@@ -10,9 +10,10 @@ int main(void) ...@@ -10,9 +10,10 @@ int main(void)
long double inf = INFINITY; long double inf = INFINITY;
long double huge = HUGE_VALL; long double huge = HUGE_VALL;
long double norm = __LDBL_MIN__; long double norm = __LDBL_MIN__;
long double sub = __LDBL_MIN__ / 2;
long double zero = 0.0l; long double zero = 0.0l;
C99_MATH_TESTS (nan, inf, huge, norm, zero) C99_MATH_TESTS (nan, inf, huge, norm, sub, zero)
return 0; return 0;
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
extern void abort(void); extern void abort(void);
#define C99_MATH_TESTS(nan, inf, huge, norm, zero) \ #define C99_MATH_TESTS(nan, inf, huge, norm, sub, zero) \
{ \ { \
if (fpclassify (nan) != FP_NAN) \ if (fpclassify (nan) != FP_NAN) \
abort (); \ abort (); \
...@@ -16,6 +16,9 @@ extern void abort(void); ...@@ -16,6 +16,9 @@ extern void abort(void);
if (fpclassify (norm) != FP_NORMAL) \ if (fpclassify (norm) != FP_NORMAL) \
abort (); \ abort (); \
\ \
if (fpclassify (sub) != FP_SUBNORMAL) \
abort (); \
\
if (fpclassify (zero) != FP_ZERO) \ if (fpclassify (zero) != FP_ZERO) \
abort (); \ abort (); \
\ \
...@@ -32,6 +35,9 @@ extern void abort(void); ...@@ -32,6 +35,9 @@ extern void abort(void);
if (isnan (norm)) \ if (isnan (norm)) \
abort (); \ abort (); \
\ \
if (isnan (sub)) \
abort (); \
\
if (isnan (zero)) \ if (isnan (zero)) \
abort (); \ abort (); \
\ \
...@@ -48,6 +54,9 @@ extern void abort(void); ...@@ -48,6 +54,9 @@ extern void abort(void);
if (isinf (norm)) \ if (isinf (norm)) \
abort (); \ abort (); \
\ \
if (isinf (sub)) \
abort (); \
\
if (isinf (zero)) \ if (isinf (zero)) \
abort (); \ abort (); \
\ \
...@@ -64,6 +73,9 @@ extern void abort(void); ...@@ -64,6 +73,9 @@ extern void abort(void);
if (!isfinite (norm)) \ if (!isfinite (norm)) \
abort (); \ abort (); \
\ \
if (!isfinite (sub)) \
abort (); \
\
if (!isfinite (zero)) \ if (!isfinite (zero)) \
abort (); \ abort (); \
\ \
...@@ -80,6 +92,9 @@ extern void abort(void); ...@@ -80,6 +92,9 @@ extern void abort(void);
if (!isnormal (norm)) \ if (!isnormal (norm)) \
abort (); \ abort (); \
\ \
if (isnormal (sub)) \
abort (); \
\
if (isnormal (zero)) \ if (isnormal (zero)) \
abort (); \ abort (); \
\ \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment