mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-27 03:41:23 +08:00
Remove finite-math tests
Remove the finite-math tests from the testsuite - these are no longer useful after removing math-finite.h header. Passes buildmanyglibc, build&test on x86_64 and AArch64. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
This commit is contained in:
parent
7bdb921d70
commit
55d530114e
@ -228,8 +228,7 @@ tests = test-matherr-3 test-fenv basic-test \
|
||||
test-tgmath-ret bug-nextafter bug-nexttoward bug-tgmath1 \
|
||||
test-tgmath-int test-tgmath2 test-powl tst-CMPLX tst-CMPLX2 test-snan \
|
||||
test-fenv-tls test-fenv-preserve test-fenv-return test-fenvinline \
|
||||
test-nearbyint-except test-fenv-clear test-signgam-finite \
|
||||
test-signgam-finite-c99 test-signgam-finite-c11 \
|
||||
test-nearbyint-except test-fenv-clear \
|
||||
test-nearbyint-except-2 test-signgam-uchar test-signgam-uchar-init \
|
||||
test-signgam-uint test-signgam-uint-init test-signgam-ullong \
|
||||
test-signgam-ullong-init test-nan-overflow test-nan-payload \
|
||||
@ -238,7 +237,7 @@ tests = test-matherr-3 test-fenv basic-test \
|
||||
test-femode-traps test-iszero-excess-precision \
|
||||
test-iseqsig-excess-precision test-flt-eval-method \
|
||||
test-fp-ilogb-constants test-fp-llogb-constants \
|
||||
test-fe-snans-always-signal test-finite-macros test-narrow-macros \
|
||||
test-fe-snans-always-signal test-narrow-macros \
|
||||
test-nan-const $(tests-static)
|
||||
tests-static = test-fpucw-static test-fpucw-ieee-static \
|
||||
test-signgam-uchar-static test-signgam-uchar-init-static \
|
||||
@ -298,17 +297,13 @@ generated += libm-test-ulps.h $(libm-test-c-auto) $(libm-test-c-noauto) \
|
||||
$(libm-test-c-narrow)
|
||||
|
||||
libm-tests-base-normal = $(foreach t,$(test-types),test-$(t))
|
||||
libm-tests-base-finite = $(foreach t,$(test-types),test-$(t)-finite)
|
||||
libm-tests-base-inline = $(foreach t,$(test-types),test-i$(t))
|
||||
libm-tests-base-narrow = $(foreach t,$(test-type-pairs),test-$(t))
|
||||
libm-tests-base = $(libm-tests-base-normal) $(libm-tests-base-finite) \
|
||||
$(libm-tests-base-inline) $(libm-vec-tests)
|
||||
libm-tests-base = $(libm-tests-base-normal) $(libm-tests-base-inline) \
|
||||
$(libm-vec-tests)
|
||||
libm-tests-normal = $(foreach t,$(libm-tests-base-normal),\
|
||||
$(foreach f,$(libm-test-funcs-all),\
|
||||
$(t)-$(f)))
|
||||
libm-tests-finite = $(foreach t,$(libm-tests-base-finite),\
|
||||
$(foreach f,$(libm-test-funcs-all),\
|
||||
$(t)-$(f)))
|
||||
libm-tests-inline = $(foreach t,$(libm-tests-base-inline),\
|
||||
$(foreach f,$(libm-test-funcs-all),\
|
||||
$(t)-$(f)))
|
||||
@ -317,7 +312,7 @@ libm-tests-narrow = $(foreach t,$(libm-tests-base-narrow),\
|
||||
$(t)-$(f)))
|
||||
libm-tests-vector = $(foreach t,$(libmvec-tests),\
|
||||
$(foreach f,$($(t)-funcs),test-$(t)-$(f)))
|
||||
libm-tests = $(libm-tests-normal) $(libm-tests-finite) $(libm-tests-inline) \
|
||||
libm-tests = $(libm-tests-normal) $(libm-tests-inline) \
|
||||
$(libm-tests-narrow) $(libm-tests-vector)
|
||||
libm-tests-compat = $(foreach t,$(libm-tests-base-normal) \
|
||||
$(libm-tests-base-finite) \
|
||||
@ -325,8 +320,7 @@ libm-tests-compat = $(foreach t,$(libm-tests-base-normal) \
|
||||
$(foreach f,$(libm-test-funcs-compat),\
|
||||
$(t)-$(f)))
|
||||
libm-tests-for-type = $(foreach f,$(libm-test-funcs-all),\
|
||||
test-$(1)-$(f) test-$(1)-finite-$(f) \
|
||||
test-i$(1)-$(f)) \
|
||||
test-$(1)-$(f) test-i$(1)-$(f)) \
|
||||
$(filter test-$(1)-%,$(libm-tests-vector) \
|
||||
$(libm-tests-narrow))
|
||||
|
||||
@ -417,8 +411,6 @@ CFLAGS-test-float-vlen16-wrappers.c += $(float-vlen16-arch-ext-cflags)
|
||||
# validated.
|
||||
libm-test-no-inline-cflags = -fno-inline -ffloat-store -fno-builtin \
|
||||
-fsignaling-nans
|
||||
libm-test-finite-cflags = $(libm-test-no-inline-cflags) \
|
||||
-U__FINITE_MATH_ONLY__ -D__FINITE_MATH_ONLY__=1
|
||||
libm-test-inline-cflags = $(libm-test-fast-math-cflags)
|
||||
CFLAGS-test-tgmath.c += -fno-builtin
|
||||
# The following testcase uses very long lines (>3 million), so it may take a
|
||||
@ -430,9 +422,6 @@ CFLAGS-test-powl.c += -fno-builtin
|
||||
|
||||
CFLAGS-test-snan.c += -fsignaling-nans
|
||||
|
||||
CFLAGS-test-signgam-finite.c += -ffinite-math-only
|
||||
CFLAGS-test-signgam-finite-c99.c += -ffinite-math-only -std=c99
|
||||
CFLAGS-test-signgam-finite-c11.c += -ffinite-math-only -std=c11
|
||||
CFLAGS-test-signgam-uchar.c += -std=c99
|
||||
CFLAGS-test-signgam-uchar-init.c += -std=c99
|
||||
CFLAGS-test-signgam-uchar-static.c += -std=c99
|
||||
@ -459,8 +448,6 @@ CFLAGS-test-flt-eval-method.c += -fexcess-precision=standard
|
||||
|
||||
CFLAGS-test-fe-snans-always-signal.c += -fsignaling-nans
|
||||
|
||||
CFLAGS-test-finite-macros.c += -ffinite-math-only
|
||||
|
||||
CFLAGS-test-nan-const.c += -fno-builtin
|
||||
|
||||
include ../Rules
|
||||
@ -499,25 +486,13 @@ $(foreach t,$(libm-tests-normal),$(objpfx)$(t).c): $(objpfx)test-%.c:
|
||||
func=$${type_func#*-}; \
|
||||
( \
|
||||
echo "#include <test-$$type.h>"; \
|
||||
echo "#include <test-math-no-finite.h>"; \
|
||||
echo "#include <test-math-exceptions.h>"; \
|
||||
echo "#include <test-math-no-inline.h>"; \
|
||||
echo "#include <test-math-errno.h>"; \
|
||||
echo "#include <test-math-scalar.h>"; \
|
||||
echo "#include <libm-test-$$func.c>"; \
|
||||
) > $@
|
||||
|
||||
$(foreach t,$(libm-tests-finite),$(objpfx)$(t).c): $(objpfx)test-%.c:
|
||||
type_func=$*; \
|
||||
type=$${type_func%%-*}; \
|
||||
func=$${type_func#*-finite-}; \
|
||||
( \
|
||||
echo "#include <test-$$type.h>"; \
|
||||
echo "#include <test-math-finite.h>"; \
|
||||
echo "#include <test-math-no-inline.h>"; \
|
||||
echo "#include <test-math-scalar.h>"; \
|
||||
echo "#include <libm-test-$$func.c>"; \
|
||||
) > $@
|
||||
|
||||
$(foreach t,$(libm-tests-inline),$(objpfx)$(t).c): $(objpfx)test-i%.c:
|
||||
type_func=$*; \
|
||||
type=$${type_func%%-*}; \
|
||||
@ -538,7 +513,7 @@ $(foreach t,$(libm-tests-narrow),$(objpfx)$(t).c): $(objpfx)test-%.c:
|
||||
( \
|
||||
echo "#include <test-$$ret_type.h>"; \
|
||||
echo "#include <test-arg-$$arg_type.h>"; \
|
||||
echo "#include <test-math-no-finite.h>"; \
|
||||
echo "#include <test-math-exceptions.h>"; \
|
||||
echo "#include <test-math-no-inline.h>"; \
|
||||
echo "#include <test-math-errno.h>"; \
|
||||
echo "#include <test-math-narrow.h>"; \
|
||||
@ -588,13 +563,6 @@ endef
|
||||
object-suffixes-left := $(libm-tests-base-normal)
|
||||
include $(o-iterator)
|
||||
|
||||
define o-iterator-doit
|
||||
$(foreach f,$(libm-test-funcs-all),\
|
||||
$(objpfx)$(o)-$(f).o): CFLAGS += $(libm-test-finite-cflags)
|
||||
endef
|
||||
object-suffixes-left := $(libm-tests-base-finite)
|
||||
include $(o-iterator)
|
||||
|
||||
define o-iterator-doit
|
||||
$(foreach f,$(libm-test-funcs-all),\
|
||||
$(objpfx)$(o)-$(f).o): CFLAGS += $(libm-test-inline-cflags)
|
||||
|
@ -341,9 +341,6 @@ def apply_lit(arg, macro):
|
||||
|
||||
def gen_test_args_res(descr_args, descr_res, args, res_rm):
|
||||
"""Generate a test given the arguments and per-rounding-mode results."""
|
||||
# Determine whether any arguments or results, for any rounding
|
||||
# mode, are non-finite.
|
||||
non_finite = False
|
||||
test_snan = False
|
||||
all_args_res = list(args)
|
||||
for r in res_rm:
|
||||
@ -351,10 +348,6 @@ def gen_test_args_res(descr_args, descr_res, args, res_rm):
|
||||
for a in all_args_res:
|
||||
if 'snan_value' in a:
|
||||
test_snan = True
|
||||
non_finite = True
|
||||
elif ('qnan_value' in a or 'plus_infty' in a or 'minus_infty' in a
|
||||
or 'plus_oflow' in a or 'minus_oflow' in a):
|
||||
non_finite = True
|
||||
# Process the arguments.
|
||||
args_disp = []
|
||||
args_c = []
|
||||
@ -422,8 +415,6 @@ def gen_test_args_res(descr_args, descr_res, args, res_rm):
|
||||
flags = []
|
||||
if ignore_result_any:
|
||||
flags.append('IGNORE_RESULT')
|
||||
if non_finite:
|
||||
flags.append('NON_FINITE')
|
||||
if test_snan:
|
||||
flags.append('TEST_SNAN')
|
||||
flags.append(res[res_pos])
|
||||
|
@ -23,7 +23,6 @@
|
||||
/* Flags set by the including file. */
|
||||
const int flag_test_errno = TEST_ERRNO;
|
||||
const int flag_test_exceptions = TEST_EXCEPTIONS;
|
||||
const int flag_test_finite = TEST_FINITE;
|
||||
const int flag_test_inline = TEST_INLINE;
|
||||
const int flag_test_mathvec = TEST_MATHVEC;
|
||||
|
||||
@ -44,8 +43,6 @@ const int snan_tests_arg = SNAN_TESTS (FLOAT);
|
||||
# define TEST_MSG "testing " STR_FLOAT " (vector length " STR_VEC_LEN ")\n"
|
||||
#elif TEST_INLINE
|
||||
# define TEST_MSG "testing " STR_FLOAT " (inline functions)\n"
|
||||
#elif TEST_FINITE
|
||||
# define TEST_MSG "testing " STR_FLOAT " (finite-math-only)\n"
|
||||
#elif TEST_NARROW
|
||||
# define TEST_MSG "testing " STR_FLOAT " (argument " STR_ARG_FLOAT ")\n"
|
||||
#else
|
||||
|
@ -983,8 +983,6 @@ enable_test (int exceptions)
|
||||
return 0;
|
||||
if (flag_test_inline && (exceptions & NO_TEST_INLINE))
|
||||
return 0;
|
||||
if (flag_test_finite && (exceptions & NON_FINITE) != 0)
|
||||
return 0;
|
||||
if ((!SNAN_TESTS (FLOAT) || !snan_tests_arg)
|
||||
&& (exceptions & TEST_SNAN) != 0)
|
||||
return 0;
|
||||
|
@ -34,7 +34,6 @@
|
||||
|
||||
extern const int flag_test_errno;
|
||||
extern const int flag_test_exceptions;
|
||||
extern const int flag_test_finite;
|
||||
extern const int flag_test_inline;
|
||||
extern const int flag_test_mathvec;
|
||||
extern const int snan_tests_arg;
|
||||
@ -69,7 +68,6 @@ extern const char doc[];
|
||||
#define ERRNO_ERANGE 0x20000
|
||||
/* Flags generated by gen-libm-test.py, not entered here manually. */
|
||||
#define IGNORE_RESULT 0x40000
|
||||
#define NON_FINITE 0x80000
|
||||
#define TEST_SNAN 0x100000
|
||||
#define NO_TEST_MATHVEC 0x200000
|
||||
|
||||
|
@ -1,35 +0,0 @@
|
||||
/* Test finite-math-only code does not conflict with user macros (bug 22028).
|
||||
Copyright (C) 2017-2019 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
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* The main test is that the inclusion of <math.h> compiles. */
|
||||
#define f first test macro
|
||||
#define l second test macro
|
||||
#define f128 third test macro
|
||||
|
||||
#include <math.h>
|
||||
|
||||
volatile float a, b;
|
||||
|
||||
static int
|
||||
do_test (void)
|
||||
{
|
||||
b = acosf (a);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#include <support/test-driver.c>
|
@ -1,5 +1,5 @@
|
||||
/* Common definitions for libm tests for no-finite-math-only.
|
||||
Copyright (C) 2015-2019 Free Software Foundation, Inc.
|
||||
/* Common definitions for libm tests for exceptions.
|
||||
Copyright (C) 1997-2019 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
|
||||
@ -16,5 +16,4 @@
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#define TEST_FINITE 0
|
||||
#define TEST_EXCEPTIONS 1
|
@ -1,21 +0,0 @@
|
||||
/* Common definitions for libm tests for finite-math-only.
|
||||
Copyright (C) 2015-2019 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
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#define TEST_FINITE 1
|
||||
#define TEST_ERRNO 0
|
||||
#define TEST_EXCEPTIONS 1
|
@ -17,7 +17,6 @@
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#define TEST_INLINE 1
|
||||
#define TEST_FINITE 0
|
||||
#define TEST_ERRNO 0
|
||||
#define TEST_EXCEPTIONS 0
|
||||
|
||||
|
@ -18,7 +18,6 @@
|
||||
|
||||
#define TEST_MATHVEC 1
|
||||
#define TEST_NARROW 0
|
||||
#define TEST_FINITE 0
|
||||
#define TEST_ERRNO 0
|
||||
#define TEST_EXCEPTIONS 0
|
||||
|
||||
|
@ -1 +0,0 @@
|
||||
#include "test-signgam-finite-c99.c"
|
@ -1,63 +0,0 @@
|
||||
/* Test lgamma functions do not set signgam for -ffinite-math-only for ISO C.
|
||||
Copyright (C) 2015-2019 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
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#undef _LIBC
|
||||
#undef __LIBC_INTERNAL_MATH_INLINES
|
||||
#undef _GNU_SOURCE
|
||||
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int signgam;
|
||||
|
||||
#define RUN_TESTS(FUNC, TYPE) \
|
||||
do \
|
||||
{ \
|
||||
volatile TYPE a, b, c __attribute__ ((unused)); \
|
||||
a = 0.5; \
|
||||
b = -0.5; \
|
||||
signgam = 123; \
|
||||
c = FUNC (a); \
|
||||
if (signgam == 123) \
|
||||
puts ("PASS: " #FUNC " (0.5) setting signgam"); \
|
||||
else \
|
||||
{ \
|
||||
puts ("FAIL: " #FUNC " (0.5) setting signgam"); \
|
||||
result = 1; \
|
||||
} \
|
||||
signgam = 123; \
|
||||
c = FUNC (b); \
|
||||
if (signgam == 123) \
|
||||
puts ("PASS: " #FUNC " (-0.5) setting signgam"); \
|
||||
else \
|
||||
{ \
|
||||
puts ("FAIL: " #FUNC " (-0.5) setting signgam"); \
|
||||
result = 1; \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
int result = 0;
|
||||
RUN_TESTS (lgammaf, float);
|
||||
RUN_TESTS (lgamma, double);
|
||||
RUN_TESTS (lgammal, long double);
|
||||
return result;
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
/* Test lgamma functions set signgam for -ffinite-math-only (bug 19211).
|
||||
Copyright (C) 2015-2019 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
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define RUN_TESTS(FUNC, TYPE) \
|
||||
do \
|
||||
{ \
|
||||
volatile TYPE a, b, c __attribute__ ((unused)); \
|
||||
a = 0.5; \
|
||||
b = -0.5; \
|
||||
signgam = 123; \
|
||||
c = FUNC (a); \
|
||||
if (signgam == 1) \
|
||||
puts ("PASS: " #FUNC " (0.5) setting signgam"); \
|
||||
else \
|
||||
{ \
|
||||
puts ("FAIL: " #FUNC " (0.5) setting signgam"); \
|
||||
result = 1; \
|
||||
} \
|
||||
signgam = 123; \
|
||||
c = FUNC (b); \
|
||||
if (signgam == -1) \
|
||||
puts ("PASS: " #FUNC " (-0.5) setting signgam"); \
|
||||
else \
|
||||
{ \
|
||||
puts ("FAIL: " #FUNC " (-0.5) setting signgam"); \
|
||||
result = 1; \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
static int
|
||||
do_test (void)
|
||||
{
|
||||
int result = 0;
|
||||
RUN_TESTS (lgammaf, float);
|
||||
RUN_TESTS (gammaf, float);
|
||||
RUN_TESTS (lgamma, double);
|
||||
RUN_TESTS (gamma, double);
|
||||
RUN_TESTS (lgammal, long double);
|
||||
RUN_TESTS (gammal, long double);
|
||||
return result;
|
||||
}
|
||||
|
||||
#define TEST_FUNCTION do_test ()
|
||||
#include "../test-skeleton.c"
|
Loading…
Reference in New Issue
Block a user