Resolves: #1083145 - eliminate failure of gnulib tests on little-endian PowerPC

This commit is contained in:
Kamil Dudka 2014-06-02 13:07:22 +02:00
parent 24abf73cbf
commit 59f959cc29
2 changed files with 92 additions and 1 deletions

View File

@ -0,0 +1,84 @@
From de69fd334b77ec578c2232574fc76222808148b0 Mon Sep 17 00:00:00 2001
From: Ulrich Weigand <uweigand@de.ibm.com>
Date: Fri, 30 May 2014 11:34:23 +0100
Subject: [PATCH] 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.
[upstream commit e962c07c0c8bb18f9a5969cbf1ddb01d0fe4f55c]
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
tests/test-isfinite.c | 9 +++++++++
tests/test-isinf.c | 9 +++++++++
tests/test-isnanl.h | 9 +++++++++
3 files changed, 27 insertions(+)
diff --git a/tests/test-isfinite.c b/tests/test-isfinite.c
index 828cd69..8e88b67 100644
--- a/tests/test-isfinite.c
+++ b/tests/test-isfinite.c
@@ -152,6 +152,15 @@ test_isfinitel ()
/* 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
diff --git a/tests/test-isinf.c b/tests/test-isinf.c
index 253f341..76c132e 100644
--- a/tests/test-isinf.c
+++ b/tests/test-isinf.c
@@ -158,6 +158,15 @@ test_isinfl ()
/* 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
diff --git a/tests/test-isnanl.h b/tests/test-isnanl.h
index 8a9e684..bf81630 100644
--- a/tests/test-isnanl.h
+++ b/tests/test-isnanl.h
@@ -51,6 +51,15 @@ main ()
/* 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
--
1.9.3

View File

@ -1,7 +1,7 @@
Summary: The GNU versions of find utilities (find and xargs)
Name: findutils
Version: 4.5.12
Release: 3%{?dist}
Release: 4%{?dist}
Epoch: 1
License: GPLv3+
Group: Applications/File
@ -18,6 +18,9 @@ Patch3: findutils-4.4.2-xautofs.patch
# eliminate compile-time warnings
Patch4: findutils-4.5.12-warnings.patch
# eliminate failure of gnulib tests on little-endian PowerPC (#1083145)
Patch5: findutils-4.5.12-ppc-gnulib-tests.patch
Requires(post): /sbin/install-info
Requires(preun): /sbin/install-info
Conflicts: filesystem < 3
@ -48,6 +51,7 @@ rm -rf locate
%patch1 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
# needed because of findutils-4.4.0-no-locate.patch
autoreconf -iv
@ -94,6 +98,9 @@ fi
%{_infodir}/find-maint.info.gz
%changelog
* Mon Jun 02 2014 Kamil Dudka <kdudka@redhat.com> 1:4.5.12-4
- eliminate failure of gnulib tests on little-endian PowerPC (#1083145)
* Sat May 31 2014 Peter Robinson <pbrobinson@fedoraproject.org> 1:4.5.12-3
- drop ChangeLog, the NEWS file contains details back to 1993 to satisfy even
the most bored sysadmin