xref: /minix3/tests/lib/libc/gen/t_fpsetmask.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc /*	$NetBSD: t_fpsetmask.c,v 1.15 2014/11/18 08:58:08 martin Exp $ */
211be35a1SLionel Sambuc 
311be35a1SLionel Sambuc /*-
411be35a1SLionel Sambuc  * Copyright (c) 1995 The NetBSD Foundation, Inc.
511be35a1SLionel Sambuc  * All rights reserved.
611be35a1SLionel Sambuc  *
711be35a1SLionel Sambuc  * Redistribution and use in source and binary forms, with or without
811be35a1SLionel Sambuc  * modification, are permitted provided that the following conditions
911be35a1SLionel Sambuc  * are met:
1011be35a1SLionel Sambuc  * 1. Redistributions of source code must retain the above copyright
1111be35a1SLionel Sambuc  *    notice, this list of conditions and the following disclaimer.
1211be35a1SLionel Sambuc  * 2. Redistributions in binary form must reproduce the above copyright
1311be35a1SLionel Sambuc  *    notice, this list of conditions and the following disclaimer in the
1411be35a1SLionel Sambuc  *    documentation and/or other materials provided with the distribution.
1511be35a1SLionel Sambuc  *
1611be35a1SLionel Sambuc  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
1711be35a1SLionel Sambuc  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
1811be35a1SLionel Sambuc  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1911be35a1SLionel Sambuc  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
2011be35a1SLionel Sambuc  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2111be35a1SLionel Sambuc  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2211be35a1SLionel Sambuc  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2311be35a1SLionel Sambuc  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2411be35a1SLionel Sambuc  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2511be35a1SLionel Sambuc  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2611be35a1SLionel Sambuc  * POSSIBILITY OF SUCH DAMAGE.
2711be35a1SLionel Sambuc  */
2811be35a1SLionel Sambuc 
29*0a6a1f1dSLionel Sambuc #include <sys/param.h>
30*0a6a1f1dSLionel Sambuc 
3111be35a1SLionel Sambuc #include <atf-c.h>
3211be35a1SLionel Sambuc 
3311be35a1SLionel Sambuc #include <stdio.h>
3411be35a1SLionel Sambuc #include <signal.h>
3511be35a1SLionel Sambuc #include <float.h>
3611be35a1SLionel Sambuc #include <setjmp.h>
3711be35a1SLionel Sambuc #include <stdlib.h>
3811be35a1SLionel Sambuc #include <string.h>
3911be35a1SLionel Sambuc 
4011be35a1SLionel Sambuc #include "isqemu.h"
4111be35a1SLionel Sambuc 
4211be35a1SLionel Sambuc #ifndef _FLOAT_IEEE754
4311be35a1SLionel Sambuc 
4411be35a1SLionel Sambuc ATF_TC(no_test);
ATF_TC_HEAD(no_test,tc)4511be35a1SLionel Sambuc ATF_TC_HEAD(no_test, tc)
4611be35a1SLionel Sambuc {
4711be35a1SLionel Sambuc 
4811be35a1SLionel Sambuc 	atf_tc_set_md_var(tc, "descr", "Dummy test case");
4911be35a1SLionel Sambuc }
5011be35a1SLionel Sambuc 
ATF_TC_BODY(no_test,tc)5111be35a1SLionel Sambuc ATF_TC_BODY(no_test, tc)
5211be35a1SLionel Sambuc {
5311be35a1SLionel Sambuc 
5411be35a1SLionel Sambuc 	atf_tc_skip("Test not available on this architecture.");
5511be35a1SLionel Sambuc }
5611be35a1SLionel Sambuc 
5711be35a1SLionel Sambuc #else /* defined(_FLOAT_IEEE754) */
5811be35a1SLionel Sambuc 
5911be35a1SLionel Sambuc #include <ieeefp.h>
6011be35a1SLionel Sambuc 
61*0a6a1f1dSLionel Sambuc #if __arm__ && !__SOFTFP__
62*0a6a1f1dSLionel Sambuc 	/*
63*0a6a1f1dSLionel Sambuc 	 * Some NEON fpus do not implement IEEE exception handling,
64*0a6a1f1dSLionel Sambuc 	 * skip these tests if running on them and compiled for
65*0a6a1f1dSLionel Sambuc 	 * hard float.
66*0a6a1f1dSLionel Sambuc 	 */
67*0a6a1f1dSLionel Sambuc #define	FPU_PREREQ()							\
68*0a6a1f1dSLionel Sambuc 	if (0 == fpsetmask(fpsetmask(FP_X_INV)))			\
69*0a6a1f1dSLionel Sambuc 		atf_tc_skip("FPU does not implement exception handling");
70*0a6a1f1dSLionel Sambuc #endif
71*0a6a1f1dSLionel Sambuc 
72*0a6a1f1dSLionel Sambuc #ifndef FPU_PREREQ
73*0a6a1f1dSLionel Sambuc #define	FPU_PREREQ()	/* nothing */
74*0a6a1f1dSLionel Sambuc #endif
7511be35a1SLionel Sambuc 
7611be35a1SLionel Sambuc void		sigfpe(int, siginfo_t *, void *);
7711be35a1SLionel Sambuc 
7811be35a1SLionel Sambuc volatile sig_atomic_t signal_caught;
7911be35a1SLionel Sambuc volatile int sicode;
8011be35a1SLionel Sambuc 
8111be35a1SLionel Sambuc static volatile const float	f_one   = 1.0;
8211be35a1SLionel Sambuc static volatile const float	f_zero  = 0.0;
8311be35a1SLionel Sambuc static volatile const double	d_one   = 1.0;
8411be35a1SLionel Sambuc static volatile const double	d_zero  = 0.0;
8511be35a1SLionel Sambuc static volatile const long double ld_one  = 1.0;
8611be35a1SLionel Sambuc static volatile const long double ld_zero = 0.0;
8711be35a1SLionel Sambuc 
8811be35a1SLionel Sambuc static volatile const float	f_huge = FLT_MAX;
8911be35a1SLionel Sambuc static volatile const float	f_tiny = FLT_MIN;
9011be35a1SLionel Sambuc static volatile const double	d_huge = DBL_MAX;
9111be35a1SLionel Sambuc static volatile const double	d_tiny = DBL_MIN;
9211be35a1SLionel Sambuc static volatile const long double ld_huge = LDBL_MAX;
9311be35a1SLionel Sambuc static volatile const long double ld_tiny = LDBL_MIN;
9411be35a1SLionel Sambuc 
9511be35a1SLionel Sambuc static volatile float f_x;
9611be35a1SLionel Sambuc static volatile double d_x;
9711be35a1SLionel Sambuc static volatile long double ld_x;
9811be35a1SLionel Sambuc 
9911be35a1SLionel Sambuc /* trip divide by zero */
10011be35a1SLionel Sambuc static void
f_dz(void)10111be35a1SLionel Sambuc f_dz(void)
10211be35a1SLionel Sambuc {
10311be35a1SLionel Sambuc 
10411be35a1SLionel Sambuc 	f_x = f_one / f_zero;
10511be35a1SLionel Sambuc }
10611be35a1SLionel Sambuc 
10711be35a1SLionel Sambuc static void
d_dz(void)10811be35a1SLionel Sambuc d_dz(void)
10911be35a1SLionel Sambuc {
11011be35a1SLionel Sambuc 
11111be35a1SLionel Sambuc 	d_x = d_one / d_zero;
11211be35a1SLionel Sambuc }
11311be35a1SLionel Sambuc 
11411be35a1SLionel Sambuc static void
ld_dz(void)11511be35a1SLionel Sambuc ld_dz(void)
11611be35a1SLionel Sambuc {
11711be35a1SLionel Sambuc 
11811be35a1SLionel Sambuc 	ld_x = ld_one / ld_zero;
11911be35a1SLionel Sambuc }
12011be35a1SLionel Sambuc 
12111be35a1SLionel Sambuc /* trip invalid operation */
12211be35a1SLionel Sambuc static void
d_inv(void)12311be35a1SLionel Sambuc d_inv(void)
12411be35a1SLionel Sambuc {
12511be35a1SLionel Sambuc 
12611be35a1SLionel Sambuc 	d_x = d_zero / d_zero;
12711be35a1SLionel Sambuc }
12811be35a1SLionel Sambuc 
12911be35a1SLionel Sambuc static void
ld_inv(void)13011be35a1SLionel Sambuc ld_inv(void)
13111be35a1SLionel Sambuc {
13211be35a1SLionel Sambuc 
13311be35a1SLionel Sambuc 	ld_x = ld_zero / ld_zero;
13411be35a1SLionel Sambuc }
13511be35a1SLionel Sambuc 
13611be35a1SLionel Sambuc static void
f_inv(void)13711be35a1SLionel Sambuc f_inv(void)
13811be35a1SLionel Sambuc {
13911be35a1SLionel Sambuc 
14011be35a1SLionel Sambuc 	f_x = f_zero / f_zero;
14111be35a1SLionel Sambuc }
14211be35a1SLionel Sambuc 
14311be35a1SLionel Sambuc /* trip overflow */
14411be35a1SLionel Sambuc static void
f_ofl(void)14511be35a1SLionel Sambuc f_ofl(void)
14611be35a1SLionel Sambuc {
14711be35a1SLionel Sambuc 
14811be35a1SLionel Sambuc 	f_x = f_huge * f_huge;
14911be35a1SLionel Sambuc }
15011be35a1SLionel Sambuc 
15111be35a1SLionel Sambuc static void
d_ofl(void)15211be35a1SLionel Sambuc d_ofl(void)
15311be35a1SLionel Sambuc {
15411be35a1SLionel Sambuc 
15511be35a1SLionel Sambuc 	d_x = d_huge * d_huge;
15611be35a1SLionel Sambuc }
15711be35a1SLionel Sambuc 
15811be35a1SLionel Sambuc static void
ld_ofl(void)15911be35a1SLionel Sambuc ld_ofl(void)
16011be35a1SLionel Sambuc {
16111be35a1SLionel Sambuc 
16211be35a1SLionel Sambuc 	ld_x = ld_huge * ld_huge;
16311be35a1SLionel Sambuc }
16411be35a1SLionel Sambuc 
16511be35a1SLionel Sambuc /* trip underflow */
16611be35a1SLionel Sambuc static void
f_ufl(void)16711be35a1SLionel Sambuc f_ufl(void)
16811be35a1SLionel Sambuc {
16911be35a1SLionel Sambuc 
17011be35a1SLionel Sambuc 	f_x = f_tiny * f_tiny;
17111be35a1SLionel Sambuc }
17211be35a1SLionel Sambuc 
17311be35a1SLionel Sambuc static void
d_ufl(void)17411be35a1SLionel Sambuc d_ufl(void)
17511be35a1SLionel Sambuc {
17611be35a1SLionel Sambuc 
17711be35a1SLionel Sambuc 	d_x = d_tiny * d_tiny;
17811be35a1SLionel Sambuc }
17911be35a1SLionel Sambuc 
18011be35a1SLionel Sambuc static void
ld_ufl(void)18111be35a1SLionel Sambuc ld_ufl(void)
18211be35a1SLionel Sambuc {
18311be35a1SLionel Sambuc 
18411be35a1SLionel Sambuc 	ld_x = ld_tiny * ld_tiny;
18511be35a1SLionel Sambuc }
18611be35a1SLionel Sambuc 
18711be35a1SLionel Sambuc struct ops {
18811be35a1SLionel Sambuc 	void (*op)(void);
18911be35a1SLionel Sambuc 	fp_except mask;
19011be35a1SLionel Sambuc 	int sicode;
19111be35a1SLionel Sambuc };
19211be35a1SLionel Sambuc 
19311be35a1SLionel Sambuc static const struct ops float_ops[] = {
19411be35a1SLionel Sambuc 	{ f_dz, FP_X_DZ, FPE_FLTDIV },
19511be35a1SLionel Sambuc 	{ f_inv, FP_X_INV, FPE_FLTINV },
19611be35a1SLionel Sambuc 	{ f_ofl, FP_X_OFL, FPE_FLTOVF },
19711be35a1SLionel Sambuc 	{ f_ufl, FP_X_UFL, FPE_FLTUND },
19811be35a1SLionel Sambuc 	{ NULL, 0, 0 }
19911be35a1SLionel Sambuc };
20011be35a1SLionel Sambuc 
20111be35a1SLionel Sambuc static const struct ops double_ops[] = {
20211be35a1SLionel Sambuc 	{ d_dz, FP_X_DZ, FPE_FLTDIV },
20311be35a1SLionel Sambuc 	{ d_inv, FP_X_INV, FPE_FLTINV },
20411be35a1SLionel Sambuc 	{ d_ofl, FP_X_OFL, FPE_FLTOVF },
20511be35a1SLionel Sambuc 	{ d_ufl, FP_X_UFL, FPE_FLTUND },
20611be35a1SLionel Sambuc 	{ NULL, 0, 0 }
20711be35a1SLionel Sambuc };
20811be35a1SLionel Sambuc 
20911be35a1SLionel Sambuc static const struct ops long_double_ops[] = {
21011be35a1SLionel Sambuc 	{ ld_dz, FP_X_DZ, FPE_FLTDIV },
21111be35a1SLionel Sambuc 	{ ld_inv, FP_X_INV, FPE_FLTINV },
21211be35a1SLionel Sambuc 	{ ld_ofl, FP_X_OFL, FPE_FLTOVF },
21311be35a1SLionel Sambuc 	{ ld_ufl, FP_X_UFL, FPE_FLTUND },
21411be35a1SLionel Sambuc 	{ NULL, 0, 0 }
21511be35a1SLionel Sambuc };
21611be35a1SLionel Sambuc 
21711be35a1SLionel Sambuc static sigjmp_buf b;
21811be35a1SLionel Sambuc 
21911be35a1SLionel Sambuc static void
fpsetmask_masked(const struct ops * test_ops)22011be35a1SLionel Sambuc fpsetmask_masked(const struct ops *test_ops)
22111be35a1SLionel Sambuc {
22211be35a1SLionel Sambuc 	struct sigaction sa;
22311be35a1SLionel Sambuc 	fp_except ex1, ex2;
22411be35a1SLionel Sambuc 	const struct ops *t;
22511be35a1SLionel Sambuc 
22611be35a1SLionel Sambuc 	/* mask all exceptions, clear history */
22711be35a1SLionel Sambuc 	fpsetmask(0);
22811be35a1SLionel Sambuc 	fpsetsticky(0);
22911be35a1SLionel Sambuc 
23011be35a1SLionel Sambuc 	/* set up signal handler */
23111be35a1SLionel Sambuc 	sa.sa_sigaction = sigfpe;
23211be35a1SLionel Sambuc 	sigemptyset(&sa.sa_mask);
23311be35a1SLionel Sambuc 	sa.sa_flags = SA_SIGINFO;
23411be35a1SLionel Sambuc 	sigaction(SIGFPE, &sa, 0);
23511be35a1SLionel Sambuc 	signal_caught = 0;
23611be35a1SLionel Sambuc 
23711be35a1SLionel Sambuc 	/*
23811be35a1SLionel Sambuc 	 * exceptions masked, check whether "sticky" bits are set correctly
23911be35a1SLionel Sambuc 	 */
24011be35a1SLionel Sambuc 	for (t = test_ops; t->op != NULL; t++) {
24111be35a1SLionel Sambuc 		(*t->op)();
24211be35a1SLionel Sambuc 		ex1 = fpgetsticky();
24311be35a1SLionel Sambuc 		ATF_CHECK_EQ(ex1 & t->mask, t->mask);
24411be35a1SLionel Sambuc 		ATF_CHECK_EQ(signal_caught, 0);
24511be35a1SLionel Sambuc 
24611be35a1SLionel Sambuc 		/* check correct fpsetsticky() behaviour */
24711be35a1SLionel Sambuc 		ex2 = fpsetsticky(0);
24811be35a1SLionel Sambuc 		ATF_CHECK_EQ(fpgetsticky(), 0);
24911be35a1SLionel Sambuc 		ATF_CHECK_EQ(ex1, ex2);
25011be35a1SLionel Sambuc 	}
25111be35a1SLionel Sambuc }
25211be35a1SLionel Sambuc 
25311be35a1SLionel Sambuc /* force delayed exceptions to be delivered */
25411be35a1SLionel Sambuc #define BARRIER() fpsetmask(0); f_x = f_one * f_one
25511be35a1SLionel Sambuc 
25611be35a1SLionel Sambuc static void
fpsetmask_unmasked(const struct ops * test_ops)25711be35a1SLionel Sambuc fpsetmask_unmasked(const struct ops *test_ops)
25811be35a1SLionel Sambuc {
25911be35a1SLionel Sambuc 	struct sigaction sa;
26011be35a1SLionel Sambuc 	int r;
26111be35a1SLionel Sambuc 	const struct ops *volatile t;
26211be35a1SLionel Sambuc 
26311be35a1SLionel Sambuc 	/* mask all exceptions, clear history */
26411be35a1SLionel Sambuc 	fpsetmask(0);
26511be35a1SLionel Sambuc 	fpsetsticky(0);
26611be35a1SLionel Sambuc 
26711be35a1SLionel Sambuc 	/* set up signal handler */
26811be35a1SLionel Sambuc 	sa.sa_sigaction = sigfpe;
26911be35a1SLionel Sambuc 	sigemptyset(&sa.sa_mask);
27011be35a1SLionel Sambuc 	sa.sa_flags = SA_SIGINFO;
27111be35a1SLionel Sambuc 	sigaction(SIGFPE, &sa, 0);
27211be35a1SLionel Sambuc 	signal_caught = 0;
27311be35a1SLionel Sambuc 
27411be35a1SLionel Sambuc 	/*
27511be35a1SLionel Sambuc 	 * exception unmasked, check SIGFPE delivery and correct siginfo
27611be35a1SLionel Sambuc 	 */
27711be35a1SLionel Sambuc 	for (t = test_ops; t->op != NULL; t++) {
27811be35a1SLionel Sambuc 		fpsetmask(t->mask);
27911be35a1SLionel Sambuc 		r = sigsetjmp(b, 1);
28011be35a1SLionel Sambuc 		if (!r) {
28111be35a1SLionel Sambuc 			(*t->op)();
28211be35a1SLionel Sambuc 			BARRIER();
28311be35a1SLionel Sambuc 		}
28411be35a1SLionel Sambuc 		ATF_CHECK_EQ(signal_caught, 1);
28511be35a1SLionel Sambuc 		ATF_CHECK_EQ(sicode, t->sicode);
28611be35a1SLionel Sambuc 		signal_caught = 0;
28711be35a1SLionel Sambuc 	}
28811be35a1SLionel Sambuc }
28911be35a1SLionel Sambuc 
29011be35a1SLionel Sambuc void
sigfpe(int s,siginfo_t * si,void * c)29111be35a1SLionel Sambuc sigfpe(int s, siginfo_t *si, void *c)
29211be35a1SLionel Sambuc {
29311be35a1SLionel Sambuc 	signal_caught = 1;
29411be35a1SLionel Sambuc 	sicode = si->si_code;
29511be35a1SLionel Sambuc 	siglongjmp(b, 1);
29611be35a1SLionel Sambuc }
29711be35a1SLionel Sambuc 
29811be35a1SLionel Sambuc #define TEST(m, t)							\
29911be35a1SLionel Sambuc 	ATF_TC(m##_##t);						\
30011be35a1SLionel Sambuc 									\
30111be35a1SLionel Sambuc 	ATF_TC_HEAD(m##_##t, tc)					\
30211be35a1SLionel Sambuc 	{								\
30311be35a1SLionel Sambuc 									\
30411be35a1SLionel Sambuc 		atf_tc_set_md_var(tc, "descr",				\
30511be35a1SLionel Sambuc 		    "Test " ___STRING(m) " exceptions for "		\
30611be35a1SLionel Sambuc 		    ___STRING(t) "values");				\
30711be35a1SLionel Sambuc 	}								\
30811be35a1SLionel Sambuc 									\
30911be35a1SLionel Sambuc 	ATF_TC_BODY(m##_##t, tc)					\
31011be35a1SLionel Sambuc 	{								\
311*0a6a1f1dSLionel Sambuc 									\
312*0a6a1f1dSLionel Sambuc 		FPU_PREREQ();						\
313*0a6a1f1dSLionel Sambuc 									\
314*0a6a1f1dSLionel Sambuc 		if (strcmp(MACHINE, "macppc") == 0)			\
31511be35a1SLionel Sambuc 			atf_tc_expect_fail("PR port-macppc/46319");	\
31611be35a1SLionel Sambuc 									\
31711be35a1SLionel Sambuc 		if (isQEMU())						\
31811be35a1SLionel Sambuc 			atf_tc_expect_fail("PR misc/44767");		\
31911be35a1SLionel Sambuc 									\
32011be35a1SLionel Sambuc 		m(t##_ops);						\
32111be35a1SLionel Sambuc 	}
32211be35a1SLionel Sambuc 
32311be35a1SLionel Sambuc TEST(fpsetmask_masked, float)
32411be35a1SLionel Sambuc TEST(fpsetmask_masked, double)
32511be35a1SLionel Sambuc TEST(fpsetmask_masked, long_double)
32611be35a1SLionel Sambuc TEST(fpsetmask_unmasked, float)
32711be35a1SLionel Sambuc TEST(fpsetmask_unmasked, double)
32811be35a1SLionel Sambuc TEST(fpsetmask_unmasked, long_double)
32911be35a1SLionel Sambuc 
33011be35a1SLionel Sambuc ATF_TC(fpsetmask_basic);
ATF_TC_HEAD(fpsetmask_basic,tc)33111be35a1SLionel Sambuc ATF_TC_HEAD(fpsetmask_basic, tc)
33211be35a1SLionel Sambuc {
33311be35a1SLionel Sambuc 	atf_tc_set_md_var(tc, "descr", "A basic test of fpsetmask(3)");
33411be35a1SLionel Sambuc }
33511be35a1SLionel Sambuc 
ATF_TC_BODY(fpsetmask_basic,tc)33611be35a1SLionel Sambuc ATF_TC_BODY(fpsetmask_basic, tc)
33711be35a1SLionel Sambuc {
33811be35a1SLionel Sambuc 	size_t i;
33911be35a1SLionel Sambuc 	fp_except_t msk, lst[] = { FP_X_INV, FP_X_DZ, FP_X_OFL, FP_X_UFL };
34011be35a1SLionel Sambuc 
341*0a6a1f1dSLionel Sambuc 	FPU_PREREQ();
342*0a6a1f1dSLionel Sambuc 
34311be35a1SLionel Sambuc 	msk = fpgetmask();
34411be35a1SLionel Sambuc 	for (i = 0; i < __arraycount(lst); i++) {
34511be35a1SLionel Sambuc 		fpsetmask(msk | lst[i]);
34611be35a1SLionel Sambuc 		ATF_CHECK((fpgetmask() & lst[i]) != 0);
34711be35a1SLionel Sambuc 		fpsetmask(msk & lst[i]);
34811be35a1SLionel Sambuc 		ATF_CHECK((fpgetmask() & lst[i]) == 0);
34911be35a1SLionel Sambuc 	}
35011be35a1SLionel Sambuc 
35111be35a1SLionel Sambuc }
35211be35a1SLionel Sambuc 
35311be35a1SLionel Sambuc #endif /* defined(_FLOAT_IEEE754) */
35411be35a1SLionel Sambuc 
ATF_TP_ADD_TCS(tp)35511be35a1SLionel Sambuc ATF_TP_ADD_TCS(tp)
35611be35a1SLionel Sambuc {
35711be35a1SLionel Sambuc 
35811be35a1SLionel Sambuc #ifndef _FLOAT_IEEE754
35911be35a1SLionel Sambuc 	ATF_TP_ADD_TC(tp, no_test);
36011be35a1SLionel Sambuc #else
36111be35a1SLionel Sambuc 	ATF_TP_ADD_TC(tp, fpsetmask_basic);
36211be35a1SLionel Sambuc 	ATF_TP_ADD_TC(tp, fpsetmask_masked_float);
36311be35a1SLionel Sambuc 	ATF_TP_ADD_TC(tp, fpsetmask_masked_double);
36411be35a1SLionel Sambuc 	ATF_TP_ADD_TC(tp, fpsetmask_masked_long_double);
36511be35a1SLionel Sambuc 	ATF_TP_ADD_TC(tp, fpsetmask_unmasked_float);
36611be35a1SLionel Sambuc 	ATF_TP_ADD_TC(tp, fpsetmask_unmasked_double);
36711be35a1SLionel Sambuc 	ATF_TP_ADD_TC(tp, fpsetmask_unmasked_long_double);
36811be35a1SLionel Sambuc #endif
36911be35a1SLionel Sambuc 
37011be35a1SLionel Sambuc 	return atf_no_error();
37111be35a1SLionel Sambuc }
372