[PATCH] Fix test-fenv
Jakub Jelinek
jakub@redhat.com
Wed Sep 27 01:59:00 GMT 2000
Hi!
Even other parts of test-fenv already ignore inexact exceptions when raising
overflow/underflow, so we should disable it in the feexcp_mask_test as well.
Makes test-fenv pass all tests on sparc64...
2000-09-27 Jakub Jelinek <jakub@redhat.com>
* math/test-fenv.c (feexcp_mask_test): If enabling all exceptions
and disabling underflow or overflow, disable inexact as well.
--- libc/math/test-fenv.c.jj Sun Aug 20 18:53:25 2000
+++ libc/math/test-fenv.c Wed Sep 27 10:36:55 2000
@@ -399,7 +399,7 @@ feexcp_nomask_test (const char *flag_nam
static void
feexcp_mask_test (const char *flag_name, int fe_exc)
{
- int status;
+ int status, exception;
pid_t pid;
printf ("Test: after fedisable (%s) processes will not abort\n", flag_name);
@@ -415,7 +415,20 @@ feexcp_mask_test (const char *flag_name,
setrlimit (RLIMIT_CORE, &core_limit);
#endif
feenableexcept (FE_ALL_EXCEPT);
- fedisableexcept (fe_exc);
+ exception = fe_exc;
+#ifdef FE_INEXACT
+ /* The standard allows the inexact exception to be set together with the
+ underflow and overflow exceptions. So add FE_INEXACT to the set of
+ exceptions to be disabled if we will be raising underflow or
+ overflow. */
+# ifdef FE_OVERFLOW
+ if (fe_exc & FE_OVERFLOW) exception |= FE_INEXACT;
+# endif
+# ifdef FE_UNDERFLOW
+ if (fe_exc & FE_UNDERFLOW) exception |= FE_INEXACT;
+# endif
+#endif
+ fedisableexcept (exception);
feraiseexcept (fe_exc);
exit (2);
}
Jakub
More information about the Libc-hacker
mailing list