about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2013-06-10 12:34:49 +0000
committerJoseph Myers <joseph@codesourcery.com>2013-06-10 12:34:49 +0000
commit0efa6f8b9906cddf2da36722449c8e30fb698b37 (patch)
tree341c784ccd0a1157c055de93a16715d8c3507fd4 /sysdeps
parent50b818bf96072fda433f7df4c307639b25e4da57 (diff)
downloadglibc-0efa6f8b9906cddf2da36722449c8e30fb698b37.tar.gz
glibc-0efa6f8b9906cddf2da36722449c8e30fb698b37.tar.xz
glibc-0efa6f8b9906cddf2da36722449c8e30fb698b37.zip
Add rounding mode information to math-tests.h and use it in libm-test.inc.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/math-tests.h18
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))