* modules/fpe-tracking: Remove file.
* m4/fpe.m4 (gl_FPE_TRACKING): Remove macro.
(gl_FPE_TRAPPING): Require gl_FENV_EXCEPTIONS_TRACKING instead of
gl_FPE_TRACKING. Use FENV_EXCEPTIONS_TRACKING_LIBM instead of
FPE_TRACKING_LIBM.
* modules/nan-tests (Depends-on): Add fenv-exceptions-tracking-c99.
Remove fpe-tracking.
(Makefile.am): Use FENV_EXCEPTIONS_TRACKING_LIBM instead of
FPE_TRACKING_LIBM.
* modules/snan-tests (Depends-on): Add fenv-exceptions-tracking-c99.
Remove fpe-tracking.
(Makefile.am): Use FENV_EXCEPTIONS_TRACKING_LIBM instead of
FPE_TRACKING_LIBM.
* tests/test-nan-1.c: Assume HAVE_FE_INVALID is 1.
* tests/test-snan-1.c: Likewise.
+2023-11-05 Bruno Haible <bruno@clisp.org>
+
+ fpe-tracking: Remove module.
+ * modules/fpe-tracking: Remove file.
+ * m4/fpe.m4 (gl_FPE_TRACKING): Remove macro.
+ (gl_FPE_TRAPPING): Require gl_FENV_EXCEPTIONS_TRACKING instead of
+ gl_FPE_TRACKING. Use FENV_EXCEPTIONS_TRACKING_LIBM instead of
+ FPE_TRACKING_LIBM.
+ * modules/nan-tests (Depends-on): Add fenv-exceptions-tracking-c99.
+ Remove fpe-tracking.
+ (Makefile.am): Use FENV_EXCEPTIONS_TRACKING_LIBM instead of
+ FPE_TRACKING_LIBM.
+ * modules/snan-tests (Depends-on): Add fenv-exceptions-tracking-c99.
+ Remove fpe-tracking.
+ (Makefile.am): Use FENV_EXCEPTIONS_TRACKING_LIBM instead of
+ FPE_TRACKING_LIBM.
+ * tests/test-nan-1.c: Assume HAVE_FE_INVALID is 1.
+ * tests/test-snan-1.c: Likewise.
+
2023-11-05 Bruno Haible <bruno@clisp.org>
fenv-exceptions-trapping: Avoid test failure on NetBSD/sparc.
-# fpe.m4 serial 1
+# fpe.m4 serial 2
dnl Copyright (C) 2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
-# Prerequisites for tracking FE_INVALID exceptions.
-AC_DEFUN_ONCE([gl_FPE_TRACKING],
-[
- AC_CACHE_CHECK([whether FE_INVALID exceptions can be tracked],
- [gl_cv_fenv_invalid_api],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <fenv.h>
- ]],
- [[feclearexcept (FE_INVALID);
- ]])
- ],
- [gl_cv_fenv_invalid_api=yes],
- [gl_cv_fenv_invalid_api=no])
- ])
- if test $gl_cv_fenv_invalid_api = yes; then
- AC_DEFINE([HAVE_FE_INVALID], [1],
- [Define if FE_INVALID exceptions can be programmatically tracked.])
- AC_CACHE_CHECK([whether feclearexcept can be used without linking with libm],
- [gl_cv_func_feclearexcept_no_libm],
- [AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <fenv.h>
- ]],
- [[feclearexcept (FE_INVALID);
- ]])
- ],
- [gl_cv_func_feclearexcept_no_libm=yes],
- [gl_cv_func_feclearexcept_no_libm=no])
- ])
- if test $gl_cv_func_feclearexcept_no_libm != yes; then
- FPE_TRACKING_LIBM=-lm
- else
- FPE_TRACKING_LIBM=
- fi
- else
- FPE_TRACKING_LIBM=
- fi
- AC_SUBST([FPE_TRACKING_LIBM])
-])
-
# Prerequisites for turning FE_INVALID exceptions into a SIGFPE signal.
AC_DEFUN_ONCE([gl_FPE_TRAPPING],
[
fi
fi
fi
- AC_REQUIRE([gl_FPE_TRACKING])
- FPE_TRAPPING_LIBM="$FPE_TRAPPING_LIBM $FPE_TRACKING_LIBM"
+ AC_REQUIRE([gl_FENV_EXCEPTIONS_TRACKING])
+ FPE_TRAPPING_LIBM="$FPE_TRAPPING_LIBM $FENV_EXCEPTIONS_TRACKING_LIBM"
AC_SUBST([FPE_TRAPPING_LIBM])
])
+++ /dev/null
-Description:
-Tracking floating-point exceptions, i.e. determining whether
-a floating-point exception has occurred during a certain computation.
-
-Files:
-m4/fpe.m4
-
-Depends-on:
-
-configure.ac:
-gl_FPE_TRACKING
-
-Makefile.am:
-
-Include:
-#if HAVE_FE_INVALID
-# include <fenv.h>
-#endif
-
-Link:
-$(FPE_TRACKING_LIBM)
-
-License:
-GPL
-
-Maintainer:
-all
tests/macros.h
Depends-on:
-fpe-tracking
+fenv-exceptions-tracking-c99
fpe-trapping
configure.ac:
Makefile.am:
TESTS += test-nan-1 test-nan-2
check_PROGRAMS += test-nan-1 test-nan-2
-test_nan_1_LDADD = $(LDADD) @FPE_TRACKING_LIBM@
+test_nan_1_LDADD = $(LDADD) $(FENV_EXCEPTIONS_TRACKING_LIBM)
test_nan_2_LDADD = $(LDADD) @FPE_TRAPPING_LIBM@
m4/math_h.m4
Depends-on:
-fpe-tracking
+fenv-exceptions-tracking-c99
fpe-trapping
configure.ac:
Makefile.am:
TESTS += test-snan-1 test-snan-2.sh
check_PROGRAMS += test-snan-1 test-snan-2
-test_snan_1_LDADD = $(LDADD) @FPE_TRACKING_LIBM@
+test_snan_1_LDADD = $(LDADD) $(FENV_EXCEPTIONS_TRACKING_LIBM)
test_snan_2_LDADD = $(LDADD) @FPE_TRAPPING_LIBM@
/* Specification. */
#include "nan.h"
-#include <stdio.h>
+#if defined __GLIBC__ && defined __arm__ && defined __SOFTFP__
-#if HAVE_FE_INVALID
-
-# if defined __GLIBC__ && defined __arm__ && defined __SOFTFP__
+# include <stdio.h>
/* The arm software floating-point emulation (used e.g. on armv5) does not set
the floating-point exception bits. */
return 77;
}
-# else
+#else
-# include <fenv.h>
+# include <fenv.h>
-# include "macros.h"
+# include "macros.h"
float volatile resultf;
double volatile resultd;
return 0;
}
-# endif
-
-#else
-
-/* No <fenv.h> available.
- We could use the various alternative approaches from
- libgfortran/config/fpu-*.h, but that's not worth it. */
-
-int
-main ()
-{
- fputs ("Skipping test: feclearexcept, fetestexcept, FE_INVALID not available\n", stderr);
- return 77;
-}
-
#endif
/* Specification. */
#include "snan.h"
-#include <stdio.h>
+#if defined __GLIBC__ && defined __arm__ && defined __SOFTFP__
-#if HAVE_FE_INVALID
-
-# if defined __GLIBC__ && defined __arm__ && defined __SOFTFP__
+# include <stdio.h>
/* The arm software floating-point emulation (used e.g. on armv5) does not set
the floating-point exception bits. */
return 77;
}
-# else
+#else
-# include <fenv.h>
+# include <fenv.h>
-# include "macros.h"
+# include "macros.h"
float volatile resultf;
double volatile resultd;
return 0;
}
-# endif
-
-#else
-
-/* No <fenv.h> available.
- We could use the various alternative approaches from
- libgfortran/config/fpu-*.h, but that's not worth it. */
-
-int
-main ()
-{
- fputs ("Skipping test: feclearexcept, fetestexcept, FE_INVALID not available\n", stderr);
- return 77;
-}
-
#endif