xref: /freebsd/lib/msun/tests/Makefile (revision e9ac41698b2f322d55ccf9da50a3596edb2c1800)
147754aa2SEnji Cooper.include <bsd.own.mk>
247754aa2SEnji Cooper
34cef7be5SEnji CooperTESTSRC=	${SRCTOP}/contrib/netbsd-tests/lib/libm
44cef7be5SEnji Cooper
5b18bade8SEnji Cooper# All architectures on FreeBSD have fenv.h
64cef7be5SEnji CooperCFLAGS+=	-DHAVE_FENV_H
74cef7be5SEnji Cooper
809797f9dSEnji Cooper# For isqemu.h
909797f9dSEnji CooperCFLAGS+=	-I${TESTSRC:H}/libc/gen
1009797f9dSEnji Cooper
112d143336SMitchell Horne# Define __HAVE_LONG_DOUBLE for architectures whose long double has greater
122d143336SMitchell Horne# precision than their double.
132dac22dcSAndrew Turner.if ${MACHINE_CPUARCH} == "aarch64" || \
142dac22dcSAndrew Turner    ${MACHINE_CPUARCH} == "amd64" || \
152d143336SMitchell Horne    ${MACHINE_CPUARCH} == "i386" || \
162d143336SMitchell Horne    ${MACHINE_CPUARCH} == "riscv"
174cef7be5SEnji CooperCFLAGS+=	-D__HAVE_LONG_DOUBLE
184cef7be5SEnji Cooper.endif
194cef7be5SEnji Cooper
20cf97d2a1SDimitry Andric# Avoid builtins, to force the compiler to emit calls to the libm
21cf97d2a1SDimitry Andric# functions, and not calculate any results in advance.
22cf97d2a1SDimitry AndricCFLAGS+=        -fno-builtin
23cf97d2a1SDimitry Andric
244cef7be5SEnji CooperNETBSD_ATF_TESTS_C=	acos_test
254cef7be5SEnji CooperNETBSD_ATF_TESTS_C+=	asin_test
264cef7be5SEnji CooperNETBSD_ATF_TESTS_C+=	atan_test
271ec3feb6SAlex RichardsonNETBSD_ATF_TESTS_C+=	bit_test
281ec3feb6SAlex Richardson# TODO: NETBSD_ATF_TESTS_CXX+=	cabsl_test
294cef7be5SEnji CooperNETBSD_ATF_TESTS_C+=	cbrt_test
304cef7be5SEnji CooperNETBSD_ATF_TESTS_C+=	ceil_test
31cdebaff8SEnji CooperNETBSD_ATF_TESTS_C+=	casinh_test
324cef7be5SEnji CooperNETBSD_ATF_TESTS_C+=	cos_test
334cef7be5SEnji CooperNETBSD_ATF_TESTS_C+=	cosh_test
344cef7be5SEnji CooperNETBSD_ATF_TESTS_C+=	erf_test
354cef7be5SEnji CooperNETBSD_ATF_TESTS_C+=	exp_test
364cef7be5SEnji CooperNETBSD_ATF_TESTS_C+=	fmod_test
37cdebaff8SEnji CooperNETBSD_ATF_TESTS_C+=	fe_round_test
38d3338f33SDimitry AndricNETBSD_ATF_TESTS_C+=	hypot_test
394cef7be5SEnji CooperNETBSD_ATF_TESTS_C+=	infinity_test
40cdebaff8SEnji CooperNETBSD_ATF_TESTS_C+=	ilogb_test
414cef7be5SEnji CooperNETBSD_ATF_TESTS_C+=	ldexp_test
424cef7be5SEnji CooperNETBSD_ATF_TESTS_C+=	log_test
434cef7be5SEnji CooperNETBSD_ATF_TESTS_C+=	pow_test
444cef7be5SEnji CooperNETBSD_ATF_TESTS_C+=	precision_test
454cef7be5SEnji CooperNETBSD_ATF_TESTS_C+=	round_test
464cef7be5SEnji CooperNETBSD_ATF_TESTS_C+=	scalbn_test
474cef7be5SEnji CooperNETBSD_ATF_TESTS_C+=	sin_test
484cef7be5SEnji CooperNETBSD_ATF_TESTS_C+=	sinh_test
494cef7be5SEnji CooperNETBSD_ATF_TESTS_C+=	sqrt_test
504cef7be5SEnji CooperNETBSD_ATF_TESTS_C+=	tan_test
514cef7be5SEnji CooperNETBSD_ATF_TESTS_C+=	tanh_test
524cef7be5SEnji Cooper
53133bc645SAlex RichardsonATF_TESTS_C+=	cexp_test
54133bc645SAlex RichardsonATF_TESTS_C+=	conj_test
55133bc645SAlex RichardsonATF_TESTS_C+=	csqrt_test
565c472818SEnji CooperATF_TESTS_C+=	ctrig_test
57133bc645SAlex RichardsonATF_TESTS_C+=	exponential_test
58133bc645SAlex RichardsonATF_TESTS_C+=	fenv_test
59133bc645SAlex RichardsonATF_TESTS_C+=	fma_test
60133bc645SAlex RichardsonATF_TESTS_C+=	fmaxmin_test
61133bc645SAlex RichardsonATF_TESTS_C+=	ilogb2_test
62133bc645SAlex RichardsonATF_TESTS_C+=	invtrig_test
63133bc645SAlex RichardsonATF_TESTS_C+=	invctrig_test
64133bc645SAlex RichardsonATF_TESTS_C+=	logarithm_test
65133bc645SAlex RichardsonATF_TESTS_C+=	lrint_test
66133bc645SAlex RichardsonATF_TESTS_C+=	lround_test
67133bc645SAlex RichardsonATF_TESTS_C+=	nan_test
68133bc645SAlex RichardsonATF_TESTS_C+=	nearbyint_test
69133bc645SAlex RichardsonATF_TESTS_C+=	next_test
70133bc645SAlex RichardsonATF_TESTS_C+=	rem_test
714580a78eSEnji CooperATF_TESTS_C+=	trig_test
724dc607e7SEnji Cooper
73306c3c4dSEnji Cooper.if !empty(PROG) && !empty(TAP_TESTS_C:M${PROG})
74306c3c4dSEnji CooperCFLAGS+=	-O0
75306c3c4dSEnji Cooper.endif
764dc607e7SEnji Cooper
774cef7be5SEnji Cooper#COPTS+=	-Wfloat-equal
784cef7be5SEnji Cooper
794dc607e7SEnji CooperIGNORE_PRAGMA=
804dc607e7SEnji Cooper
81cdebaff8SEnji CooperSRCS.ilogb2_test=	ilogb_test.c
82cdebaff8SEnji Cooper
836ccdee8aSAlex RichardsonLIBADD.fenv_test+=	util
844dc607e7SEnji CooperLIBADD+=	m
854dc607e7SEnji Cooper
864cef7be5SEnji Cooper# Copied from lib/msun/Makefile
874cef7be5SEnji Cooper.if ${MACHINE_CPUARCH} == "i386"
884cef7be5SEnji CooperARCH_SUBDIR= i387
894cef7be5SEnji Cooper.else
904cef7be5SEnji CooperARCH_SUBDIR= ${MACHINE_CPUARCH}
914cef7be5SEnji Cooper.endif
924cef7be5SEnji Cooper
934cef7be5SEnji Cooper.include "../${ARCH_SUBDIR}/Makefile.inc"
944cef7be5SEnji Cooper
954cef7be5SEnji Cooper# XXX: for some odd reason float.h doesn't tell the full story about what the
964cef7be5SEnji Cooper# precision is.
974cef7be5SEnji CooperCFLAGS+=	-DLDBL_PREC=${LDBL_PREC}
984cef7be5SEnji Cooper
9924612bfdSLi-Wen HsuCFLAGS.fe_round_test+=	-D__HAVE_FENV
10024612bfdSLi-Wen Hsu
101*168234faSAlex Richardson.include <bsd.compiler.mk>
102*168234faSAlex Richardson.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 120000
103*168234faSAlex Richardson# Silence '#pragma FENV_ACCESS' is not supported on this target - ignored
104*168234faSAlex RichardsonCWARNFLAGS+=	-Wno-error=ignored-pragmas
105*168234faSAlex Richardson.endif
106*168234faSAlex Richardson
1074cef7be5SEnji Cooper.include <netbsd-tests.test.mk>
1084cef7be5SEnji Cooper
1094cef7be5SEnji Cooper.include <bsd.test.mk>
110