Module Name:    src
Committed By:   maya
Date:           Thu Jun 14 21:11:08 UTC 2018

Modified Files:
        src/tests/lib/libm: t_ilogb.c

Log Message:
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


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libm/t_ilogb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libm/t_ilogb.c
diff -u src/tests/lib/libm/t_ilogb.c:1.7 src/tests/lib/libm/t_ilogb.c:1.8
--- src/tests/lib/libm/t_ilogb.c:1.7	Fri Jan 13 19:23:40 2017
+++ src/tests/lib/libm/t_ilogb.c	Thu Jun 14 21:11:08 2018
@@ -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 @@ __RCSID("$NetBSD: t_ilogb.c,v 1.7 2017/0
 #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)
 

Reply via email to