aboutsummaryrefslogtreecommitdiff
path: root/contrib/netbsd-tests
diff options
context:
space:
mode:
authorAlex Richardson <arichardson@FreeBSD.org>2021-02-25 14:28:17 +0000
committerAlex Richardson <arichardson@FreeBSD.org>2021-03-22 11:55:07 +0000
commit87d65c747a4389901c2bbbcb1ec4878b2df7b32c (patch)
treefcbd7ab8e2b4f2e13da22518988673d7eaf57a84 /contrib/netbsd-tests
parentb424e0038a00dffbec800a6f0778db0ffdabe9d6 (diff)
downloadsrc-87d65c747a4389901c2bbbcb1ec4878b2df7b32c.tar.gz
src-87d65c747a4389901c2bbbcb1ec4878b2df7b32c.zip
lib/msun: Allow building tests with WARNS=6
The only change needed is to mark a few variables as static.
Diffstat (limited to 'contrib/netbsd-tests')
-rw-r--r--contrib/netbsd-tests/lib/libm/t_ldexp.c19
-rw-r--r--contrib/netbsd-tests/lib/libm/t_precision.c4
-rw-r--r--contrib/netbsd-tests/lib/libm/t_round.c2
-rw-r--r--contrib/netbsd-tests/lib/libm/t_scalbn.c2
4 files changed, 13 insertions, 14 deletions
diff --git a/contrib/netbsd-tests/lib/libm/t_ldexp.c b/contrib/netbsd-tests/lib/libm/t_ldexp.c
index 977b2219873b..40c69206e741 100644
--- a/contrib/netbsd-tests/lib/libm/t_ldexp.c
+++ b/contrib/netbsd-tests/lib/libm/t_ldexp.c
@@ -53,7 +53,7 @@ struct ldexp_test {
const char *result;
};
-struct ldexp_test ldexp_basic[] = {
+static struct ldexp_test ldexp_basic[] = {
{ 1.0, 5, SKIP, " 32" },
{ 1.0, 1022, SKIP, "4.4942328371557897693233e+307" },
{ 1.0, 1023, -1, "4.4942328371557897693233e+307" },
@@ -71,7 +71,7 @@ struct ldexp_test ldexp_basic[] = {
{ 0, 0, 0, NULL }
};
-struct ldexp_test ldexp_zero[] = {
+static struct ldexp_test ldexp_zero[] = {
{ 0.0, -1, SKIP, " 0" },
{ 0.0, 0, SKIP, " 0" },
{ 0.0, 1, SKIP, " 0" },
@@ -82,7 +82,7 @@ struct ldexp_test ldexp_zero[] = {
{ 0, 0, 0, NULL }
};
-struct ldexp_test ldexp_infinity[] = {
+static struct ldexp_test ldexp_infinity[] = {
{ 1.0, 1024, -1, " inf" },
{ 1.0, 1024, 0, " inf" },
{ 1.0, 1024, 1, " inf" },
@@ -92,7 +92,7 @@ struct ldexp_test ldexp_infinity[] = {
{ 0, 0, 0, NULL }
};
-struct ldexp_test ldexp_overflow[] = {
+static struct ldexp_test ldexp_overflow[] = {
{ 1.0, 1024, SKIP, " inf" },
{ 1.0, 1023, 1, " inf" },
{ 1.0, -1022, 2046, " inf" },
@@ -106,7 +106,7 @@ struct ldexp_test ldexp_overflow[] = {
{ 0, 0, 0, NULL }
};
-struct ldexp_test ldexp_denormal[] = {
+static struct ldexp_test ldexp_denormal[] = {
{ 1.0, -1023, SKIP, "1.1125369292536006915451e-308" },
{ 1.0, -1022, -1, "1.1125369292536006915451e-308" },
{ 1.0, 1023, -2046, "1.1125369292536006915451e-308" },
@@ -120,7 +120,7 @@ struct ldexp_test ldexp_denormal[] = {
{ 0, 0, 0, NULL }
};
-struct ldexp_test ldexp_underflow[] = {
+static struct ldexp_test ldexp_underflow[] = {
{ 1.0, -1075, SKIP, " 0" },
{ 1.0, -1074, -1, " 0" },
{ 1.0, 1023, -2098, " 0" },
@@ -132,7 +132,7 @@ struct ldexp_test ldexp_underflow[] = {
{ 0, 0, 0, NULL }
};
-struct ldexp_test ldexp_denormal_large[] = {
+static struct ldexp_test ldexp_denormal_large[] = {
{ 1.0, -1028, 1024, " 0.0625" },
{ 1.0, -1028, 1025, " 0.125" },
{ 1.0, -1028, 1026, " 0.25" },
@@ -177,10 +177,9 @@ run_test(struct ldexp_test *table)
v = ldexp(v, table->exp2);
(void)snprintf(outbuf, sizeof(outbuf), FORMAT, v);
-
ATF_CHECK_STREQ_MSG(table->result, outbuf,
- "Entry %zu:\n\tExp: \"%s\"\n\tAct: \"%s\"",
- i, table->result, outbuf);
+ "Entry %zu:\n\tExp: \"%s\"\n\tAct: \"%s\"/%a",
+ i, table->result, outbuf, v);
}
}
diff --git a/contrib/netbsd-tests/lib/libm/t_precision.c b/contrib/netbsd-tests/lib/libm/t_precision.c
index eb8e29546eb6..b953845c21f4 100644
--- a/contrib/netbsd-tests/lib/libm/t_precision.c
+++ b/contrib/netbsd-tests/lib/libm/t_precision.c
@@ -44,9 +44,9 @@ ATF_TC_HEAD(t_precision, tc)
"Basic precision test for double and long double");
}
-volatile double x = 1;
+static volatile double x = 1;
#if __HAVE_LONG_DOUBLE
-volatile long double y = 1;
+static volatile long double y = 1;
#endif
ATF_TC_BODY(t_precision, tc)
diff --git a/contrib/netbsd-tests/lib/libm/t_round.c b/contrib/netbsd-tests/lib/libm/t_round.c
index 7d32586f1aa5..bafc894943ce 100644
--- a/contrib/netbsd-tests/lib/libm/t_round.c
+++ b/contrib/netbsd-tests/lib/libm/t_round.c
@@ -117,7 +117,7 @@ ATF_TC_HEAD(rounding_alpha_simple, tc)
}
-double rounding_alpha_simple_even = 9223372036854775808.000000; /* 2^63 */
+static double rounding_alpha_simple_even = 9223372036854775808.000000; /* 2^63 */
ATF_TC_BODY(rounding_alpha_simple, tc)
{
diff --git a/contrib/netbsd-tests/lib/libm/t_scalbn.c b/contrib/netbsd-tests/lib/libm/t_scalbn.c
index f6adaaa993ec..dce07aac3c78 100644
--- a/contrib/netbsd-tests/lib/libm/t_scalbn.c
+++ b/contrib/netbsd-tests/lib/libm/t_scalbn.c
@@ -49,7 +49,7 @@ struct testcase {
int error;
int except;
};
-struct testcase test_vals[] = {
+static struct testcase test_vals[] = {
{ 0, 1.00085, 1.00085, 0, 0 },
{ 0, 0.99755, 0.99755, 0, 0 },
{ 0, -1.00085, -1.00085, 0, 0 },