+2014-12-30 Chris Metcalf <cmetcalf@ezchip.com>
+
+ * math/test-fenv.c (test_single_exception, set_single_exc,
+ feenv_nomask_test, feenv_mask_test, feexcp_nomask_test,
+ feexcp_mask_test, feenable_test, fe_single_test): Add
+ [!FE_ALL_EXCEPT] test so these routines are not compiled in the
+ case where they are not used.
+ * math/libm-test.inc: Likewise.
+ * setjmp/test-setjmp-fp.c: Mark attribute ((unused)) on variable
+ unused in the absence of FP rounding/exception support.
+ * stdio-common/tst-printf-round.c: Likewise.
+ * stdlib/tst-strtod-round.c: Likewise.
+ * stdlib/tst-strtod-underflow.c: Likewise.
+
2014-12-30 Joseph Myers <joseph@codesourcery.com>
[BZ #17723]
}
+#if FE_ALL_EXCEPT
/* Test whether a given exception was raised. */
static void
test_single_exception (const char *test_name,
int fe_flag,
const char *flag_name)
{
-#ifndef TEST_INLINE
+# ifndef TEST_INLINE
int ok = 1;
if (exception & exc_flag)
{
if (!ok)
++noErrors;
-#endif
+# endif
}
-
+#endif
/* Test whether exceptions given by EXCEPTION are raised. Ignore thereby
allowed but not required exceptions.
static int count_errors;
+#if FE_ALL_EXCEPT
/* Test whether a given exception was raised. */
static void
test_single_exception (short int exception,
}
}
}
+#endif
static void
test_exceptions (const char *test_name, short int exception,
}
+#if FE_ALL_EXCEPT
static void
set_single_exc (const char *test_name, int fe_exc, fexcept_t exception)
{
feclearexcept (exception);
test_exceptions (str, ALL_EXC ^ fe_exc, 0);
}
+#endif
static void
fe_tests (void)
#endif
}
+#if FE_ALL_EXCEPT
/* Test that program aborts with no masked interrupts */
static void
feenv_nomask_test (const char *flag_name, int fe_exc)
{
-#if defined FE_NOMASK_ENV
+# if defined FE_NOMASK_ENV
int status;
pid_t pid;
pid = fork ();
if (pid == 0)
{
-#ifdef RLIMIT_CORE
+# ifdef RLIMIT_CORE
/* Try to avoid dumping core. */
struct rlimit core_limit;
core_limit.rlim_cur = 0;
core_limit.rlim_max = 0;
setrlimit (RLIMIT_CORE, &core_limit);
-#endif
+# endif
fesetenv (FE_NOMASK_ENV);
feraiseexcept (fe_exc);
++count_errors;
}
}
-#endif
+# endif
}
/* Test that program doesn't abort with default environment */
feenv_mask_test (flag_name, fe_exc);
feenable_test (flag_name, fe_exc);
}
+#endif
static void
#include <stdio.h>
#include <stdlib.h>
-static jmp_buf env;
+static jmp_buf __attribute__ ((unused)) env;
static int result = 0;
#if defined FE_TONEAREST && defined FE_TOWARDZERO
static int
do_test (void)
{
- int save_round_mode = fegetround ();
+ int save_round_mode __attribute__ ((unused)) = fegetround ();
int result = 0;
for (size_t i = 0; i < sizeof (dec_tests) / sizeof (dec_tests[0]); i++)
static int
do_test (void)
{
- int save_round_mode = fegetround ();
+ int save_round_mode __attribute__ ((unused)) = fegetround ();
int result = 0;
for (size_t i = 0; i < sizeof (tests) / sizeof (tests[0]); i++)
{
static int
do_test (void)
{
- int save_round_mode = fegetround ();
+ int save_round_mode __attribute__ ((unused)) = fegetround ();
int result = 0;
#ifdef FE_TONEAREST
const int fe_tonearest = FE_TONEAREST;