tools/llvm: Do not build with symbols
[minix3.git] / tests / lib / libc / gen / t_isnan.c
blobec7f069827eb67b6c56e407993e935ab8ca5fa93
1 /* $NetBSD: t_isnan.c,v 1.3 2013/09/16 15:33:24 martin Exp $ */
3 /*
4 * This file is in the Public Domain.
6 * The nan test is blatently copied by Simon Burge from the infinity
7 * test by Ben Harris.
8 */
10 #include <atf-c.h>
11 #include <atf-c/config.h>
13 #include <math.h>
14 #include <string.h>
16 ATF_TC(isnan_basic);
17 ATF_TC_HEAD(isnan_basic, tc)
19 atf_tc_set_md_var(tc, "descr", "Verify that isnan(3) works");
22 ATF_TC_BODY(isnan_basic, tc)
24 #ifdef NAN
25 /* NAN is meant to be a (float)NaN. */
26 ATF_CHECK(isnan(NAN) != 0);
27 ATF_CHECK(isnan((double)NAN) != 0);
28 #else
29 atf_tc_skip("Test not applicable");
30 #endif
33 ATF_TC(isinf_basic);
34 ATF_TC_HEAD(isinf_basic, tc)
36 atf_tc_set_md_var(tc, "descr", "Verify that isinf(3) works");
39 ATF_TC_BODY(isinf_basic, tc)
42 /* HUGE_VAL is meant to be an infinity. */
43 ATF_CHECK(isinf(HUGE_VAL) != 0);
45 /* HUGE_VALF is the float analog of HUGE_VAL. */
46 ATF_CHECK(isinf(HUGE_VALF) != 0);
48 /* HUGE_VALL is the long double analog of HUGE_VAL. */
49 ATF_CHECK(isinf(HUGE_VALL) != 0);
52 ATF_TP_ADD_TCS(tp)
54 const char *arch;
56 arch = atf_config_get("atf_arch");
58 if (strcmp("m68000", arch) == 0)
59 atf_tc_skip("Test not applicable on %s", arch);
60 else {
61 ATF_TP_ADD_TC(tp, isnan_basic);
62 ATF_TP_ADD_TC(tp, isinf_basic);
65 return atf_no_error();