From 423a7160af7fcffc61aac5e2e36d0b6b5b083214 Mon Sep 17 00:00:00 2001 From: Wilco Date: Thu, 17 Apr 2014 09:39:27 +0100 Subject: Add fenv test support for targets which don't have FP traps. --- sysdeps/arm/math-tests.h | 3 +++ sysdeps/generic/math-tests.h | 11 +++++++++++ 2 files changed, 14 insertions(+) (limited to 'sysdeps') diff --git a/sysdeps/arm/math-tests.h b/sysdeps/arm/math-tests.h index e65f135..ea5f8dc 100644 --- a/sysdeps/arm/math-tests.h +++ b/sysdeps/arm/math-tests.h @@ -29,4 +29,7 @@ # define EXCEPTION_TESTS_long_double 0 #endif +/* Not all VFP implementations support trapping exceptions. */ +#define EXCEPTION_ENABLE_SUPPORTED(EXCEPT) ((EXCEPT) == 0) + #include_next diff --git a/sysdeps/generic/math-tests.h b/sysdeps/generic/math-tests.h index c86b067..3f2bd69 100644 --- a/sysdeps/generic/math-tests.h +++ b/sysdeps/generic/math-tests.h @@ -76,3 +76,14 @@ (sizeof (TYPE) == sizeof (float) ? EXCEPTION_TESTS_float \ : sizeof (TYPE) == sizeof (double) ? EXCEPTION_TESTS_double \ : EXCEPTION_TESTS_long_double) + +/* Indicate whether the given exception trap(s) can be enabled + in feenableexcept. If non-zero, the traps are always supported. + If zero, traps may or may not be supported depending on the + target (this can be determined by checking the return value + of feenableexcept). This enables skipping of tests which use + traps. By default traps are supported unless overridden. */ +#ifndef EXCEPTION_ENABLE_SUPPORTED +# define EXCEPTION_ENABLE_SUPPORTED(EXCEPT) \ + (EXCEPTION_TESTS_float || EXCEPTION_TESTS_double) +#endif -- cgit v1.1