Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libm Test for FE_INVALID in a way that works for p...



details:   https://anonhg.NetBSD.org/src/rev/2633b8f324c1
branches:  trunk
changeset: 362534:2633b8f324c1
user:      maya <maya%NetBSD.org@localhost>
date:      Thu Jun 14 21:11:08 2018 +0000

description:
Test for FE_INVALID in a way that works for powerpc too.

powerpc seems to return FE_INVALID | FE_VXSOFT rather than just FE_INVALID.
XXX need extra careful reading of standards

diffstat:

 tests/lib/libm/t_ilogb.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r 44b7121477e3 -r 2633b8f324c1 tests/lib/libm/t_ilogb.c
--- a/tests/lib/libm/t_ilogb.c  Thu Jun 14 18:00:15 2018 +0000
+++ b/tests/lib/libm/t_ilogb.c  Thu Jun 14 21:11:08 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_ilogb.c,v 1.7 2017/01/13 19:23:40 christos Exp $ */
+/* $NetBSD: t_ilogb.c,v 1.8 2018/06/14 21:11:08 maya Exp $ */
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_ilogb.c,v 1.7 2017/01/13 19:23:40 christos Exp $");
+__RCSID("$NetBSD: t_ilogb.c,v 1.8 2018/06/14 21:11:08 maya Exp $");
 
 #include <atf-c.h>
 #include <fenv.h>
@@ -44,7 +44,9 @@
 #else
 # define ATF_CHECK_RAISED_INVALID do { \
        int r = fetestexcept(FE_ALL_EXCEPT); \
-       ATF_CHECK_MSG(r == FE_INVALID, "r=%#x != %#x\n", r, FE_INVALID); \
+       ATF_CHECK_MSG((r & FE_INVALID) != 0, \
+           "r & FE_INVALID !=0 (r=%#x, FE_INVALID=%#x\n", \
+            r, FE_INVALID); \
        (void)feclearexcept(FE_ALL_EXCEPT); \
 } while (/*CONSTCOND*/0)
 



Home | Main Index | Thread Index | Old Index