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

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