/* Test for fenv inline implementations.
- Copyright (C) 2015 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
#endif
}
+#if FE_ALL_EXCEPT
/* Tests for feenableexcept/fedisableexcept. */
static void
feenable_test (const char *flag_name, fexcept_t fe_exc)
{
-#if FE_ALL_EXCEPT
int fe_exci = fe_exc;
double fe_excd = fe_exc;
int excepts;
if (excepts != fe_exc)
{
printf ("Test: fedisableexcept (%s) failed, return should be 0x%x, is 0x%x\n",
- flag_name, fe_exc, excepts);
+ flag_name, (unsigned int)fe_exc, excepts);
++count_errors;
}
if (excepts != fe_exc)
{
printf ("Test: fedisableexcept (%s) failed, return should be 0x%x, is 0x%x\n",
- flag_name, fe_exc, excepts);
+ flag_name, (unsigned int)fe_exc, excepts);
++count_errors;
}
-#endif
}
+#endif
static void
test_feenabledisable (void)
/* raise all exceptions and test if all are raised */
feraiseexcept (FE_ALL_EXCEPT);
- test_exceptions ("feraiseexcept (FE_ALL_EXCEPT) raises all exceptions",
- ALL_EXC);
+ if (EXCEPTION_TESTS (float))
+ test_exceptions ("feraiseexcept (FE_ALL_EXCEPT) raises all exceptions",
+ ALL_EXC);
/* Same test, but using double as argument */
feclearexcept ((double)FE_ALL_EXCEPT);
NO_EXC);
feraiseexcept ((double)FE_ALL_EXCEPT);
- test_exceptions ("feraiseexcept ((double)FE_ALL_EXCEPT) raises all exceptions",
- ALL_EXC);
+ if (EXCEPTION_TESTS (float))
+ test_exceptions ("feraiseexcept ((double)FE_ALL_EXCEPT) raises all exceptions",
+ ALL_EXC);
- test_exceptionflag ();
+ if (EXCEPTION_TESTS (float))
+ test_exceptionflag ();
test_fesetround ();