2017-01-02 Joseph Myers <joseph@codesourcery.com>
+ * math/test-nearbyint-except.c: Include <stdbool.h>.
+ (any_supported): New variable.
+ (TEST_FUNC): Return early if !EXCEPTION_TESTS (FLOAT). Otherwise
+ set any_supported.
+ (do_test): Return 77 if no floating-point type supported
+ exceptions.
+
* sysdeps/mips/math-tests.h (SNAN_TESTS_PRESERVE_PAYLOAD): Do not
condition on [__mips_hard_float].
#include <fenv.h>
#include <math.h>
+#include <stdbool.h>
#include <stdio.h>
#include <math-tests.h>
# define FE_INVALID 0
#endif
+static bool any_supported = false;
+
#define TEST_FUNC(NAME, FLOAT, SUFFIX) \
static int \
NAME (void) \
{ \
int result = 0; \
+ if (!EXCEPTION_TESTS (FLOAT)) \
+ return 0; \
+ any_supported = true; \
volatile FLOAT a, b __attribute__ ((unused)); \
a = 1.0; \
/* nearbyint must not clear already-raised exceptions. */ \
result = 1; \
} \
/* But it mustn't lose exceptions from sNaN arguments. */ \
- if (SNAN_TESTS (FLOAT) && EXCEPTION_TESTS (FLOAT)) \
+ if (SNAN_TESTS (FLOAT)) \
{ \
static volatile FLOAT snan = __builtin_nans ## SUFFIX (""); \
volatile FLOAT c __attribute__ ((unused)); \
#ifndef NO_LONG_DOUBLE
result |= ldouble_test ();
#endif
+ if (!any_supported)
+ return 77;
return result;
}