changeset 17684:3f834754d62a

isfinite, isinf, isnan tests: fix for little-endian PowerPC * tests/test-isfinite.c (test_isfinitel): Only manipulate the first double of a PowerPC "double double" pair. * tests/test-isinf.c (test_isinfl): Likewise. * tests/test-isnan.c (test_long_double): Likewise. * tests/test-isnanl.h (main): Likewise. * tests/test-signbit.c (test_signbitl): Likewise.
author Ulrich Weigand <uweigand@de.ibm.com>
date Fri, 30 May 2014 11:34:23 +0100
parents 7a009de7a1cd
children 15fb9001e2b3
files ChangeLog tests/test-isfinite.c tests/test-isinf.c tests/test-isnan.c tests/test-isnanl.h tests/test-signbit.c
diffstat 6 files changed, 56 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2014-05-30  Ulrich Weigand  <uweigand@de.ibm.com>
+
+	isfinite, isinf, isnan tests: fix for little-endian PowerPC
+	* tests/test-isfinite.c (test_isfinitel): Only manipulate the
+	first double of a PowerPC "double double" pair.
+	* tests/test-isinf.c (test_isinfl): Likewise.
+	* tests/test-isnan.c (test_long_double): Likewise.
+	* tests/test-isnanl.h (main): Likewise.
+	* tests/test-signbit.c (test_signbitl): Likewise.
+
 2014-05-29  Paul Eggert  <eggert@cs.ucla.edu>
 
 	exclude-tests: port to AIX 7.1
--- a/tests/test-isfinite.c
+++ b/tests/test-isfinite.c
@@ -152,6 +152,15 @@
   /* A bit pattern that is different from a Quiet NaN.  With a bit of luck,
      it's a Signalling NaN.  */
   {
+#if defined __powerpc__ && LDBL_MANT_DIG == 106
+    /* This is PowerPC "double double", a pair of two doubles.  Inf and Nan are
+       represented as the corresponding 64-bit IEEE values in the first double;
+       the second is ignored.  Manipulate only the first double.  */
+    #undef NWORDS
+    #define NWORDS \
+      ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+#endif
+
     memory_long_double m;
     m.value = zerol / zerol;
 # if LDBL_EXPBIT0_BIT > 0
--- a/tests/test-isinf.c
+++ b/tests/test-isinf.c
@@ -158,6 +158,15 @@
   /* A bit pattern that is different from a Quiet NaN.  With a bit of luck,
      it's a Signalling NaN.  */
   {
+#if defined __powerpc__ && LDBL_MANT_DIG == 106
+    /* This is PowerPC "double double", a pair of two doubles.  Inf and Nan are
+       represented as the corresponding 64-bit IEEE values in the first double;
+       the second is ignored.  Manipulate only the first double.  */
+    #undef NWORDS
+    #define NWORDS \
+      ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+#endif
+
     memory_long_double m;
     m.value = zerol / zerol;
 # if LDBL_EXPBIT0_BIT > 0
--- a/tests/test-isnan.c
+++ b/tests/test-isnan.c
@@ -139,6 +139,15 @@
   /* A bit pattern that is different from a Quiet NaN.  With a bit of luck,
      it's a Signalling NaN.  */
   {
+#if defined __powerpc__ && LDBL_MANT_DIG == 106
+    /* This is PowerPC "double double", a pair of two doubles.  Inf and Nan are
+       represented as the corresponding 64-bit IEEE values in the first double;
+       the second is ignored.  Manipulate only the first double.  */
+    #undef NWORDSL
+    #define NWORDSL \
+      ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+#endif
+
     memory_long_double m;
     m.value = NaNl ();
 # if LDBL_EXPBIT0_BIT > 0
--- a/tests/test-isnanl.h
+++ b/tests/test-isnanl.h
@@ -51,6 +51,15 @@
   /* A bit pattern that is different from a Quiet NaN.  With a bit of luck,
      it's a Signalling NaN.  */
   {
+#if defined __powerpc__ && LDBL_MANT_DIG == 106
+    /* This is PowerPC "double double", a pair of two doubles.  Inf and Nan are
+       represented as the corresponding 64-bit IEEE values in the first double;
+       the second is ignored.  Manipulate only the first double.  */
+    #undef NWORDS
+    #define NWORDS \
+      ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+#endif
+
     memory_long_double m;
     m.value = NaNl ();
 # if LDBL_EXPBIT0_BIT > 0
--- a/tests/test-signbit.c
+++ b/tests/test-signbit.c
@@ -151,6 +151,16 @@
     #define NWORDS \
       ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
     typedef union { long double value; unsigned int word[NWORDS]; } memory_long_double;
+
+#if defined __powerpc__ && LDBL_MANT_DIG == 106
+    /* This is PowerPC "double double", a pair of two doubles.  Inf and Nan are
+       represented as the corresponding 64-bit IEEE values in the first double;
+       the second is ignored.  Manipulate only the first double.  */
+    #undef NWORDS
+    #define NWORDS \
+      ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+#endif
+
     memory_long_double m;
     m.value = zerol / zerol;
 # if LDBL_EXPBIT0_BIT > 0