diff options
Diffstat (limited to 'sysdeps/generic/math-tests.h')
-rw-r--r-- | sysdeps/generic/math-tests.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sysdeps/generic/math-tests.h b/sysdeps/generic/math-tests.h index da8747a944..b1e9fd72a7 100644 --- a/sysdeps/generic/math-tests.h +++ b/sysdeps/generic/math-tests.h @@ -40,3 +40,21 @@ #ifndef SNAN_TESTS_TYPE_CAST # define SNAN_TESTS_TYPE_CAST 1 #endif + +/* Indicate whether to run tests involving a given rounding mode for a + given floating-point type, given that fesetround succeeds for that + mode. All are run if fesetround succeeds unless overridden. */ +#ifndef ROUNDING_TESTS_float +# define ROUNDING_TESTS_float(MODE) 1 +#endif +#ifndef ROUNDING_TESTS_double +# define ROUNDING_TESTS_double(MODE) 1 +#endif +#ifndef ROUNDING_TESTS_long_double +# define ROUNDING_TESTS_long_double(MODE) 1 +#endif + +#define ROUNDING_TESTS(TYPE, MODE) \ + (sizeof (TYPE) == sizeof (float) ? ROUNDING_TESTS_float (MODE) \ + : sizeof (TYPE) == sizeof (double) ? ROUNDING_TESTS_double (MODE) \ + : ROUNDING_TESTS_long_double (MODE)) |