changeset 8912:74eb90011cf9

Avoid test failures on some PowerPC hardwares.
author Bruno Haible <bruno@clisp.org>
date Mon, 04 Jun 2007 22:58:09 +0000
parents c7bb3a4ffc9b
children e1557d5648d5
files ChangeLog tests/test-frexpl.c tests/test-printf-frexpl.c
diffstat 3 files changed, 21 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Jun 02 20:45:23 2007 +0000
+++ b/ChangeLog	Mon Jun 04 22:58:09 2007 +0000
@@ -1,3 +1,11 @@
+2007-06-04  Bruno Haible  <bruno@clisp.org>
+
+	Avoid test failures on some PowerPC platforms.
+	* tests/test-printf-frexpl.c (MIN_NORMAL_EXP, MIN_SUBNORMAL_EXP):
+	Define differently for PowerPC.
+	* tests/test-frexpl.c (MIN_NORMAL_EXP): Likewise.
+	Reported by Gary V. Vaughan <gary@gnu.org>.
+
 2007-06-02  Bruno Haible  <bruno@clisp.org>
 
 	Fix test-stdint failure on FreeBSD/ia64.
--- a/tests/test-frexpl.c	Sat Jun 02 20:45:23 2007 +0000
+++ b/tests/test-frexpl.c	Mon Jun 04 22:58:09 2007 +0000
@@ -40,10 +40,14 @@
   while (0)
 
 /* On MIPS IRIX machines, LDBL_MIN_EXP is -1021, but the smallest reliable
-   exponent for 'long double' is -964.  For exponents below that, the
-   precision may be truncated to the precision used for 'double'.  */
+   exponent for 'long double' is -964.  Similarly, on PowerPC machines,
+   LDBL_MIN_EXP is -1021, but the smallest reliable exponent for 'long double'
+   is -968.  For exponents below that, the precision may be truncated to the
+   precision used for 'double'.  */
 #ifdef __sgi
 # define MIN_NORMAL_EXP (LDBL_MIN_EXP + 57)
+#elif defined __ppc || defined __ppc__ || defined __powerpc || defined __powerpc__
+# define MIN_NORMAL_EXP (LDBL_MIN_EXP + 53)
 #else
 # define MIN_NORMAL_EXP LDBL_MIN_EXP
 #endif
--- a/tests/test-printf-frexpl.c	Sat Jun 02 20:45:23 2007 +0000
+++ b/tests/test-printf-frexpl.c	Mon Jun 04 22:58:09 2007 +0000
@@ -39,11 +39,16 @@
   while (0)
 
 /* On MIPS IRIX machines, LDBL_MIN_EXP is -1021, but the smallest reliable
-   exponent for 'long double' is -964.  For exponents below that, the
-   precision may be truncated to the precision used for 'double'.  */
+   exponent for 'long double' is -964.  Similarly, on PowerPC machines,
+   LDBL_MIN_EXP is -1021, but the smallest reliable exponent for 'long double'
+   is -968.  For exponents below that, the precision may be truncated to the
+   precision used for 'double'.  */
 #ifdef __sgi
 # define MIN_NORMAL_EXP (LDBL_MIN_EXP + 57)
 # define MIN_SUBNORMAL_EXP MIN_NORMAL_EXP
+#elif defined __ppc || defined __ppc__ || defined __powerpc || defined __powerpc__
+# define MIN_NORMAL_EXP (LDBL_MIN_EXP + 53)
+# define MIN_SUBNORMAL_EXP MIN_NORMAL_EXP
 #else
 # define MIN_NORMAL_EXP LDBL_MIN_EXP
 # define MIN_SUBNORMAL_EXP (LDBL_MIN_EXP - 100)