Blame SOURCES/findutils-4.5.11-ppc-gnulib-tests.patch

c4b182
From de69fd334b77ec578c2232574fc76222808148b0 Mon Sep 17 00:00:00 2001
c4b182
From: Ulrich Weigand <uweigand@de.ibm.com>
c4b182
Date: Fri, 30 May 2014 11:34:23 +0100
c4b182
Subject: [PATCH] isfinite, isinf, isnan tests: fix for little-endian PowerPC
c4b182
c4b182
* tests/test-isfinite.c (test_isfinitel): Only manipulate the
c4b182
first double of a PowerPC "double double" pair.
c4b182
* tests/test-isinf.c (test_isinfl): Likewise.
c4b182
* tests/test-isnan.c (test_long_double): Likewise.
c4b182
* tests/test-isnanl.h (main): Likewise.
c4b182
* tests/test-signbit.c (test_signbitl): Likewise.
c4b182
c4b182
[upstream commit e962c07c0c8bb18f9a5969cbf1ddb01d0fe4f55c]
c4b182
c4b182
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
c4b182
---
c4b182
 tests/test-isfinite.c | 9 +++++++++
c4b182
 tests/test-isinf.c    | 9 +++++++++
c4b182
 tests/test-isnanl.h   | 9 +++++++++
c4b182
 3 files changed, 27 insertions(+)
c4b182
c4b182
diff --git a/tests/test-isfinite.c b/tests/test-isfinite.c
c4b182
index 828cd69..8e88b67 100644
c4b182
--- a/tests/test-isfinite.c
c4b182
+++ b/tests/test-isfinite.c
c4b182
@@ -152,6 +152,15 @@ test_isfinitel ()
c4b182
   /* A bit pattern that is different from a Quiet NaN.  With a bit of luck,
c4b182
      it's a Signalling NaN.  */
c4b182
   {
c4b182
+#if defined __powerpc__ && LDBL_MANT_DIG == 106
c4b182
+    /* This is PowerPC "double double", a pair of two doubles.  Inf and Nan are
c4b182
+       represented as the corresponding 64-bit IEEE values in the first double;
c4b182
+       the second is ignored.  Manipulate only the first double.  */
c4b182
+    #undef NWORDS
c4b182
+    #define NWORDS \
c4b182
+      ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
c4b182
+#endif
c4b182
+
c4b182
     memory_long_double m;
c4b182
     m.value = zerol / zerol;
c4b182
 # if LDBL_EXPBIT0_BIT > 0
c4b182
diff --git a/tests/test-isinf.c b/tests/test-isinf.c
c4b182
index 253f341..76c132e 100644
c4b182
--- a/tests/test-isinf.c
c4b182
+++ b/tests/test-isinf.c
c4b182
@@ -158,6 +158,15 @@ test_isinfl ()
c4b182
   /* A bit pattern that is different from a Quiet NaN.  With a bit of luck,
c4b182
      it's a Signalling NaN.  */
c4b182
   {
c4b182
+#if defined __powerpc__ && LDBL_MANT_DIG == 106
c4b182
+    /* This is PowerPC "double double", a pair of two doubles.  Inf and Nan are
c4b182
+       represented as the corresponding 64-bit IEEE values in the first double;
c4b182
+       the second is ignored.  Manipulate only the first double.  */
c4b182
+    #undef NWORDS
c4b182
+    #define NWORDS \
c4b182
+      ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
c4b182
+#endif
c4b182
+
c4b182
     memory_long_double m;
c4b182
     m.value = zerol / zerol;
c4b182
 # if LDBL_EXPBIT0_BIT > 0
c4b182
diff --git a/tests/test-isnanl.h b/tests/test-isnanl.h
c4b182
index 8a9e684..bf81630 100644
c4b182
--- a/tests/test-isnanl.h
c4b182
+++ b/tests/test-isnanl.h
c4b182
@@ -51,6 +51,15 @@ main ()
c4b182
   /* A bit pattern that is different from a Quiet NaN.  With a bit of luck,
c4b182
      it's a Signalling NaN.  */
c4b182
   {
c4b182
+#if defined __powerpc__ && LDBL_MANT_DIG == 106
c4b182
+    /* This is PowerPC "double double", a pair of two doubles.  Inf and Nan are
c4b182
+       represented as the corresponding 64-bit IEEE values in the first double;
c4b182
+       the second is ignored.  Manipulate only the first double.  */
c4b182
+    #undef NWORDS
c4b182
+    #define NWORDS \
c4b182
+      ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
c4b182
+#endif
c4b182
+
c4b182
     memory_long_double m;
c4b182
     m.value = NaNl ();
c4b182
 # if LDBL_EXPBIT0_BIT > 0
c4b182
-- 
c4b182
1.9.3
c4b182