Blame sysdeps/generic/math-tests.h

Packit Service 82fcde
/* Configuration for math tests.  Generic version.
Packit Service 82fcde
   Copyright (C) 2013-2018 Free Software Foundation, Inc.
Packit Service 82fcde
   This file is part of the GNU C Library.
Packit Service 82fcde
Packit Service 82fcde
   The GNU C Library is free software; you can redistribute it and/or
Packit Service 82fcde
   modify it under the terms of the GNU Lesser General Public
Packit Service 82fcde
   License as published by the Free Software Foundation; either
Packit Service 82fcde
   version 2.1 of the License, or (at your option) any later version.
Packit Service 82fcde
Packit Service 82fcde
   The GNU C Library is distributed in the hope that it will be useful,
Packit Service 82fcde
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 82fcde
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 82fcde
   Lesser General Public License for more details.
Packit Service 82fcde
Packit Service 82fcde
   You should have received a copy of the GNU Lesser General Public
Packit Service 82fcde
   License along with the GNU C Library; if not, see
Packit Service 82fcde
   <http://www.gnu.org/licenses/>.  */
Packit Service 82fcde
Packit Service 82fcde
#include <bits/floatn.h>
Packit Service 82fcde
Packit Service 82fcde
/* Expand the appropriate macro for whether to enable tests for a
Packit Service 82fcde
   given type.  */
Packit Service 82fcde
#if __HAVE_DISTINCT_FLOAT128
Packit Service 82fcde
# define MATH_TESTS_TG(PREFIX, ARGS, TYPE)				\
Packit Service 82fcde
  (sizeof (TYPE) == sizeof (float) ? PREFIX ## float ARGS		\
Packit Service 82fcde
   : sizeof (TYPE) == sizeof (double) ? PREFIX ## double ARGS		\
Packit Service 82fcde
   : __builtin_types_compatible_p (TYPE, _Float128) ? PREFIX ## float128 ARGS \
Packit Service 82fcde
   : PREFIX ## long_double ARGS)
Packit Service 82fcde
# else
Packit Service 82fcde
# define MATH_TESTS_TG(PREFIX, ARGS, TYPE)				\
Packit Service 82fcde
  (sizeof (TYPE) == sizeof (float) ? PREFIX ## float ARGS		\
Packit Service 82fcde
   : sizeof (TYPE) == sizeof (double) ? PREFIX ## double ARGS		\
Packit Service 82fcde
   : PREFIX ## long_double ARGS)
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
/* Indicate whether to run tests involving sNaN values for the float, double,
Packit Service 82fcde
   and long double C data types, respectively.  All are run unless
Packit Service 82fcde
   overridden.  */
Packit Service 82fcde
#ifndef SNAN_TESTS_float
Packit Service 82fcde
# define SNAN_TESTS_float	1
Packit Service 82fcde
#endif
Packit Service 82fcde
#ifndef SNAN_TESTS_double
Packit Service 82fcde
# define SNAN_TESTS_double	1
Packit Service 82fcde
#endif
Packit Service 82fcde
#ifndef SNAN_TESTS_long_double
Packit Service 82fcde
# define SNAN_TESTS_long_double	1
Packit Service 82fcde
#endif
Packit Service 82fcde
#ifndef SNAN_TESTS_float128
Packit Service 82fcde
# define SNAN_TESTS_float128	1
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
/* Return nonzero value if to run tests involving sNaN values for X.  */
Packit Service 82fcde
#define SNAN_TESTS(x) MATH_TESTS_TG (SNAN_TESTS_, , x)
Packit Service 82fcde
Packit Service 82fcde
/* Indicate whether to run tests involving type casts of sNaN values.  These
Packit Service 82fcde
   are run unless overridden.  */
Packit Service 82fcde
#ifndef SNAN_TESTS_TYPE_CAST
Packit Service 82fcde
# define SNAN_TESTS_TYPE_CAST	1
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
/* Indicate whether operations on signaling NaNs preserve the payload
Packit Service 82fcde
   (if possible; it is not possible with a zero payload if the high
Packit Service 82fcde
   bit is set for signaling NaNs) when generating a quiet NaN, and
Packit Service 82fcde
   this should be tested.  */
Packit Service 82fcde
#ifndef SNAN_TESTS_PRESERVE_PAYLOAD
Packit Service 82fcde
# define SNAN_TESTS_PRESERVE_PAYLOAD	1
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
/* Indicate whether to run tests involving a given rounding mode for a
Packit Service 82fcde
   given floating-point type, given that fesetround succeeds for that
Packit Service 82fcde
   mode.  All are run if fesetround succeeds unless overridden.  */
Packit Service 82fcde
#ifndef ROUNDING_TESTS_float
Packit Service 82fcde
# define ROUNDING_TESTS_float(MODE)	1
Packit Service 82fcde
#endif
Packit Service 82fcde
#ifndef ROUNDING_TESTS_double
Packit Service 82fcde
# define ROUNDING_TESTS_double(MODE)	1
Packit Service 82fcde
#endif
Packit Service 82fcde
#ifndef ROUNDING_TESTS_long_double
Packit Service 82fcde
# define ROUNDING_TESTS_long_double(MODE)	1
Packit Service 82fcde
#endif
Packit Service 82fcde
#ifndef ROUNDING_TESTS_float128
Packit Service 82fcde
# define ROUNDING_TESTS_float128(MODE)	1
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
#define ROUNDING_TESTS(TYPE, MODE)		\
Packit Service 82fcde
  MATH_TESTS_TG (ROUNDING_TESTS_, (MODE), TYPE)
Packit Service 82fcde
Packit Service 82fcde
/* Indicate whether to run tests of floating-point exceptions for a
Packit Service 82fcde
   given floating-point type, given that the exception macros are
Packit Service 82fcde
   defined.  All are run unless overridden.  */
Packit Service 82fcde
#ifndef EXCEPTION_TESTS_float
Packit Service 82fcde
# define EXCEPTION_TESTS_float	1
Packit Service 82fcde
#endif
Packit Service 82fcde
#ifndef EXCEPTION_TESTS_double
Packit Service 82fcde
# define EXCEPTION_TESTS_double	1
Packit Service 82fcde
#endif
Packit Service 82fcde
#ifndef EXCEPTION_TESTS_long_double
Packit Service 82fcde
# define EXCEPTION_TESTS_long_double	1
Packit Service 82fcde
#endif
Packit Service 82fcde
#ifndef EXCEPTION_TESTS_float128
Packit Service 82fcde
# define EXCEPTION_TESTS_float128	1
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
#define EXCEPTION_TESTS(TYPE) MATH_TESTS_TG (EXCEPTION_TESTS_, , TYPE)
Packit Service 82fcde
Packit Service 82fcde
/* Indicate whether the given exception trap(s) can be enabled
Packit Service 82fcde
   in feenableexcept.  If non-zero, the traps are always supported.
Packit Service 82fcde
   If zero, traps may or may not be supported depending on the
Packit Service 82fcde
   target (this can be determined by checking the return value
Packit Service 82fcde
   of feenableexcept).  This enables skipping of tests which use
Packit Service 82fcde
   traps.  By default traps are supported unless overridden.  */
Packit Service 82fcde
#ifndef EXCEPTION_ENABLE_SUPPORTED
Packit Service 82fcde
# define EXCEPTION_ENABLE_SUPPORTED(EXCEPT)			\
Packit Service 82fcde
   (EXCEPTION_TESTS_float || EXCEPTION_TESTS_double)
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
/* Indicate whether exception traps, if enabled, occur whenever an
Packit Service 82fcde
   exception flag is set explicitly, so it is not possible to set flag
Packit Service 82fcde
   bits with traps enabled without causing traps to be taken.  If
Packit Service 82fcde
   traps cannot be enabled, the value of this macro does not
Packit Service 82fcde
   matter.  */
Packit Service 82fcde
#ifndef EXCEPTION_SET_FORCES_TRAP
Packit Service 82fcde
# define EXCEPTION_SET_FORCES_TRAP 0
Packit Service 82fcde
#endif