xref: /netbsd-src/tests/lib/libc/stdlib/t_strtod.c (revision 15e7a2e7f16378fda749ce6290a959c332b25cce)
1*15e7a2e7Srillig /*	$NetBSD: t_strtod.c,v 1.37 2024/06/15 12:20:22 rillig Exp $ */
2e1481082Sjruoho 
3e1481082Sjruoho /*-
4e1481082Sjruoho  * Copyright (c) 2011 The NetBSD Foundation, Inc.
5e1481082Sjruoho  * All rights reserved.
6e1481082Sjruoho  *
7e1481082Sjruoho  * This code is derived from software contributed to The NetBSD Foundation
8e1481082Sjruoho  * by Jukka Ruohonen.
9e1481082Sjruoho  *
10e1481082Sjruoho  * Redistribution and use in source and binary forms, with or without
11e1481082Sjruoho  * modification, are permitted provided that the following conditions
12e1481082Sjruoho  * are met:
13e1481082Sjruoho  * 1. Redistributions of source code must retain the above copyright
14e1481082Sjruoho  *    notice, this list of conditions and the following disclaimer.
15e1481082Sjruoho  * 2. Redistributions in binary form must reproduce the above copyright
16e1481082Sjruoho  *    notice, this list of conditions and the following disclaimer in the
17e1481082Sjruoho  *    documentation and/or other materials provided with the distribution.
18e1481082Sjruoho  *
19e1481082Sjruoho  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20e1481082Sjruoho  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21e1481082Sjruoho  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22e1481082Sjruoho  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23e1481082Sjruoho  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24e1481082Sjruoho  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25e1481082Sjruoho  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26e1481082Sjruoho  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27e1481082Sjruoho  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28e1481082Sjruoho  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29e1481082Sjruoho  * POSSIBILITY OF SUCH DAMAGE.
30e1481082Sjruoho  */
31e1481082Sjruoho 
32e1481082Sjruoho /* Public domain, Otto Moerbeek <otto@drijf.net>, 2006. */
33e1481082Sjruoho 
34e1481082Sjruoho #include <sys/cdefs.h>
35*15e7a2e7Srillig __RCSID("$NetBSD: t_strtod.c,v 1.37 2024/06/15 12:20:22 rillig Exp $");
36e1481082Sjruoho 
37e1481082Sjruoho #include <errno.h>
38*15e7a2e7Srillig #include <fenv.h>
39*15e7a2e7Srillig #include <float.h>
401cd1da49Sjruoho #include <math.h>
41e1481082Sjruoho #include <stdio.h>
42e1481082Sjruoho #include <stdlib.h>
43e1481082Sjruoho #include <string.h>
44e1481082Sjruoho 
45ba788edeSjruoho #include <atf-c.h>
46ba788edeSjruoho 
47727143deSjmmv static const char * const inf_strings[] =
48727143deSjmmv     { "Inf", "INF", "-Inf", "-INF", "Infinity", "+Infinity",
49727143deSjmmv       "INFINITY", "-INFINITY", "InFiNiTy", "+InFiNiTy" };
509da59443Sriastradh const char * const nan_string = "NaN(x)y";
51727143deSjmmv 
52e1481082Sjruoho ATF_TC(strtod_basic);
ATF_TC_HEAD(strtod_basic,tc)53e1481082Sjruoho ATF_TC_HEAD(strtod_basic, tc)
54e1481082Sjruoho {
55e1481082Sjruoho 	atf_tc_set_md_var(tc, "descr", "A basic test of strtod(3)");
56e1481082Sjruoho }
57e1481082Sjruoho 
ATF_TC_BODY(strtod_basic,tc)58e1481082Sjruoho ATF_TC_BODY(strtod_basic, tc)
59e1481082Sjruoho {
60a60572eeSchristos 	static const size_t n = 1024 * 1000;
61a60572eeSchristos 
62a60572eeSchristos 	for (size_t i = 1; i < n; i = i + 1024) {
63e1481082Sjruoho 		char buf[512];
64e1481082Sjruoho 		(void)snprintf(buf, sizeof(buf), "%zu.%zu", i, i + 1);
65e1481082Sjruoho 
66e1481082Sjruoho 		errno = 0;
67a60572eeSchristos 		double d = strtod(buf, NULL);
68e1481082Sjruoho 
699da59443Sriastradh 		ATF_CHECK_MSG(d > 0, "i=%zu buf=\"%s\" d=%g errno=%d",
709da59443Sriastradh 		    i, buf, d, errno);
719da59443Sriastradh 		ATF_CHECK_EQ_MSG(errno, 0, "i=%zu buf=\"%s\" d=%g errno=%d",
729da59443Sriastradh 		    i, buf, d, errno);
73e1481082Sjruoho 	}
74e1481082Sjruoho }
75e1481082Sjruoho 
76*15e7a2e7Srillig ATF_TC(strtold_basic);
ATF_TC_HEAD(strtold_basic,tc)77*15e7a2e7Srillig ATF_TC_HEAD(strtold_basic, tc)
78*15e7a2e7Srillig {
79*15e7a2e7Srillig 	atf_tc_set_md_var(tc, "descr", "Some examples of strtold(3)");
80*15e7a2e7Srillig }
81*15e7a2e7Srillig 
ATF_TC_BODY(strtold_basic,tc)82*15e7a2e7Srillig ATF_TC_BODY(strtold_basic, tc)
83*15e7a2e7Srillig {
84*15e7a2e7Srillig 	static const struct {
85*15e7a2e7Srillig 		const char *str;
86*15e7a2e7Srillig 		long double val;
87*15e7a2e7Srillig 	} testcases[] = {
88*15e7a2e7Srillig 		{ "0x0p0", 0.0L },
89*15e7a2e7Srillig 		{ "0x1.234p0", 0x1234 / 4096.0L },
90*15e7a2e7Srillig 		{ "0x1.234p0", 0x1234 / 4096.0L },
91*15e7a2e7Srillig #if FLT_RADIX == 2 && LDBL_MAX_EXP == 16384 && LDBL_MANT_DIG == 64
92*15e7a2e7Srillig 		{ "2.16", 0x8.a3d70a3d70a3d71p-2L },
93*15e7a2e7Srillig #endif
94*15e7a2e7Srillig 	};
95*15e7a2e7Srillig 
96*15e7a2e7Srillig 	for (size_t i = 0, n = __arraycount(testcases); i < n; i++) {
97*15e7a2e7Srillig 		char *end;
98*15e7a2e7Srillig 		errno = 0;
99*15e7a2e7Srillig 		long double val = strtold(testcases[i].str, &end);
100*15e7a2e7Srillig 
101*15e7a2e7Srillig 		ATF_CHECK_MSG(
102*15e7a2e7Srillig 		    errno == 0 && *end == '\0' && val == testcases[i].val,
103*15e7a2e7Srillig 		    "'%s' want %La have %La errno %d end '%s'",
104*15e7a2e7Srillig 		    testcases[i].str, testcases[i].val, val, errno, end);
105*15e7a2e7Srillig 	}
106*15e7a2e7Srillig }
107*15e7a2e7Srillig 
1081cd1da49Sjruoho ATF_TC(strtod_hex);
ATF_TC_HEAD(strtod_hex,tc)1091cd1da49Sjruoho ATF_TC_HEAD(strtod_hex, tc)
1101cd1da49Sjruoho {
1111cd1da49Sjruoho 	atf_tc_set_md_var(tc, "descr", "A strtod(3) with hexadecimals");
1121cd1da49Sjruoho }
1131cd1da49Sjruoho 
ATF_TC_BODY(strtod_hex,tc)1141cd1da49Sjruoho ATF_TC_BODY(strtod_hex, tc)
1151cd1da49Sjruoho {
1161cd1da49Sjruoho 	const char *str;
1171cd1da49Sjruoho 	char *end;
118be8014a7Sjoerg 	volatile double d;
1191cd1da49Sjruoho 
1201cd1da49Sjruoho 	str = "-0x0";
1211cd1da49Sjruoho 	d = strtod(str, &end);	/* -0.0 */
1221cd1da49Sjruoho 
1239da59443Sriastradh 	ATF_CHECK_EQ_MSG(end, str + 4, "str=%p end=%p", str, end);
1249da59443Sriastradh 	ATF_CHECK_MSG(signbit(d) != 0, "d=%g=%a signbit=%d", d, d, signbit(d));
1259da59443Sriastradh 	ATF_CHECK_EQ_MSG(fabs(d), 0, "d=%g=%a, fabs(d)=%g=%a",
1269da59443Sriastradh 	    d, d, fabs(d), fabs(d));
1271cd1da49Sjruoho 
1281cd1da49Sjruoho 	str = "-0x";
1291cd1da49Sjruoho 	d = strtod(str, &end);	/* -0.0 */
1301cd1da49Sjruoho 
1319da59443Sriastradh 	ATF_CHECK_EQ_MSG(end, str + 2, "str=%p end=%p", str, end);
1329da59443Sriastradh 	ATF_CHECK_MSG(signbit(d) != 0, "d=%g=%a signbit=%d", d, d, signbit(d));
1339da59443Sriastradh 	ATF_CHECK_EQ_MSG(fabs(d), 0, "d=%g=%a fabs(d)=%g=%a",
1349da59443Sriastradh 	    d, d, fabs(d), fabs(d));
1351cd1da49Sjruoho }
1361cd1da49Sjruoho 
1372ae856efSjruoho ATF_TC(strtod_inf);
ATF_TC_HEAD(strtod_inf,tc)1382ae856efSjruoho ATF_TC_HEAD(strtod_inf, tc)
1392ae856efSjruoho {
1408b18a8bfSjruoho 	atf_tc_set_md_var(tc, "descr", "A strtod(3) with INF (PR lib/33262)");
1412ae856efSjruoho }
1422ae856efSjruoho 
ATF_TC_BODY(strtod_inf,tc)1432ae856efSjruoho ATF_TC_BODY(strtod_inf, tc)
1442ae856efSjruoho {
1459da59443Sriastradh 
1469da59443Sriastradh 	if (!isinf(INFINITY))
1479da59443Sriastradh 		atf_tc_skip("no infinities on this architecture");
1489da59443Sriastradh 
149727143deSjmmv 	for (size_t i = 0; i < __arraycount(inf_strings); i++) {
150be8014a7Sjoerg 		volatile double d = strtod(inf_strings[i], NULL);
1519da59443Sriastradh 		ATF_CHECK_MSG(isinf(d), "inf_strings[%zu]=\"%s\" d=%g=%a",
1529da59443Sriastradh 		    i, inf_strings[i], d, d);
153727143deSjmmv 	}
1549478bd9eSjruoho }
155727143deSjmmv 
156727143deSjmmv ATF_TC(strtof_inf);
ATF_TC_HEAD(strtof_inf,tc)157727143deSjmmv ATF_TC_HEAD(strtof_inf, tc)
158727143deSjmmv {
1598b18a8bfSjruoho 	atf_tc_set_md_var(tc, "descr", "A strtof(3) with INF (PR lib/33262)");
160727143deSjmmv }
161727143deSjmmv 
ATF_TC_BODY(strtof_inf,tc)162727143deSjmmv ATF_TC_BODY(strtof_inf, tc)
163727143deSjmmv {
1649da59443Sriastradh 
1659da59443Sriastradh 	if (!isinf(INFINITY))
1669da59443Sriastradh 		atf_tc_skip("no infinities on this architecture");
1679da59443Sriastradh 
168727143deSjmmv 	for (size_t i = 0; i < __arraycount(inf_strings); i++) {
169be8014a7Sjoerg 		volatile float f = strtof(inf_strings[i], NULL);
1709da59443Sriastradh 		ATF_CHECK_MSG(isinf(f), "inf_strings[%zu]=\"%s\" f=%g=%a",
1719da59443Sriastradh 		    i, inf_strings[i], f, f);
1729da59443Sriastradh 		ATF_CHECK_MSG(isinff(f), "inf_strings[%zu]=\"%s\" f=%g=%a",
1739da59443Sriastradh 		    i, inf_strings[i], f, f);
174727143deSjmmv 	}
175727143deSjmmv }
176727143deSjmmv 
177727143deSjmmv ATF_TC(strtold_inf);
ATF_TC_HEAD(strtold_inf,tc)178727143deSjmmv ATF_TC_HEAD(strtold_inf, tc)
179727143deSjmmv {
1808b18a8bfSjruoho 	atf_tc_set_md_var(tc, "descr", "A strtold(3) with INF (PR lib/33262)");
181727143deSjmmv }
182727143deSjmmv 
ATF_TC_BODY(strtold_inf,tc)183727143deSjmmv ATF_TC_BODY(strtold_inf, tc)
184727143deSjmmv {
1859da59443Sriastradh 
1869da59443Sriastradh 	if (!isinf(INFINITY))
1879da59443Sriastradh 		atf_tc_skip("no infinities on this architecture");
188727143deSjmmv 
189727143deSjmmv 	for (size_t i = 0; i < __arraycount(inf_strings); i++) {
190be8014a7Sjoerg 		volatile long double ld = strtold(inf_strings[i], NULL);
1919da59443Sriastradh 		ATF_CHECK_MSG(isinf(ld), "inf_strings[%zu]=\"%s\" ld=%Lg=%La",
1929da59443Sriastradh 		    i, inf_strings[i], ld, ld);
193727143deSjmmv 	}
1942ae856efSjruoho }
1952ae856efSjruoho 
19627898bceSjruoho ATF_TC(strtod_nan);
ATF_TC_HEAD(strtod_nan,tc)19727898bceSjruoho ATF_TC_HEAD(strtod_nan, tc)
19827898bceSjruoho {
19927898bceSjruoho 	atf_tc_set_md_var(tc, "descr", "A strtod(3) with NaN");
20027898bceSjruoho }
20127898bceSjruoho 
ATF_TC_BODY(strtod_nan,tc)20227898bceSjruoho ATF_TC_BODY(strtod_nan, tc)
20327898bceSjruoho {
204727143deSjmmv 	char *end;
205727143deSjmmv 
2069da59443Sriastradh #ifndef NAN
2079da59443Sriastradh 	atf_tc_skip("no NaNs on this architecture");
208727143deSjmmv #endif
2099da59443Sriastradh 
2109da59443Sriastradh 	volatile double d = strtod(nan_string, &end);
2119da59443Sriastradh 	ATF_CHECK_MSG(isnan(d), "nan_string=\"%s\" d=%g=%a", nan_string, d, d);
2129da59443Sriastradh 	ATF_CHECK_MSG(strcmp(end, "y") == 0, "nan_string=\"%s\"@%p end=%p",
2139da59443Sriastradh 	    nan_string, nan_string, end);
214727143deSjmmv }
215727143deSjmmv 
216727143deSjmmv ATF_TC(strtof_nan);
ATF_TC_HEAD(strtof_nan,tc)217727143deSjmmv ATF_TC_HEAD(strtof_nan, tc)
218727143deSjmmv {
219727143deSjmmv 	atf_tc_set_md_var(tc, "descr", "A strtof(3) with NaN");
220727143deSjmmv }
221727143deSjmmv 
ATF_TC_BODY(strtof_nan,tc)222727143deSjmmv ATF_TC_BODY(strtof_nan, tc)
223727143deSjmmv {
224727143deSjmmv 	char *end;
225727143deSjmmv 
2269da59443Sriastradh #ifndef NAN
2279da59443Sriastradh 	atf_tc_skip("no NaNs on this architecture");
228727143deSjmmv #endif
2299da59443Sriastradh 
2309da59443Sriastradh 	volatile float f = strtof(nan_string, &end);
2319da59443Sriastradh 	ATF_CHECK_MSG(isnan(f), "nan_string=\"%s\" f=%g=%a", nan_string, f, f);
2329da59443Sriastradh 	ATF_CHECK_MSG(isnanf(f), "nan_string=\"%s\" f=%g=%a", nan_string,
2339da59443Sriastradh 	    f, f);
2349da59443Sriastradh 	ATF_CHECK_MSG(strcmp(end, "y") == 0, "nan_string=\"%s\"@%p end=%p",
2359da59443Sriastradh 	    nan_string, nan_string, end);
236727143deSjmmv }
237727143deSjmmv 
238727143deSjmmv ATF_TC(strtold_nan);
ATF_TC_HEAD(strtold_nan,tc)239727143deSjmmv ATF_TC_HEAD(strtold_nan, tc)
240727143deSjmmv {
2418b18a8bfSjruoho 	atf_tc_set_md_var(tc, "descr", "A strtold(3) with NaN (PR lib/45020)");
242727143deSjmmv }
243727143deSjmmv 
ATF_TC_BODY(strtold_nan,tc)244727143deSjmmv ATF_TC_BODY(strtold_nan, tc)
245727143deSjmmv {
24627898bceSjruoho 	char *end;
24727898bceSjruoho 
2489da59443Sriastradh #ifndef NAN
2499da59443Sriastradh 	atf_tc_skip("no NaNs on this architecture");
2509da59443Sriastradh #endif
2519da59443Sriastradh 
252be8014a7Sjoerg 	volatile long double ld = strtold(nan_string, &end);
2539da59443Sriastradh 	ATF_CHECK_MSG(isnan(ld), "nan_string=\"%s\" ld=%Lg=%La",
2549da59443Sriastradh 	    nan_string, ld, ld);
2559da59443Sriastradh 	ATF_CHECK_MSG(isnanf(ld), "nan_string=\"%s\" ld=%Lg=%La",
2569da59443Sriastradh 	    nan_string, ld, ld);
2579da59443Sriastradh 	ATF_CHECK_MSG(strcmp(end, "y") == 0, "nan_string=\"%s\"@%p end=%p",
2589da59443Sriastradh 	    nan_string, nan_string, end);
25927898bceSjruoho }
26027898bceSjruoho 
26198be3879Sjruoho ATF_TC(strtod_round);
ATF_TC_HEAD(strtod_round,tc)26298be3879Sjruoho ATF_TC_HEAD(strtod_round, tc)
26398be3879Sjruoho {
264b433853dSandvar 	atf_tc_set_md_var(tc, "descr", "Test rounding in strtod(3)");
26598be3879Sjruoho }
26698be3879Sjruoho 
ATF_TC_BODY(strtod_round,tc)26798be3879Sjruoho ATF_TC_BODY(strtod_round, tc)
26898be3879Sjruoho {
26925e32ca7Schristos #ifdef __HAVE_FENV
270f7ca1d12Sjruoho 
27198be3879Sjruoho 	/*
27298be3879Sjruoho 	 * Test that strtod(3) honors the current rounding mode.
27398be3879Sjruoho 	 * The used value is somewhere near 1 + DBL_EPSILON + FLT_EPSILON.
27498be3879Sjruoho 	 */
275a60572eeSchristos 	const char *val =
276a60572eeSchristos 	    "1.00000011920928977282585492503130808472633361816406";
27798be3879Sjruoho 
27898be3879Sjruoho 	(void)fesetround(FE_UPWARD);
279be8014a7Sjoerg 	volatile double d1 = strtod(val, NULL);
28098be3879Sjruoho 	(void)fesetround(FE_DOWNWARD);
281be8014a7Sjoerg 	volatile double d2 = strtod(val, NULL);
2829da59443Sriastradh 	ATF_CHECK_MSG(d1 > d2, "d1=%g=%a d2=%g=%a", d1, d1, d2, d2);
283727143deSjmmv #else
284ea1bc3e2Smartin 	atf_tc_skip("Requires <fenv.h> support");
28598be3879Sjruoho #endif
28698be3879Sjruoho }
28798be3879Sjruoho 
288e1481082Sjruoho ATF_TC(strtod_underflow);
ATF_TC_HEAD(strtod_underflow,tc)289e1481082Sjruoho ATF_TC_HEAD(strtod_underflow, tc)
290e1481082Sjruoho {
291e1481082Sjruoho 	atf_tc_set_md_var(tc, "descr", "Test underflow in strtod(3)");
292e1481082Sjruoho }
293e1481082Sjruoho 
ATF_TC_BODY(strtod_underflow,tc)294e1481082Sjruoho ATF_TC_BODY(strtod_underflow, tc)
295e1481082Sjruoho {
296e1481082Sjruoho 
297e1481082Sjruoho 	const char *tmp =
298e1481082Sjruoho 	    "0.0000000000000000000000000000000000000000000000000000"
299e1481082Sjruoho 	    "000000000000000000000000000000000000000000000000000000"
300e1481082Sjruoho 	    "000000000000000000000000000000000000000000000000000000"
301e1481082Sjruoho 	    "000000000000000000000000000000000000000000000000000000"
302e1481082Sjruoho 	    "000000000000000000000000000000000000000000000000000000"
303e1481082Sjruoho 	    "000000000000000000000000000000000000000000000000000000"
304e1481082Sjruoho 	    "000000000000000000000000000000000000000000000000000000"
305e1481082Sjruoho 	    "000000000000000002";
306e1481082Sjruoho 
307e1481082Sjruoho 	errno = 0;
308be8014a7Sjoerg 	volatile double d = strtod(tmp, NULL);
309e1481082Sjruoho 
310a60572eeSchristos 	if (d != 0 || errno != ERANGE)
311e1481082Sjruoho 		atf_tc_fail("strtod(3) did not detect underflow");
312e1481082Sjruoho }
313e1481082Sjruoho 
314c5290ad0Salnsn /*
315c5290ad0Salnsn  * Bug found by Geza Herman.
316c5290ad0Salnsn  * See
317c5290ad0Salnsn  * http://www.exploringbinary.com/a-bug-in-the-bigcomp-function-of-david-gays-strtod/
318c5290ad0Salnsn  */
319c5290ad0Salnsn ATF_TC(strtod_gherman_bug);
ATF_TC_HEAD(strtod_gherman_bug,tc)320c5290ad0Salnsn ATF_TC_HEAD(strtod_gherman_bug, tc)
321c5290ad0Salnsn {
322c5290ad0Salnsn 	atf_tc_set_md_var(tc, "descr", "Test a bug found by Geza Herman");
323c5290ad0Salnsn }
324c5290ad0Salnsn 
ATF_TC_BODY(strtod_gherman_bug,tc)325c5290ad0Salnsn ATF_TC_BODY(strtod_gherman_bug, tc)
326c5290ad0Salnsn {
327c5290ad0Salnsn 
328c5290ad0Salnsn 	const char *str =
329c5290ad0Salnsn 	    "1.8254370818746402660437411213933955878019332885742187";
330c5290ad0Salnsn 
331c5290ad0Salnsn 	errno = 0;
332c5290ad0Salnsn 	volatile double d = strtod(str, NULL);
333c5290ad0Salnsn 
3349da59443Sriastradh 	ATF_CHECK_EQ_MSG(d, 0x1.d34fd8378ea83p+0, "d=%g=%a", d, d);
335c5290ad0Salnsn }
336c5290ad0Salnsn 
ATF_TP_ADD_TCS(tp)337e1481082Sjruoho ATF_TP_ADD_TCS(tp)
338e1481082Sjruoho {
339e1481082Sjruoho 
340e1481082Sjruoho 	ATF_TP_ADD_TC(tp, strtod_basic);
341*15e7a2e7Srillig 	ATF_TP_ADD_TC(tp, strtold_basic);
3421cd1da49Sjruoho 	ATF_TP_ADD_TC(tp, strtod_hex);
3432ae856efSjruoho 	ATF_TP_ADD_TC(tp, strtod_inf);
344727143deSjmmv 	ATF_TP_ADD_TC(tp, strtof_inf);
345727143deSjmmv 	ATF_TP_ADD_TC(tp, strtold_inf);
34627898bceSjruoho 	ATF_TP_ADD_TC(tp, strtod_nan);
347727143deSjmmv 	ATF_TP_ADD_TC(tp, strtof_nan);
348727143deSjmmv 	ATF_TP_ADD_TC(tp, strtold_nan);
34998be3879Sjruoho 	ATF_TP_ADD_TC(tp, strtod_round);
350e1481082Sjruoho 	ATF_TP_ADD_TC(tp, strtod_underflow);
351c5290ad0Salnsn 	ATF_TP_ADD_TC(tp, strtod_gherman_bug);
352e1481082Sjruoho 
353e1481082Sjruoho 	return atf_no_error();
354e1481082Sjruoho }
355