From f7ba66b61f57d1d810b2a65e0c306096dbfcc1af Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Thu, 16 Feb 2017 23:08:20 +0000 Subject: RFC: Run libm tests separately for each function At present, libm tests for each function get built into a single executable (for each floating point type, for each of normal / inline / finite-math-only functions, plus vector variants) and run together, resulting in a single PASS or FAIL (for each of those nine variants plus vector variants). Building this executable involves reading about 40 MB of libm-test-*.c sources, which would grow to maybe 70 or 80 MB when the complex inverse trig and hyperbolic functions move to the auto-libm-test-* mechanism (that move is practical now that tests for all functions don't need regenerating for any change to auto-libm-test-in but you can instead regenerate each auto-libm-test-out-* file independently; auto-libm-test-out-casin and auto-libm-test-out-casinh take about 38 minutes each to generate on my system after such a move, auto-libm-test-out-cacos and auto-libm-test-out-cacosh take about 80 minutes each). This patch arranges for tests of each function to be run separately from the makefiles instead. There are 121 functions being tested for each (type, variant pair) (actually 126, but run as 121 from the Makefile because each of the pairs (exp10, pow10), (isfinite, finite), (lgamma, gamma), (remainder, drem), (scalbn, ldexp), shares a table of test results and so is run together), so 1089 separate tests run from the Makefile, plus 48 vector tests on x86_64 (six functions for eight vector variants). Each test only involves a libm-test-.c file of no more than about 4 MB, rather than all such files taking about 40 MB. With tests run separately, test summaries will indicate which functions actually have problems (of course, those problems may just be out-of-date libm-test-ulps files if the file hasn't been updated for the architecture in question recently). All the .c files for the 1089+48 tests are generated automatically from the Makefiles. Various checked-in boilerplate .c files are removed as no longer needed. CFLAGS definitions for the different kinds of tests are generated using makefile iterators to apply target-specific variable settings. libm-have-vector-test.h is no longer needed; the list of functions to test for each vector type is now in the sysdeps Makefile. This should remove the amount of boilerplate needed for float128 testing support; test-float128.h will still be needed, but not various .c files or Makefile CFLAGS definitions. The logic for creating dependencies on libm-test-support-*.o files should also render unnecessary. Any comments? Especially regarding the use of iterators; there is existing precedent (in elf/Makefile) for using o-iterator.mk as a generic iterator with object-suffixes-left set to something other than a list of object suffixes, but maybe there should be a differently named iterator for such generic uses? 2017-02-16 Joseph Myers * math/Makefile (libm-tests-generated): Remove variable. (libm-tests-base-normal): New variable. (libm-tests-base-finite): Likewise. (libm-tests-base-inline): Likewise. (libm-tests-base): Likewise. (libm-tests-normal): Likewise. (libm-tests-finite): Likewise. (libm-tests-inline): Likewise. (libm-tests-vector): Likewise. (libm-tests): Define in terms of these new variables. (libm-tests-for-type): New variable. (libm-tests.o): Move definition. (tests): Move addition of $(libm-tests). (generated): Update for new and removed libm test files. ($(objpfx)libm-test.c): Remove target. ($(objpfx)libm-have-vector-test.h): Likewise. (CFLAGS-test-double-vlen2.c): Remove variable. (CFLAGS-test-double-vlen4.c): Likewise. (CFLAGS-test-double-vlen8.c): Likewise. (CFLAGS-test-float-vlen4.c): Likewise. (CFLAGS-test-float-vlen8.c): Likewise. (CFLAGS-test-float-vlen16.c): Likewise. (CFLAGS-test-float.c): Likewise. (CFLAGS-test-float-finite.c): Likewise. (CFLAGS-libm-test-support-float.c): Likewise. (CFLAGS-test-double.c): Likewise. (CFLAGS-test-double-finite.c): Likewise. (CFLAGS-libm-test-support-double.c): Likewise. (CFLAGS-test-ldouble.c): Likewise. (CFLAGS-test-ldouble-finite.c): Likewise. (CFLAGS-libm-test-support-ldouble.c): Likewise. (libm-test-inline-cflags): New variable. (CFLAGS-test-ifloat.c): Remove variable. (CFLAGS-test-idouble.c): Likewise. (CFLAGS-test-ildouble.c): Likewise. ($(addprefix $(objpfx), $(libm-tests.o))): Move target and update dependencies. ($(foreach t,$(libm-tests-normal),$(objpfx)$(t).c)): New rule. ($(foreach t,$(libm-tests-finite),$(objpfx)$(t).c)): Likewise. ($(foreach t,$(libm-tests-inline),$(objpfx)$(t).c)): Likewise. ($(foreach t,$(libm-tests-vector),$(objpfx)$(t).c)): Likewise. ($(foreach t,$(types),$(objpfx)libm-test-support-$(t).c)): Likewise. (dependencies on libm-test-support-*.o): Remove. ($(foreach f,$(libm-test-funcs-all),$(objpfx)$(o)-$(f).o)): New rules using iterators. ($(addprefix $(objpfx),$(call libm-tests-for-type,$(o)))): Likewise. ($(objpfx)libm-test-support-$(o).o): Likewise. ($(addprefix $(objpfx),$(filter-out $(tests-static) $(libm-vec-tests),$(tests)))): Filter out $(libm-tests-vector) instead. ($(addprefix $(objpfx), $(libm-vec-tests))): Use iterator to define rule instead. * math/README.libm-test: Update. * math/libm-test-acos.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-acosh.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-asin.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-asinh.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-atan.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-atan2.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-atanh.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-cabs.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-cacos.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-cacosh.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-canonicalize.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-carg.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-casin.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-casinh.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-catan.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-catanh.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-cbrt.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-ccos.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-ccosh.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-ceil.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-cexp.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-cimag.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-clog.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-clog10.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-conj.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-copysign.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-cos.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-cosh.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-cpow.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-cproj.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-creal.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-csin.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-csinh.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-csqrt.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-ctan.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-ctanh.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-erf.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-erfc.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-exp.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-exp10.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-exp2.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-expm1.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-fabs.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-fdim.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-floor.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-fma.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-fmax.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-fmaxmag.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-fmin.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-fminmag.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-fmod.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-fpclassify.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-frexp.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-fromfp.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-fromfpx.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-getpayload.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-hypot.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-ilogb.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-iscanonical.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-iseqsig.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-isfinite.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-isgreater.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-isgreaterequal.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-isinf.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-isless.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-islessequal.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-islessgreater.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-isnan.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-isnormal.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-issignaling.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-issubnormal.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-isunordered.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-iszero.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-j0.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-j1.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-jn.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-lgamma.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-llogb.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-llrint.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-llround.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-log.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-log10.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-log1p.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-log2.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-logb.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-lrint.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-lround.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-modf.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-nearbyint.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-nextafter.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-nextdown.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-nexttoward.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-nextup.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-pow.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-remainder.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-remquo.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-rint.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-round.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-roundeven.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-scalb.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-scalbln.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-scalbn.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-setpayload.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-setpayloadsig.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-signbit.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-significand.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-sin.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-sincos.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-sinh.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-sqrt.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-tan.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-tanh.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-tgamma.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-totalorder.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-totalordermag.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-trunc.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-ufromfp.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-ufromfpx.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-y0.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-y1.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-yn.inc: Include libm-test-driver.c. (do_test): New function. * math/libm-test-driver.c: Do not include libm-have-vector-test.h. (HAVE_VECTOR): Remove macro. (START): Do not call HAVE_VECTOR. * math/test-double-vlen2.h (FUNC_TEST): Remove macro. * math/test-double-vlen4.h (FUNC_TEST): Remove macro. * math/test-double-vlen8.h (FUNC_TEST): Remove macro. * math/test-float-vlen16.h (FUNC_TEST): Remove macro. * math/test-float-vlen4.h (FUNC_TEST): Remove macro. * math/test-float-vlen8.h (FUNC_TEST): Remove macro. * math/test-math-vector.h (FUNC_TEST): New macro. (WRAPPER_DECL): Rename to WRAPPER_DECL_f. * sysdeps/x86_64/fpu/Makefile (double-vlen2-funcs): New variable. (double-vlen4-funcs): Likewise. (double-vlen4-avx2-funcs): Likewise. (double-vlen8-funcs): Likewise. (float-vlen4-funcs): Likewise. (float-vlen8-funcs): Likewise. (float-vlen8-avx2-funcs): Likewise. (float-vlen16-funcs): Likewise. (CFLAGS-test-double-vlen4-avx2.c): Remove variable. (CFLAGS-test-float-vlen8-avx2.c): Likewise. * sysdeps/x86_64/fpu/test-double-vlen4.h (TEST_VECTOR_cos): Remove macro. (TEST_VECTOR_sin): Likewise. (TEST_VECTOR_sincos): Likewise. (TEST_VECTOR_log): Likewise. (TEST_VECTOR_exp): Likewise. (TEST_VECTOR_pow): Likewise. * sysdeps/x86_64/fpu/test-double-vlen8.h (TEST_VECTOR_cos): Likewise. (TEST_VECTOR_sin): Likewise. (TEST_VECTOR_sincos): Likewise. (TEST_VECTOR_log): Likewise. (TEST_VECTOR_exp): Likewise. (TEST_VECTOR_pow): Likewise. * sysdeps/x86_64/fpu/test-float-vlen16.h (TEST_VECTOR_cosf): Likewise. (TEST_VECTOR_sinf): Likewise. (TEST_VECTOR_sincosf): Likewise. (TEST_VECTOR_logf): Likewise. (TEST_VECTOR_expf): Likewise. (TEST_VECTOR_powf): Likewise. * sysdeps/x86_64/fpu/test-float-vlen8.h (TEST_VECTOR_cosf): Likewise. (TEST_VECTOR_sinf): Likewise. (TEST_VECTOR_sincosf): Likewise. (TEST_VECTOR_logf): Likewise. (TEST_VECTOR_expf): Likewise. (TEST_VECTOR_powf): Likewise. * math/gen-libm-have-vector-test.sh: Remove file. * math/libm-test.inc: Likewise. * math/libm-test-support-double.c: Likewise. * math/libm-test-support-float.c: Likewise. * math/libm-test-support-ldouble.c: Likewise. * math/test-double-finite.c: Likewise.: Likewise. * math/test-double.c: Likewise. * math/test-float-finite.c: Likewise. * math/test-float.c: Likewise. * math/test-idouble.c: Likewise. * math/test-ifloat.c: Likewise. * math/test-ildouble.c: Likewise. * math/test-ldouble-finite.c: Likewise. * math/test-ldouble.c: Likewise. * sysdeps/x86_64/fpu/test-double-vlen2.c: Likewise. * sysdeps/x86_64/fpu/test-double-vlen2.h: Likewise. * sysdeps/x86_64/fpu/test-double-vlen4-avx2.c: Likewise. * sysdeps/x86_64/fpu/test-double-vlen4.c: Likewise. * sysdeps/x86_64/fpu/test-double-vlen8.c: Likewise. * sysdeps/x86_64/fpu/test-float-vlen16.c: Likewise. * sysdeps/x86_64/fpu/test-float-vlen4.c: Likewise. * sysdeps/x86_64/fpu/test-float-vlen4.h: Likewise. * sysdeps/x86_64/fpu/test-float-vlen8-avx2.c: Likewise. * sysdeps/x86_64/fpu/test-float-vlen8.c: Likewise. --- math/Makefile | 192 +++++++++++++++++------ math/README.libm-test | 23 +-- math/gen-libm-have-vector-test.sh | 52 ------- math/libm-test-acos.inc | 8 + math/libm-test-acosh.inc | 8 + math/libm-test-asin.inc | 8 + math/libm-test-asinh.inc | 8 + math/libm-test-atan.inc | 8 + math/libm-test-atan2.inc | 8 + math/libm-test-atanh.inc | 8 + math/libm-test-cabs.inc | 8 + math/libm-test-cacos.inc | 8 + math/libm-test-cacosh.inc | 8 + math/libm-test-canonicalize.inc | 8 + math/libm-test-carg.inc | 8 + math/libm-test-casin.inc | 8 + math/libm-test-casinh.inc | 8 + math/libm-test-catan.inc | 8 + math/libm-test-catanh.inc | 8 + math/libm-test-cbrt.inc | 8 + math/libm-test-ccos.inc | 8 + math/libm-test-ccosh.inc | 8 + math/libm-test-ceil.inc | 8 + math/libm-test-cexp.inc | 8 + math/libm-test-cimag.inc | 8 + math/libm-test-clog.inc | 8 + math/libm-test-clog10.inc | 8 + math/libm-test-conj.inc | 8 + math/libm-test-copysign.inc | 8 + math/libm-test-cos.inc | 8 + math/libm-test-cosh.inc | 8 + math/libm-test-cpow.inc | 8 + math/libm-test-cproj.inc | 8 + math/libm-test-creal.inc | 8 + math/libm-test-csin.inc | 8 + math/libm-test-csinh.inc | 8 + math/libm-test-csqrt.inc | 8 + math/libm-test-ctan.inc | 8 + math/libm-test-ctanh.inc | 8 + math/libm-test-driver.c | 6 - math/libm-test-erf.inc | 8 + math/libm-test-erfc.inc | 8 + math/libm-test-exp.inc | 8 + math/libm-test-exp10.inc | 9 ++ math/libm-test-exp2.inc | 8 + math/libm-test-expm1.inc | 8 + math/libm-test-fabs.inc | 8 + math/libm-test-fdim.inc | 8 + math/libm-test-floor.inc | 8 + math/libm-test-fma.inc | 8 + math/libm-test-fmax.inc | 8 + math/libm-test-fmaxmag.inc | 8 + math/libm-test-fmin.inc | 8 + math/libm-test-fminmag.inc | 8 + math/libm-test-fmod.inc | 8 + math/libm-test-fpclassify.inc | 8 + math/libm-test-frexp.inc | 8 + math/libm-test-fromfp.inc | 8 + math/libm-test-fromfpx.inc | 8 + math/libm-test-getpayload.inc | 8 + math/libm-test-hypot.inc | 8 + math/libm-test-ilogb.inc | 8 + math/libm-test-iscanonical.inc | 8 + math/libm-test-iseqsig.inc | 8 + math/libm-test-isfinite.inc | 9 ++ math/libm-test-isgreater.inc | 8 + math/libm-test-isgreaterequal.inc | 8 + math/libm-test-isinf.inc | 8 + math/libm-test-isless.inc | 8 + math/libm-test-islessequal.inc | 8 + math/libm-test-islessgreater.inc | 8 + math/libm-test-isnan.inc | 8 + math/libm-test-isnormal.inc | 8 + math/libm-test-issignaling.inc | 8 + math/libm-test-issubnormal.inc | 8 + math/libm-test-isunordered.inc | 8 + math/libm-test-iszero.inc | 8 + math/libm-test-j0.inc | 8 + math/libm-test-j1.inc | 8 + math/libm-test-jn.inc | 8 + math/libm-test-lgamma.inc | 9 ++ math/libm-test-llogb.inc | 8 + math/libm-test-llrint.inc | 8 + math/libm-test-llround.inc | 8 + math/libm-test-log.inc | 8 + math/libm-test-log10.inc | 8 + math/libm-test-log1p.inc | 8 + math/libm-test-log2.inc | 8 + math/libm-test-logb.inc | 8 + math/libm-test-lrint.inc | 8 + math/libm-test-lround.inc | 8 + math/libm-test-modf.inc | 8 + math/libm-test-nearbyint.inc | 8 + math/libm-test-nextafter.inc | 8 + math/libm-test-nextdown.inc | 8 + math/libm-test-nexttoward.inc | 8 + math/libm-test-nextup.inc | 8 + math/libm-test-pow.inc | 8 + math/libm-test-remainder.inc | 9 ++ math/libm-test-remquo.inc | 8 + math/libm-test-rint.inc | 8 + math/libm-test-round.inc | 8 + math/libm-test-roundeven.inc | 8 + math/libm-test-scalb.inc | 8 + math/libm-test-scalbln.inc | 8 + math/libm-test-scalbn.inc | 9 ++ math/libm-test-setpayload.inc | 8 + math/libm-test-setpayloadsig.inc | 8 + math/libm-test-signbit.inc | 8 + math/libm-test-significand.inc | 8 + math/libm-test-sin.inc | 8 + math/libm-test-sincos.inc | 8 + math/libm-test-sinh.inc | 8 + math/libm-test-sqrt.inc | 8 + math/libm-test-support-double.c | 20 --- math/libm-test-support-float.c | 20 --- math/libm-test-support-ldouble.c | 20 --- math/libm-test-tan.inc | 8 + math/libm-test-tanh.inc | 8 + math/libm-test-tgamma.inc | 8 + math/libm-test-totalorder.inc | 8 + math/libm-test-totalordermag.inc | 8 + math/libm-test-trunc.inc | 8 + math/libm-test-ufromfp.inc | 8 + math/libm-test-ufromfpx.inc | 8 + math/libm-test-y0.inc | 8 + math/libm-test-y1.inc | 8 + math/libm-test-yn.inc | 8 + math/libm-test.inc | 319 -------------------------------------- math/test-double-finite.c | 23 --- math/test-double-vlen2.h | 2 - math/test-double-vlen4.h | 2 - math/test-double-vlen8.h | 2 - math/test-double.c | 25 --- math/test-float-finite.c | 23 --- math/test-float-vlen16.h | 2 - math/test-float-vlen4.h | 2 - math/test-float-vlen8.h | 2 - math/test-float.c | 25 --- math/test-idouble.c | 23 --- math/test-ifloat.c | 23 --- math/test-ildouble.c | 23 --- math/test-ldouble-finite.c | 23 --- math/test-ldouble.c | 25 --- math/test-math-vector.h | 3 +- 145 files changed, 1130 insertions(+), 723 deletions(-) delete mode 100644 math/gen-libm-have-vector-test.sh delete mode 100644 math/libm-test-support-double.c delete mode 100644 math/libm-test-support-float.c delete mode 100644 math/libm-test-support-ldouble.c delete mode 100644 math/libm-test.inc delete mode 100644 math/test-double-finite.c delete mode 100644 math/test-double.c delete mode 100644 math/test-float-finite.c delete mode 100644 math/test-float.c delete mode 100644 math/test-idouble.c delete mode 100644 math/test-ifloat.c delete mode 100644 math/test-ildouble.c delete mode 100644 math/test-ldouble-finite.c delete mode 100644 math/test-ldouble.c (limited to 'math') diff --git a/math/Makefile b/math/Makefile index 273521223c..fabd0e946b 100644 --- a/math/Makefile +++ b/math/Makefile @@ -192,13 +192,6 @@ endif ifneq (no,$(PERL)) libm-vec-tests = $(addprefix test-,$(libmvec-tests)) - -libm-tests = $(foreach t,$(types),test-$(t) test-$(t)-finite test-i$(t)) \ - $(libm-vec-tests) - -libm-tests.o = $(addsuffix .o,$(libm-tests)) - -tests += $(libm-tests) libm-test-support = $(foreach t,$(types),libm-test-support-$(t)) test-extras += $(libm-test-support) extra-test-objs += $(addsuffix .o, $(libm-test-support)) @@ -232,15 +225,42 @@ libm-test-funcs-noauto = cacos cacosh canonicalize casin casinh catan catanh \ libm-test-funcs-all = $(libm-test-funcs-auto) $(libm-test-funcs-noauto) libm-test-c-auto = $(foreach f,$(libm-test-funcs-auto),libm-test-$(f).c) libm-test-c-noauto = $(foreach f,$(libm-test-funcs-noauto),libm-test-$(f).c) -libm-tests-generated = libm-test-ulps.h libm-have-vector-test.h libm-test.c \ - $(libm-test-c-auto) $(libm-test-c-noauto) -generated += $(libm-tests-generated) +generated += libm-test-ulps.h $(libm-test-c-auto) $(libm-test-c-noauto) + +libm-tests-base-normal = $(foreach t,$(types),test-$(t)) +libm-tests-base-finite = $(foreach t,$(types),test-$(t)-finite) +libm-tests-base-inline = $(foreach t,$(types),test-i$(t)) +libm-tests-base = $(libm-tests-base-normal) $(libm-tests-base-finite) \ + $(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))) +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-vector) +libm-tests-for-type = $(foreach f,$(libm-test-funcs-all),\ + test-$(1)-$(f) test-$(1)-finite-$(f) \ + test-i$(1)-$(f)) \ + $(filter test-$(1)-%,$(libm-tests-vector)) + +libm-tests.o = $(addsuffix .o,$(libm-tests)) + +tests += $(libm-tests) +generated += $(addsuffix .c,$(libm-tests)) \ + $(foreach t,$(types),libm-test-support-$(t).c) libm-test-c-auto-obj = $(addprefix $(objpfx),$(libm-test-c-auto)) libm-test-c-noauto-obj = $(addprefix $(objpfx),$(libm-test-c-noauto)) -$(objpfx)libm-test.c $(libm-test-c-noauto-obj): $(objpfx)libm-test%.c: \ - libm-test%.inc gen-libm-test.pl +$(libm-test-c-noauto-obj): $(objpfx)libm-test%.c: libm-test%.inc \ + gen-libm-test.pl $(make-target-directory) $(PERL) gen-libm-test.pl -c $< -a /dev/null -C $@ @@ -251,30 +271,18 @@ $(libm-test-c-auto-obj): $(objpfx)libm-test%.c: libm-test%.inc \ $(PERL) gen-libm-test.pl -c $< -a auto-libm-test-out$* -C $@ libm-test-incs = $(foreach f,$(libm-test-funcs-all),libm-test-$(f).inc) - -$(objpfx)libm-have-vector-test.h: $(libm-test-incs) gen-libm-have-vector-test.sh - $(make-target-directory) - $(SHELL) gen-libm-have-vector-test.sh $(sort $(libm-test-incs)) > $@ endif libm-test-fast-math-cflags = -fno-builtin -D__FAST_MATH__ -DTEST_FAST_MATH libm-test-vec-cflags = $(libm-test-fast-math-cflags) -fno-inline \ -ffloat-store -D_OPENMP=201307 -Wno-unknown-pragmas -CFLAGS-test-double-vlen2.c = $(libm-test-vec-cflags) - -CFLAGS-test-double-vlen4.c = $(libm-test-vec-cflags) CFLAGS-test-double-vlen4-wrappers.c = $(double-vlen4-arch-ext-cflags) -CFLAGS-test-double-vlen8.c = $(libm-test-vec-cflags) CFLAGS-test-double-vlen8-wrappers.c = $(double-vlen8-arch-ext-cflags) -CFLAGS-test-float-vlen4.c = $(libm-test-vec-cflags) - -CFLAGS-test-float-vlen8.c = $(libm-test-vec-cflags) CFLAGS-test-float-vlen8-wrappers.c = $(float-vlen8-arch-ext-cflags) -CFLAGS-test-float-vlen16.c = $(libm-test-vec-cflags) CFLAGS-test-float-vlen16-wrappers.c = $(float-vlen16-arch-ext-cflags) # The no-inline tests use -fsignaling-nans, and thereby use the @@ -287,15 +295,7 @@ 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 -CFLAGS-test-float.c = $(libm-test-no-inline-cflags) -CFLAGS-test-float-finite.c = $(libm-test-finite-cflags) -CFLAGS-libm-test-support-float.c = $(libm-test-no-inline-cflags) -CFLAGS-test-double.c = $(libm-test-no-inline-cflags) -CFLAGS-test-double-finite.c = $(libm-test-finite-cflags) -CFLAGS-libm-test-support-double.c = $(libm-test-no-inline-cflags) -CFLAGS-test-ldouble.c = $(libm-test-no-inline-cflags) -CFLAGS-test-ldouble-finite.c = $(libm-test-finite-cflags) -CFLAGS-libm-test-support-ldouble.c = $(libm-test-no-inline-cflags) +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 # while to compile it. See: http://llvm.org/bugs/show_bug.cgi?id=14106 and @@ -305,9 +305,6 @@ CFLAGS-test-tgmath-ret.c = -fno-builtin CFLAGS-test-powl.c = -fno-builtin CFLAGS-test-snan.c = -fsignaling-nans -CFLAGS-test-ifloat.c = $(libm-test-fast-math-cflags) -CFLAGS-test-idouble.c = $(libm-test-fast-math-cflags) -CFLAGS-test-ildouble.c = $(libm-test-fast-math-cflags) CFLAGS-test-signgam-finite.c = -ffinite-math-only CFLAGS-test-signgam-finite-c99.c = -ffinite-math-only -std=c99 @@ -370,20 +367,111 @@ $(foreach t, $(call type-foreach, $(gen-all-calls)), \ ifneq (no,$(PERL)) # This must come after the inclusion of sysdeps Makefiles via Rules. -$(addprefix $(objpfx), $(libm-tests.o)): $(addprefix $(objpfx),\ - $(libm-tests-generated)) -$(addprefix $(objpfx),\ - $(filter test-float% test-ifloat%,\ - $(libm-tests))): $(objpfx)libm-test-support-float.o +$(foreach t,$(libm-tests-normal),$(objpfx)$(t).c): $(objpfx)test-%.c: + type_func=$*; \ + type=$${type_func%%-*}; \ + func=$${type_func#*-}; \ + ( \ + echo "#include "; \ + echo "#include "; \ + echo "#include "; \ + echo "#include "; \ + echo "#include "; \ + echo "#include "; \ + ) > $@ + +$(foreach t,$(libm-tests-finite),$(objpfx)$(t).c): $(objpfx)test-%.c: + type_func=$*; \ + type=$${type_func%%-*}; \ + func=$${type_func#*-finite-}; \ + ( \ + echo "#include "; \ + echo "#include "; \ + echo "#include "; \ + echo "#include "; \ + echo "#include "; \ + ) > $@ + +$(foreach t,$(libm-tests-inline),$(objpfx)$(t).c): $(objpfx)test-i%.c: + type_func=$*; \ + type=$${type_func%%-*}; \ + func=$${type_func#*-}; \ + ( \ + echo "#include "; \ + echo "#include "; \ + echo "#include "; \ + echo "#include "; \ + ) > $@ + +$(foreach t,$(libm-tests-vector),$(objpfx)$(t).c): $(objpfx)test-%.c: + type_func=$*; \ + type=$${type_func%-*}; \ + func=$${type_func##*-}; \ + func_args=$$(grep ALL_RM_TEST libm-test-$$func.inc \ + | sed 's/.*RUN_TEST_LOOP_//;s/_.*//'); \ + ( \ + echo "#include "; \ + echo "WRAPPER_DECL_$$func_args (WRAPPER_NAME (FUNC ($$func)))"; \ + echo "#include "; \ + ) > $@ + +$(foreach t,$(types),\ + $(objpfx)libm-test-support-$(t).c): $(objpfx)libm-test-support-%.c: + ( \ + echo "#include "; \ + echo "#include "; \ + ) > $@ + +$(addprefix $(objpfx), $(libm-tests.o)): $(objpfx)libm-test-ulps.h -$(addprefix $(objpfx),\ - $(filter test-double% test-idouble%,\ - $(libm-tests))): $(objpfx)libm-test-support-double.o +define o-iterator-doit +$(foreach f,$(libm-test-funcs-all),\ + $(objpfx)$(o)-$(f).o): $(objpfx)$(o)%.o: $(objpfx)libm-test%.c +endef +object-suffixes-left := $(libm-tests-base) +include $(o-iterator) + +define o-iterator-doit +$(foreach f,$(libm-test-funcs-all),\ + $(objpfx)$(o)-$(f).o): CFLAGS += $(libm-test-no-inline-cflags) +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) +endef +object-suffixes-left := $(libm-tests-base-inline) +include $(o-iterator) + +define o-iterator-doit +$(foreach f,$($(o)-funcs),\ + $(objpfx)test-$(o)-$(f).o): CFLAGS += $(libm-test-vec-cflags) +endef +object-suffixes-left := $(libmvec-tests) +include $(o-iterator) + +define o-iterator-doit $(addprefix $(objpfx),\ - $(filter test-ldouble% test-ildouble%,\ - $(libm-tests))): $(objpfx)libm-test-support-ldouble.o + $(call libm-tests-for-type,$(o))): $(objpfx)libm-test-support-$(o).o +endef +object-suffixes-left := $(types) +include $(o-iterator) + +define o-iterator-doit +$(objpfx)libm-test-support-$(o).o: CFLAGS += $(libm-test-no-inline-cflags) +endef +object-suffixes-left := $(types) +include $(o-iterator) # Run the math programs to automatically generate ULPs files. .PHONY: regen-ulps @@ -460,10 +548,16 @@ $(objpfx)libieee.a: $(objpfx)ieee-math.o $(LN_S) $(.c" and a file "libm-test-ulps.h" with platform specific deltas by which the actual math function results may deviate from the expected results and still be considered correct. -The test drivers "test-double.c", "test-float.c", and "test-ldouble.c" -test the normal double, float and long double implementation of libm. -The test drivers with an 'i' in their name ("test-idouble.c", -"test-ifloat.c", and "test-ildoubl.c") test the corresponding inline -functions (where available - otherwise they also test the real -functions in libm). Each driver selects the desired real floating -type to exercise the math functions to test with (float, double, or -long double) by defining a small set of macros just before including -the generic "libm-test.c" file. Each driver also either defines or -undefines the __NO_MATH_INLINES macro just before including -"libm-test.c" to select either the real or inline functions, +The test drivers "test-double-.c", "test-float-.c", and +"test-ldouble-.c", generated by the Makefile, test the normal +double, float and long double implementation of libm. The test +drivers with an 'i' in their name ("test-idouble-.c", +"test-ifloat-.c", and "test-ildoubl-.c") test the +corresponding inline functions (where available - otherwise they also +test the real functions in libm). Each driver selects the desired +real floating type to exercise the math functions to test with (float, +double, or long double) by defining a small set of macros just before +including the generic "libm-test.c" file. Each driver also either +defines or undefines the __NO_MATH_INLINES macro just before including +"libm-test-.c" to select either the real or inline functions, respectively. Each driver is compiled into a single executable test program with the corresponding name. diff --git a/math/gen-libm-have-vector-test.sh b/math/gen-libm-have-vector-test.sh deleted file mode 100644 index 7d9d6d7b02..0000000000 --- a/math/gen-libm-have-vector-test.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh -# Copyright (C) 2014-2017 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 -# . - -# Generate series of definitions used for vector math functions tests. -# TEST_VECTOR_* and WRAPPER_NAME are defined in vector math functions tests. -# *_VEC_SUFF is used in individual tests, as result of FUNC_TEST unfolding -# to avoid warnings / errors about undeclared functions. -print_defs() -{ - echo "#if defined TEST_VECTOR_$1 && TEST_VECTOR_$1" - echo "# define HAVE_VECTOR_$1 1" - echo "# define ${1}_VEC_SUFF WRAPPER_NAME ($1)" - echo "WRAPPER_DECL$2 (WRAPPER_NAME ($1))" - echo "#else" - echo "# define HAVE_VECTOR_$1 0" - echo "# define ${1}_VEC_SUFF $1" - echo "#endif" - echo -} - -for func in $(cat $@ | grep ALL_RM_TEST | grep -v define | grep -v RUN_TEST_LOOP_ff_f | grep -v RUN_TEST_LOOP_fFF_11 | sed -r "s/.*\(//; s/,.*//" ); do - print_defs ${func} - print_defs ${func}f - print_defs ${func}l -done - -for func in $(cat $@ | grep ALL_RM_TEST | grep RUN_TEST_LOOP_ff_f | sed -r "s/.*\(//; s/,.*//" ); do - print_defs ${func} "_ff" - print_defs ${func}f "_ff" - print_defs ${func}l "_ff" -done - -for func in $(cat $@ | grep ALL_RM_TEST | grep RUN_TEST_LOOP_fFF_11 | sed -r "s/.*\(//; s/,.*//" ); do - print_defs ${func} "_fFF" - print_defs ${func}f "_fFF" - print_defs ${func}l "_fFF" -done diff --git a/math/libm-test-acos.inc b/math/libm-test-acos.inc index c98da4f222..d795793a15 100644 --- a/math/libm-test-acos.inc +++ b/math/libm-test-acos.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_f_f_data acos_test_data[] = { TEST_f_f (acos, plus_infty, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM), @@ -40,6 +42,12 @@ acos_test (void) ALL_RM_TEST (acos, 0, acos_test_data, RUN_TEST_LOOP_f_f, END); } +static void +do_test (void) +{ + acos_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-acosh.inc b/math/libm-test-acosh.inc index 470fa29cd1..816a1cd371 100644 --- a/math/libm-test-acosh.inc +++ b/math/libm-test-acosh.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_f_f_data acosh_test_data[] = { TEST_f_f (acosh, plus_infty, plus_infty, ERRNO_UNCHANGED), @@ -45,6 +47,12 @@ acosh_test (void) ALL_RM_TEST (acosh, 0, acosh_test_data, RUN_TEST_LOOP_f_f, END); } +static void +do_test (void) +{ + acosh_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-asin.inc b/math/libm-test-asin.inc index 6d3ed8ec9e..9b6d229df1 100644 --- a/math/libm-test-asin.inc +++ b/math/libm-test-asin.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_f_f_data asin_test_data[] = { TEST_f_f (asin, plus_infty, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM), @@ -40,6 +42,12 @@ asin_test (void) ALL_RM_TEST (asin, 0, asin_test_data, RUN_TEST_LOOP_f_f, END); } +static void +do_test (void) +{ + asin_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-asinh.inc b/math/libm-test-asinh.inc index af8392afad..f218e032c3 100644 --- a/math/libm-test-asinh.inc +++ b/math/libm-test-asinh.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_f_f_data asinh_test_data[] = { TEST_f_f (asinh, plus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), @@ -33,6 +35,12 @@ asinh_test (void) ALL_RM_TEST (asinh, 0, asinh_test_data, RUN_TEST_LOOP_f_f, END); } +static void +do_test (void) +{ + asinh_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-atan.inc b/math/libm-test-atan.inc index 365ca87bf1..ed96133616 100644 --- a/math/libm-test-atan.inc +++ b/math/libm-test-atan.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_f_f_data atan_test_data[] = { TEST_f_f (atan, plus_infty, lit_pi_2_d, ERRNO_UNCHANGED), @@ -34,6 +36,12 @@ atan_test (void) ALL_RM_TEST (atan, 0, atan_test_data, RUN_TEST_LOOP_f_f, END); } +static void +do_test (void) +{ + atan_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-atan2.inc b/math/libm-test-atan2.inc index 9caedf7bea..e9001133f1 100644 --- a/math/libm-test-atan2.inc +++ b/math/libm-test-atan2.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_ff_f_data atan2_test_data[] = { /* atan2 (y,inf) == +0 for finite y > 0 or +0. */ @@ -196,6 +198,12 @@ atan2_test (void) ALL_RM_TEST (atan2, 0, atan2_test_data, RUN_TEST_LOOP_ff_f, END); } +static void +do_test (void) +{ + atan2_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-atanh.inc b/math/libm-test-atanh.inc index 97990b3507..a57aebbca7 100644 --- a/math/libm-test-atanh.inc +++ b/math/libm-test-atanh.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_f_f_data atanh_test_data[] = { TEST_f_f (atanh, 1, plus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE), @@ -42,6 +44,12 @@ atanh_test (void) ALL_RM_TEST (atanh, 0, atanh_test_data, RUN_TEST_LOOP_f_f, END); } +static void +do_test (void) +{ + atanh_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-cabs.inc b/math/libm-test-cabs.inc index 36d609ad9a..d9a66fa631 100644 --- a/math/libm-test-cabs.inc +++ b/math/libm-test-cabs.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_c_f_data cabs_test_data[] = { /* cabs (x + iy) is specified as hypot (x,y) */ @@ -39,6 +41,12 @@ cabs_test (void) ALL_RM_TEST (cabs, 0, cabs_test_data, RUN_TEST_LOOP_c_f, END); } +static void +do_test (void) +{ + cabs_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-cacos.inc b/math/libm-test-cacos.inc index 2a4e2f945a..33f62eb272 100644 --- a/math/libm-test-cacos.inc +++ b/math/libm-test-cacos.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_c_c_data cacos_test_data[] = { TEST_c_c (cacos, 0, 0, lit_pi_2_d, minus_zero), @@ -704,6 +706,12 @@ cacos_test (void) ALL_RM_TEST (cacos, 0, cacos_test_data, RUN_TEST_LOOP_c_c, END_COMPLEX); } +static void +do_test (void) +{ + cacos_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-cacosh.inc b/math/libm-test-cacosh.inc index 21e65b16e2..b6c15272ae 100644 --- a/math/libm-test-cacosh.inc +++ b/math/libm-test-cacosh.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_c_c_data cacosh_test_data[] = { TEST_c_c (cacosh, 0, 0, 0.0, lit_pi_2_d), @@ -698,6 +700,12 @@ cacosh_test (void) ALL_RM_TEST (cacosh, 0, cacosh_test_data, RUN_TEST_LOOP_c_c, END_COMPLEX); } +static void +do_test (void) +{ + cacosh_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-canonicalize.inc b/math/libm-test-canonicalize.inc index 93a0a9bb6b..e0ba3eceaa 100644 --- a/math/libm-test-canonicalize.inc +++ b/math/libm-test-canonicalize.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_Ff_b1_data canonicalize_test_data[] = { TEST_Ffp_b1 (canonicalize, plus_infty, 0, plus_infty, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), @@ -80,6 +82,12 @@ canonicalize_test (void) ALL_RM_TEST (canonicalize, 1, canonicalize_test_data, RUN_TEST_LOOP_Ffp_b1, END, x); } +static void +do_test (void) +{ + canonicalize_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-carg.inc b/math/libm-test-carg.inc index e92d4fbcce..e03389310f 100644 --- a/math/libm-test-carg.inc +++ b/math/libm-test-carg.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_c_f_data carg_test_data[] = { /* carg (x + iy) is specified as atan2 (y, x) */ @@ -57,6 +59,12 @@ carg_test (void) ALL_RM_TEST (carg, 0, carg_test_data, RUN_TEST_LOOP_c_f, END); } +static void +do_test (void) +{ + carg_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-casin.inc b/math/libm-test-casin.inc index a74c6ec4cb..23a736256e 100644 --- a/math/libm-test-casin.inc +++ b/math/libm-test-casin.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_c_c_data casin_test_data[] = { TEST_c_c (casin, 0, 0, 0.0, 0.0), @@ -705,6 +707,12 @@ casin_test (void) ALL_RM_TEST (casin, 0, casin_test_data, RUN_TEST_LOOP_c_c, END_COMPLEX); } +static void +do_test (void) +{ + casin_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-casinh.inc b/math/libm-test-casinh.inc index ffe36adf0c..b8cdbcbfbc 100644 --- a/math/libm-test-casinh.inc +++ b/math/libm-test-casinh.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_c_c_data casinh_test_data[] = { TEST_c_c (casinh, 0, 0, 0.0, 0.0), @@ -705,6 +707,12 @@ casinh_test (void) ALL_RM_TEST (casinh, 0, casinh_test_data, RUN_TEST_LOOP_c_c, END_COMPLEX); } +static void +do_test (void) +{ + casinh_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-catan.inc b/math/libm-test-catan.inc index 687c73053f..ead73abce3 100644 --- a/math/libm-test-catan.inc +++ b/math/libm-test-catan.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_c_c_data catan_test_data[] = { TEST_c_c (catan, 0, 0, 0, 0), @@ -522,6 +524,12 @@ catan_test (void) ALL_RM_TEST (catan, 0, catan_test_data, RUN_TEST_LOOP_c_c, END_COMPLEX); } +static void +do_test (void) +{ + catan_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-catanh.inc b/math/libm-test-catanh.inc index 6848e60c43..4d04b0af8e 100644 --- a/math/libm-test-catanh.inc +++ b/math/libm-test-catanh.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_c_c_data catanh_test_data[] = { TEST_c_c (catanh, 0, 0, 0.0, 0.0), @@ -521,6 +523,12 @@ catanh_test (void) ALL_RM_TEST (catanh, 0, catanh_test_data, RUN_TEST_LOOP_c_c, END_COMPLEX); } +static void +do_test (void) +{ + catanh_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-cbrt.inc b/math/libm-test-cbrt.inc index 11a8a3bae7..769f52e89f 100644 --- a/math/libm-test-cbrt.inc +++ b/math/libm-test-cbrt.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_f_f_data cbrt_test_data[] = { TEST_f_f (cbrt, plus_infty, plus_infty, ERRNO_UNCHANGED), @@ -34,6 +36,12 @@ cbrt_test (void) ALL_RM_TEST (cbrt, 0, cbrt_test_data, RUN_TEST_LOOP_f_f, END); } +static void +do_test (void) +{ + cbrt_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-ccos.inc b/math/libm-test-ccos.inc index 3180b55c66..2497af1d49 100644 --- a/math/libm-test-ccos.inc +++ b/math/libm-test-ccos.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_c_c_data ccos_test_data[] = { TEST_c_c (ccos, plus_infty, 0.0, qnan_value, 0.0, INVALID_EXCEPTION|IGNORE_ZERO_INF_SIGN), @@ -72,6 +74,12 @@ ccos_test (void) ALL_RM_TEST (ccos, 0, ccos_test_data, RUN_TEST_LOOP_c_c, END_COMPLEX); } +static void +do_test (void) +{ + ccos_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-ccosh.inc b/math/libm-test-ccosh.inc index ac4c103e67..7c22c9e38f 100644 --- a/math/libm-test-ccosh.inc +++ b/math/libm-test-ccosh.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_c_c_data ccosh_test_data[] = { TEST_c_c (ccosh, 0.0, plus_infty, qnan_value, 0.0, INVALID_EXCEPTION|IGNORE_ZERO_INF_SIGN), @@ -72,6 +74,12 @@ ccosh_test (void) ALL_RM_TEST (ccosh, 0, ccosh_test_data, RUN_TEST_LOOP_c_c, END_COMPLEX); } +static void +do_test (void) +{ + ccosh_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-ceil.inc b/math/libm-test-ceil.inc index c173b7e36e..d6356a574b 100644 --- a/math/libm-test-ceil.inc +++ b/math/libm-test-ceil.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_f_f_data ceil_test_data[] = { TEST_f_f (ceil, 0.0, 0.0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), @@ -162,6 +164,12 @@ ceil_test (void) ALL_RM_TEST (ceil, 1, ceil_test_data, RUN_TEST_LOOP_f_f, END); } +static void +do_test (void) +{ + ceil_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-cexp.inc b/math/libm-test-cexp.inc index 355748c50c..f4bd962c5d 100644 --- a/math/libm-test-cexp.inc +++ b/math/libm-test-cexp.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_c_c_data cexp_test_data[] = { TEST_c_c (cexp, plus_infty, plus_zero, plus_infty, 0.0), @@ -69,6 +71,12 @@ cexp_test (void) ALL_RM_TEST (cexp, 0, cexp_test_data, RUN_TEST_LOOP_c_c, END_COMPLEX); } +static void +do_test (void) +{ + cexp_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-cimag.inc b/math/libm-test-cimag.inc index a711f4cf53..569d20c5df 100644 --- a/math/libm-test-cimag.inc +++ b/math/libm-test-cimag.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_c_f_data cimag_test_data[] = { TEST_c_f (cimag, 1.0, 0.0, 0.0, NO_INEXACT_EXCEPTION), @@ -37,6 +39,12 @@ cimag_test (void) ALL_RM_TEST (cimag, 1, cimag_test_data, RUN_TEST_LOOP_c_f, END); } +static void +do_test (void) +{ + cimag_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-clog.inc b/math/libm-test-clog.inc index 261aaad6ba..6a97d5a31d 100644 --- a/math/libm-test-clog.inc +++ b/math/libm-test-clog.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_c_c_data clog_test_data[] = { TEST_c_c (clog, minus_zero, 0, minus_infty, lit_pi, DIVIDE_BY_ZERO_EXCEPTION), @@ -76,6 +78,12 @@ clog_test (void) ALL_RM_TEST (clog, 0, clog_test_data, RUN_TEST_LOOP_c_c, END_COMPLEX); } +static void +do_test (void) +{ + clog_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-clog10.inc b/math/libm-test-clog10.inc index 0c92a79b96..b330d74d53 100644 --- a/math/libm-test-clog10.inc +++ b/math/libm-test-clog10.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_c_c_data clog10_test_data[] = { TEST_c_c (clog10, minus_zero, 0, minus_infty, lit_pi_ln10_d, DIVIDE_BY_ZERO_EXCEPTION), @@ -75,6 +77,12 @@ clog10_test (void) ALL_RM_TEST (clog10, 0, clog10_test_data, RUN_TEST_LOOP_c_c, END_COMPLEX); } +static void +do_test (void) +{ + clog10_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-conj.inc b/math/libm-test-conj.inc index cfa0a53810..e5b2529b88 100644 --- a/math/libm-test-conj.inc +++ b/math/libm-test-conj.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_c_c_data conj_test_data[] = { TEST_c_c (conj, 0.0, 0.0, 0.0, minus_zero, NO_INEXACT_EXCEPTION), @@ -36,6 +38,12 @@ conj_test (void) ALL_RM_TEST (conj, 1, conj_test_data, RUN_TEST_LOOP_c_c, END_COMPLEX); } +static void +do_test (void) +{ + conj_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-copysign.inc b/math/libm-test-copysign.inc index e717160673..635cb02f66 100644 --- a/math/libm-test-copysign.inc +++ b/math/libm-test-copysign.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_ff_f_data copysign_test_data[] = { TEST_ff_f (copysign, 0, 0, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), @@ -105,6 +107,12 @@ copysign_test (void) ALL_RM_TEST (copysign, 1, copysign_test_data, RUN_TEST_LOOP_ff_f, END); } +static void +do_test (void) +{ + copysign_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-cos.inc b/math/libm-test-cos.inc index 1ca5b41454..246b37154e 100644 --- a/math/libm-test-cos.inc +++ b/math/libm-test-cos.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_f_f_data cos_test_data[] = { TEST_f_f (cos, plus_infty, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM), @@ -34,6 +36,12 @@ cos_test (void) ALL_RM_TEST (cos, 0, cos_test_data, RUN_TEST_LOOP_f_f, END); } +static void +do_test (void) +{ + cos_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-cosh.inc b/math/libm-test-cosh.inc index a6456440d5..a0b88b0884 100644 --- a/math/libm-test-cosh.inc +++ b/math/libm-test-cosh.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_f_f_data cosh_test_data[] = { TEST_f_f (cosh, plus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), @@ -34,6 +36,12 @@ cosh_test (void) ALL_RM_TEST (cosh, 0, cosh_test_data, RUN_TEST_LOOP_f_f, END); } +static void +do_test (void) +{ + cosh_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-cpow.inc b/math/libm-test-cpow.inc index 2f4cda209c..ffd112844e 100644 --- a/math/libm-test-cpow.inc +++ b/math/libm-test-cpow.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_cc_c_data cpow_test_data[] = { TEST_cc_c (cpow, qnan_value, qnan_value, qnan_value, qnan_value, qnan_value, qnan_value), @@ -29,6 +31,12 @@ cpow_test (void) ALL_RM_TEST (cpow, 0, cpow_test_data, RUN_TEST_LOOP_cc_c, END_COMPLEX); } +static void +do_test (void) +{ + cpow_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-cproj.inc b/math/libm-test-cproj.inc index 2daa6ab59f..441d58ba7f 100644 --- a/math/libm-test-cproj.inc +++ b/math/libm-test-cproj.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_c_c_data cproj_test_data[] = { TEST_c_c (cproj, 0.0, 0.0, 0.0, 0.0, NO_INEXACT_EXCEPTION), @@ -80,6 +82,12 @@ cproj_test (void) ALL_RM_TEST (cproj, 1, cproj_test_data, RUN_TEST_LOOP_c_c, END_COMPLEX); } +static void +do_test (void) +{ + cproj_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-creal.inc b/math/libm-test-creal.inc index 20ea43c914..aaa1412ac6 100644 --- a/math/libm-test-creal.inc +++ b/math/libm-test-creal.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_c_f_data creal_test_data[] = { TEST_c_f (creal, 0.0, 1.0, 0.0, NO_INEXACT_EXCEPTION), @@ -37,6 +39,12 @@ creal_test (void) ALL_RM_TEST (creal, 1, creal_test_data, RUN_TEST_LOOP_c_f, END); } +static void +do_test (void) +{ + creal_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-csin.inc b/math/libm-test-csin.inc index f42828c874..03214ad512 100644 --- a/math/libm-test-csin.inc +++ b/math/libm-test-csin.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_c_c_data csin_test_data[] = { TEST_c_c (csin, 0.0, plus_infty, 0.0, plus_infty), @@ -72,6 +74,12 @@ csin_test (void) ALL_RM_TEST (csin, 0, csin_test_data, RUN_TEST_LOOP_c_c, END_COMPLEX); } +static void +do_test (void) +{ + csin_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-csinh.inc b/math/libm-test-csinh.inc index 06877c8468..41b9092bb1 100644 --- a/math/libm-test-csinh.inc +++ b/math/libm-test-csinh.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_c_c_data csinh_test_data[] = { TEST_c_c (csinh, 0.0, plus_infty, 0.0, qnan_value, INVALID_EXCEPTION|IGNORE_ZERO_INF_SIGN), @@ -72,6 +74,12 @@ csinh_test (void) ALL_RM_TEST (csinh, 0, csinh_test_data, RUN_TEST_LOOP_c_c, END_COMPLEX); } +static void +do_test (void) +{ + csinh_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-csqrt.inc b/math/libm-test-csqrt.inc index 6ff26faa9b..43918fe146 100644 --- a/math/libm-test-csqrt.inc +++ b/math/libm-test-csqrt.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_c_c_data csqrt_test_data[] = { TEST_c_c (csqrt, minus_infty, 0, 0.0, plus_infty), @@ -66,6 +68,12 @@ csqrt_test (void) ALL_RM_TEST (csqrt, 0, csqrt_test_data, RUN_TEST_LOOP_c_c, END_COMPLEX); } +static void +do_test (void) +{ + csqrt_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-ctan.inc b/math/libm-test-ctan.inc index a5689400f3..e485828b8c 100644 --- a/math/libm-test-ctan.inc +++ b/math/libm-test-ctan.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_c_c_data ctan_test_data[] = { TEST_c_c (ctan, 0, plus_infty, 0.0, 1.0), @@ -126,6 +128,12 @@ ctan_test (void) ALL_RM_TEST (ctan, 0, ctan_test_data, RUN_TEST_LOOP_c_c, END_COMPLEX); } +static void +do_test (void) +{ + ctan_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-ctanh.inc b/math/libm-test-ctanh.inc index 48002ebde6..6ddeb0d361 100644 --- a/math/libm-test-ctanh.inc +++ b/math/libm-test-ctanh.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_c_c_data ctanh_test_data[] = { TEST_c_c (ctanh, plus_infty, 0, 1.0, 0.0), @@ -125,6 +127,12 @@ ctanh_test (void) ALL_RM_TEST (ctanh, 0, ctanh_test_data, RUN_TEST_LOOP_c_c, END_COMPLEX); } +static void +do_test (void) +{ + ctanh_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-driver.c b/math/libm-test-driver.c index d24c5aadaf..161419837d 100644 --- a/math/libm-test-driver.c +++ b/math/libm-test-driver.c @@ -952,15 +952,9 @@ struct test_Ff_b1_data #define STR_CONCAT(a, b, c) __STRING (a##b##c) #define STR_CON3(a, b, c) STR_CONCAT (a, b, c) -/* This generated header defines series of macros started with HAVE_VECTOR_. */ -#include "libm-have-vector-test.h" - -#define HAVE_VECTOR(func) __CONCAT (HAVE_VECTOR_, func) - /* Start and end the tests for a given function. */ #define START(FUN, SUFF, EXACT) \ CHECK_ARCH_EXT; \ - if (TEST_MATHVEC && !HAVE_VECTOR (FUNC (FUN))) return; \ const char *this_func = STR_CON3 (FUN, SUFF, VEC_SUFF); \ init_max_error (this_func, EXACT) #define END \ diff --git a/math/libm-test-erf.inc b/math/libm-test-erf.inc index 20a389ec5a..bcc96e5e6c 100644 --- a/math/libm-test-erf.inc +++ b/math/libm-test-erf.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_f_f_data erf_test_data[] = { TEST_f_f (erf, plus_infty, 1, ERRNO_UNCHANGED), @@ -34,6 +36,12 @@ erf_test (void) ALL_RM_TEST (erf, 0, erf_test_data, RUN_TEST_LOOP_f_f, END); } +static void +do_test (void) +{ + erf_test (); +} + /* * Local Variables: * mode:c diff --git a/math/libm-test-erfc.inc b/math/libm-test-erfc.inc index ed6190e05d..7018eb34d7 100644 --- a/math/libm-test-erfc.inc +++ b/math/libm-test-erfc.inc @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include "libm-test-driver.c" + static const struct test_f_f_data erfc_test_data[] = { TEST_f_f (erfc, plus_infty, 0.0, ERRNO_UNCHANGED), @@ -32,6 +34,12 @@ erfc_test (void) ALL_RM_TEST (erfc, 0, erfc_test_data, RUN_TEST_LOOP_f_f, END); } +static void +do_test (void) +