1.include <bsd.own.mk> 2 3TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libm 4 5# All architectures on FreeBSD have fenv.h 6CFLAGS+= -DHAVE_FENV_H 7 8# For isqemu.h 9CFLAGS+= -I${TESTSRC:H}/libc/gen 10 11# Define __HAVE_LONG_DOUBLE for architectures whose long double has greater 12# precision than their double. 13.if ${MACHINE_CPUARCH} == "aarch64" || \ 14 ${MACHINE_CPUARCH} == "amd64" || \ 15 ${MACHINE_CPUARCH} == "i386" || \ 16 ${MACHINE_CPUARCH} == "riscv" 17CFLAGS+= -D__HAVE_LONG_DOUBLE 18.endif 19 20# Avoid builtins, to force the compiler to emit calls to the libm 21# functions, and not calculate any results in advance. 22CFLAGS+= -fno-builtin 23 24NETBSD_ATF_TESTS_C= acos_test 25NETBSD_ATF_TESTS_C+= asin_test 26NETBSD_ATF_TESTS_C+= atan_test 27NETBSD_ATF_TESTS_C+= bit_test 28# TODO: NETBSD_ATF_TESTS_CXX+= cabsl_test 29NETBSD_ATF_TESTS_C+= cbrt_test 30NETBSD_ATF_TESTS_C+= ceil_test 31NETBSD_ATF_TESTS_C+= casinh_test 32NETBSD_ATF_TESTS_C+= cos_test 33NETBSD_ATF_TESTS_C+= cosh_test 34NETBSD_ATF_TESTS_C+= erf_test 35NETBSD_ATF_TESTS_C+= exp_test 36NETBSD_ATF_TESTS_C+= fmod_test 37NETBSD_ATF_TESTS_C+= fe_round_test 38NETBSD_ATF_TESTS_C+= hypot_test 39NETBSD_ATF_TESTS_C+= infinity_test 40NETBSD_ATF_TESTS_C+= ilogb_test 41NETBSD_ATF_TESTS_C+= ldexp_test 42NETBSD_ATF_TESTS_C+= log_test 43NETBSD_ATF_TESTS_C+= pow_test 44NETBSD_ATF_TESTS_C+= precision_test 45NETBSD_ATF_TESTS_C+= round_test 46NETBSD_ATF_TESTS_C+= scalbn_test 47NETBSD_ATF_TESTS_C+= sin_test 48NETBSD_ATF_TESTS_C+= sinh_test 49NETBSD_ATF_TESTS_C+= sqrt_test 50NETBSD_ATF_TESTS_C+= tan_test 51NETBSD_ATF_TESTS_C+= tanh_test 52 53ATF_TESTS_C+= cexp_test 54ATF_TESTS_C+= conj_test 55ATF_TESTS_C+= csqrt_test 56ATF_TESTS_C+= ctrig_test 57ATF_TESTS_C+= exponential_test 58ATF_TESTS_C+= fenv_test 59ATF_TESTS_C+= fma_test 60ATF_TESTS_C+= fmaxmin_test 61ATF_TESTS_C+= ilogb2_test 62ATF_TESTS_C+= invtrig_test 63ATF_TESTS_C+= invctrig_test 64ATF_TESTS_C+= logarithm_test 65ATF_TESTS_C+= lrint_test 66ATF_TESTS_C+= lround_test 67ATF_TESTS_C+= nan_test 68ATF_TESTS_C+= nearbyint_test 69ATF_TESTS_C+= next_test 70ATF_TESTS_C+= rem_test 71ATF_TESTS_C+= trig_test 72 73.if !empty(PROG) && !empty(TAP_TESTS_C:M${PROG}) 74CFLAGS+= -O0 75.endif 76 77#COPTS+= -Wfloat-equal 78 79IGNORE_PRAGMA= 80 81SRCS.ilogb2_test= ilogb_test.c 82 83LIBADD.fenv_test+= util 84LIBADD+= m 85 86# Copied from lib/msun/Makefile 87.if ${MACHINE_CPUARCH} == "i386" 88ARCH_SUBDIR= i387 89.else 90ARCH_SUBDIR= ${MACHINE_CPUARCH} 91.endif 92 93.include "../${ARCH_SUBDIR}/Makefile.inc" 94 95# XXX: for some odd reason float.h doesn't tell the full story about what the 96# precision is. 97CFLAGS+= -DLDBL_PREC=${LDBL_PREC} 98 99CFLAGS.fe_round_test+= -D__HAVE_FENV 100 101.include <bsd.compiler.mk> 102.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 120000 103# Silence '#pragma FENV_ACCESS' is not supported on this target - ignored 104CWARNFLAGS+= -Wno-error=ignored-pragmas 105.endif 106 107.include <netbsd-tests.test.mk> 108 109.include <bsd.test.mk> 110