Source-Changes-D archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: CVS commit: src/tests/lib/libm
Am 12.09.11 18:28, schrieb Jukka Ruohonen:
> Module Name: src
> Committed By: jruoho
> Date: Mon Sep 12 16:28:37 UTC 2011
>
> Modified Files:
> src/tests/lib/libm: t_ldexp.c t_scalbn.c t_tanh.c
>
> Log Message:
> Happiness of VAX implies ugliness of the code.
But does it make the VAX really happy, if all the code is just ifdef'ed
out? Or did I get that wrong that the tests are now simply disabled on
the vax?
>
>
> To generate a diff of this commit:
> cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libm/t_ldexp.c \
> src/tests/lib/libm/t_scalbn.c
> cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libm/t_tanh.c
>
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
>
>
>
>
> Modified files:
>
> Index: src/tests/lib/libm/t_ldexp.c
> diff -u src/tests/lib/libm/t_ldexp.c:1.2 src/tests/lib/libm/t_ldexp.c:1.3
> --- src/tests/lib/libm/t_ldexp.c:1.2 Mon Sep 12 15:47:14 2011
> +++ src/tests/lib/libm/t_ldexp.c Mon Sep 12 16:28:37 2011
> @@ -1,4 +1,4 @@
> -/* $NetBSD: t_ldexp.c,v 1.2 2011/09/12 15:47:14 jruoho Exp $ */
> +/* $NetBSD: t_ldexp.c,v 1.3 2011/09/12 16:28:37 jruoho Exp $ */
>
> /*-
> * Copyright (c) 2011 The NetBSD Foundation, Inc.
> @@ -29,7 +29,7 @@
> * POSSIBILITY OF SUCH DAMAGE.
> */
> #include <sys/cdefs.h>
> -__RCSID("$NetBSD: t_ldexp.c,v 1.2 2011/09/12 15:47:14 jruoho Exp $");
> +__RCSID("$NetBSD: t_ldexp.c,v 1.3 2011/09/12 16:28:37 jruoho Exp $");
>
> #include <math.h>
> #include <limits.h>
> @@ -49,6 +49,7 @@
>
> ATF_TC_BODY(ldexp_nan, tc)
> {
> +#ifndef __vax__
> const double x = 0.0L / 0.0L;
> double y;
> size_t i;
> @@ -59,6 +60,7 @@
> y = ldexp(x, exps[i]);
> ATF_CHECK(isnan(y) != 0);
> }
> +#endif
> }
>
> ATF_TC(ldexp_inf_neg);
> @@ -69,11 +71,13 @@
>
> ATF_TC_BODY(ldexp_inf_neg, tc)
> {
> +#ifndef __vax__
> const double x = -1.0L / 0.0L;
> size_t i;
>
> for (i = 0; i < __arraycount(exps); i++)
> ATF_CHECK(ldexp(x, exps[i]) == x);
> +#endif
> }
>
> ATF_TC(ldexp_inf_pos);
> @@ -84,11 +88,13 @@
>
> ATF_TC_BODY(ldexp_inf_pos, tc)
> {
> +#ifndef __vax__
> const double x = 1.0L / 0.0L;
> size_t i;
>
> for (i = 0; i < __arraycount(exps); i++)
> ATF_CHECK(ldexp(x, exps[i]) == x);
> +#endif
> }
>
> ATF_TC(ldexp_zero_neg);
> @@ -99,6 +105,7 @@
>
> ATF_TC_BODY(ldexp_zero_neg, tc)
> {
> +#ifndef __vax__
> const double x = -0.0L;
> double y;
> size_t i;
> @@ -110,6 +117,7 @@
> ATF_CHECK(x == y);
> ATF_CHECK(signbit(y) != 0);
> }
> +#endif
> }
>
> ATF_TC(ldexp_zero_pos);
> @@ -120,6 +128,7 @@
>
> ATF_TC_BODY(ldexp_zero_pos, tc)
> {
> +#ifndef __vax__
> const double x = 0.0L;
> double y;
> size_t i;
> @@ -131,6 +140,7 @@
> ATF_CHECK(x == y);
> ATF_CHECK(signbit(y) == 0);
> }
> +#endif
> }
>
> ATF_TC(ldexpf_nan);
> @@ -141,6 +151,7 @@
>
> ATF_TC_BODY(ldexpf_nan, tc)
> {
> +#ifndef __vax__
> const float x = 0.0L / 0.0L;
> float y;
> size_t i;
> @@ -151,6 +162,7 @@
> y = ldexpf(x, exps[i]);
> ATF_CHECK(isnan(y) != 0);
> }
> +#endif
> }
>
> /*
> @@ -165,11 +177,13 @@
>
> ATF_TC_BODY(ldexpf_inf_neg, tc)
> {
> +#ifndef __vax__
> const float x = -1.0L / 0.0L;
> size_t i;
>
> for (i = 0; i < __arraycount(exps); i++)
> ATF_CHECK(ldexpf(x, exps[i]) == x);
> +#endif
> }
>
> ATF_TC(ldexpf_inf_pos);
> @@ -180,11 +194,13 @@
>
> ATF_TC_BODY(ldexpf_inf_pos, tc)
> {
> +#ifndef __vax__
> const float x = 1.0L / 0.0L;
> size_t i;
>
> for (i = 0; i < __arraycount(exps); i++)
> ATF_CHECK(ldexpf(x, exps[i]) == x);
> +#endif
> }
>
> ATF_TC(ldexpf_zero_neg);
> @@ -195,6 +211,7 @@
>
> ATF_TC_BODY(ldexpf_zero_neg, tc)
> {
> +#ifndef __vax__
> const float x = -0.0L;
> float y;
> size_t i;
> @@ -206,6 +223,7 @@
> ATF_CHECK(x == y);
> ATF_CHECK(signbit(y) != 0);
> }
> +#endif
> }
>
> ATF_TC(ldexpf_zero_pos);
> @@ -216,6 +234,7 @@
>
> ATF_TC_BODY(ldexpf_zero_pos, tc)
> {
> +#ifndef __vax__
> const float x = 0.0L;
> float y;
> size_t i;
> @@ -227,6 +246,7 @@
> ATF_CHECK(x == y);
> ATF_CHECK(signbit(y) == 0);
> }
> +#endif
> }
>
> ATF_TP_ADD_TCS(tp)
> Index: src/tests/lib/libm/t_scalbn.c
> diff -u src/tests/lib/libm/t_scalbn.c:1.2 src/tests/lib/libm/t_scalbn.c:1.3
> --- src/tests/lib/libm/t_scalbn.c:1.2 Mon Sep 12 15:47:14 2011
> +++ src/tests/lib/libm/t_scalbn.c Mon Sep 12 16:28:37 2011
> @@ -1,4 +1,4 @@
> -/* $NetBSD: t_scalbn.c,v 1.2 2011/09/12 15:47:14 jruoho Exp $ */
> +/* $NetBSD: t_scalbn.c,v 1.3 2011/09/12 16:28:37 jruoho Exp $ */
>
> /*-
> * Copyright (c) 2011 The NetBSD Foundation, Inc.
> @@ -29,7 +29,7 @@
> * POSSIBILITY OF SUCH DAMAGE.
> */
> #include <sys/cdefs.h>
> -__RCSID("$NetBSD: t_scalbn.c,v 1.2 2011/09/12 15:47:14 jruoho Exp $");
> +__RCSID("$NetBSD: t_scalbn.c,v 1.3 2011/09/12 16:28:37 jruoho Exp $");
>
> #include <math.h>
> #include <limits.h>
> @@ -49,6 +49,7 @@
>
> ATF_TC_BODY(scalbn_nan, tc)
> {
> +#ifndef __vax__
> const double x = 0.0L / 0.0L;
> double y;
> size_t i;
> @@ -59,6 +60,7 @@
> y = scalbn(x, exps[i]);
> ATF_CHECK(isnan(y) != 0);
> }
> +#endif
> }
>
> ATF_TC(scalbn_inf_neg);
> @@ -69,11 +71,13 @@
>
> ATF_TC_BODY(scalbn_inf_neg, tc)
> {
> +#ifndef __vax__
> const double x = -1.0L / 0.0L;
> size_t i;
>
> for (i = 0; i < __arraycount(exps); i++)
> ATF_CHECK(scalbn(x, exps[i]) == x);
> +#endif
> }
>
> ATF_TC(scalbn_inf_pos);
> @@ -84,11 +88,13 @@
>
> ATF_TC_BODY(scalbn_inf_pos, tc)
> {
> +#ifndef __vax__
> const double x = 1.0L / 0.0L;
> size_t i;
>
> for (i = 0; i < __arraycount(exps); i++)
> ATF_CHECK(scalbn(x, exps[i]) == x);
> +#endif
> }
>
> ATF_TC(scalbn_zero_neg);
> @@ -99,6 +105,7 @@
>
> ATF_TC_BODY(scalbn_zero_neg, tc)
> {
> +#ifndef __vax__
> const double x = -0.0L;
> double y;
> size_t i;
> @@ -110,6 +117,7 @@
> ATF_CHECK(x == y);
> ATF_CHECK(signbit(y) != 0);
> }
> +#endif
> }
>
> ATF_TC(scalbn_zero_pos);
> @@ -120,6 +128,7 @@
>
> ATF_TC_BODY(scalbn_zero_pos, tc)
> {
> +#ifndef __vax__
> const double x = 0.0L;
> double y;
> size_t i;
> @@ -131,6 +140,7 @@
> ATF_CHECK(x == y);
> ATF_CHECK(signbit(y) == 0);
> }
> +#endif
> }
>
> /*
> @@ -144,6 +154,7 @@
>
> ATF_TC_BODY(scalbnf_nan, tc)
> {
> +#ifndef __vax__
> const float x = 0.0L / 0.0L;
> float y;
> size_t i;
> @@ -154,6 +165,7 @@
> y = scalbnf(x, exps[i]);
> ATF_CHECK(isnan(y) != 0);
> }
> +#endif
> }
>
> ATF_TC(scalbnf_inf_neg);
> @@ -164,11 +176,13 @@
>
> ATF_TC_BODY(scalbnf_inf_neg, tc)
> {
> +#ifndef __vax__
> const float x = -1.0L / 0.0L;
> size_t i;
>
> for (i = 0; i < __arraycount(exps); i++)
> ATF_CHECK(scalbnf(x, exps[i]) == x);
> +#endif
> }
>
> ATF_TC(scalbnf_inf_pos);
> @@ -179,11 +193,13 @@
>
> ATF_TC_BODY(scalbnf_inf_pos, tc)
> {
> +#ifndef __vax__
> const float x = 1.0L / 0.0L;
> size_t i;
>
> for (i = 0; i < __arraycount(exps); i++)
> ATF_CHECK(scalbnf(x, exps[i]) == x);
> +#endif
> }
>
> ATF_TC(scalbnf_zero_neg);
> @@ -194,6 +210,7 @@
>
> ATF_TC_BODY(scalbnf_zero_neg, tc)
> {
> +#ifndef __vax__
> const float x = -0.0L;
> float y;
> size_t i;
> @@ -205,6 +222,7 @@
> ATF_CHECK(x == y);
> ATF_CHECK(signbit(y) != 0);
> }
> +#endif
> }
>
> ATF_TC(scalbnf_zero_pos);
> @@ -215,6 +233,7 @@
>
> ATF_TC_BODY(scalbnf_zero_pos, tc)
> {
> +#ifndef __vax__
> const float x = 0.0L;
> float y;
> size_t i;
> @@ -226,6 +245,7 @@
> ATF_CHECK(x == y);
> ATF_CHECK(signbit(y) == 0);
> }
> +#endif
> }
>
> /*
> @@ -239,6 +259,7 @@
>
> ATF_TC_BODY(scalbnl_nan, tc)
> {
> +#ifndef __vax__
> #ifndef __HAVE_LONG_DOUBLE
> atf_tc_skip("Requires long double support");
> #else
> @@ -253,6 +274,7 @@
> ATF_CHECK(isnan(y) != 0);
> }
> #endif
> +#endif
> }
>
> ATF_TC(scalbnl_inf_neg);
> @@ -263,6 +285,7 @@
>
> ATF_TC_BODY(scalbnl_inf_neg, tc)
> {
> +#ifndef __vax__
> #ifndef __HAVE_LONG_DOUBLE
> atf_tc_skip("Requires long double support");
> #else
> @@ -272,6 +295,7 @@
> for (i = 0; i < __arraycount(exps); i++)
> ATF_CHECK(scalbnl(x, exps[i]) == x);
> #endif
> +#endif
> }
>
> ATF_TC(scalbnl_inf_pos);
> @@ -282,6 +306,7 @@
>
> ATF_TC_BODY(scalbnl_inf_pos, tc)
> {
> +#ifndef __vax__
> #ifndef __HAVE_LONG_DOUBLE
> atf_tc_skip("Requires long double support");
> #else
> @@ -291,6 +316,7 @@
> for (i = 0; i < __arraycount(exps); i++)
> ATF_CHECK(scalbnl(x, exps[i]) == x);
> #endif
> +#endif
> }
>
> ATF_TC(scalbnl_zero_neg);
> @@ -301,6 +327,7 @@
>
> ATF_TC_BODY(scalbnl_zero_neg, tc)
> {
> +#ifndef __vax__
> #ifndef __HAVE_LONG_DOUBLE
> atf_tc_skip("Requires long double support");
> #else
> @@ -316,6 +343,7 @@
> ATF_CHECK(signbit(y) != 0);
> }
> #endif
> +#endif
> }
>
> ATF_TC(scalbnl_zero_pos);
> @@ -326,6 +354,7 @@
>
> ATF_TC_BODY(scalbnl_zero_pos, tc)
> {
> +#ifndef __vax__
> #ifndef __HAVE_LONG_DOUBLE
> atf_tc_skip("Requires long double support");
> #else
> @@ -341,6 +370,7 @@
> ATF_CHECK(signbit(y) == 0);
> }
> #endif
> +#endif
> }
>
> ATF_TP_ADD_TCS(tp)
>
> Index: src/tests/lib/libm/t_tanh.c
> diff -u src/tests/lib/libm/t_tanh.c:1.4 src/tests/lib/libm/t_tanh.c:1.5
> --- src/tests/lib/libm/t_tanh.c:1.4 Mon Sep 12 16:00:56 2011
> +++ src/tests/lib/libm/t_tanh.c Mon Sep 12 16:28:37 2011
> @@ -1,4 +1,4 @@
> -/* $NetBSD: t_tanh.c,v 1.4 2011/09/12 16:00:56 jruoho Exp $ */
> +/* $NetBSD: t_tanh.c,v 1.5 2011/09/12 16:28:37 jruoho Exp $ */
>
> /*-
> * Copyright (c) 2011 The NetBSD Foundation, Inc.
> @@ -29,7 +29,7 @@
> * POSSIBILITY OF SUCH DAMAGE.
> */
> #include <sys/cdefs.h>
> -__RCSID("$NetBSD: t_tanh.c,v 1.4 2011/09/12 16:00:56 jruoho Exp $");
> +__RCSID("$NetBSD: t_tanh.c,v 1.5 2011/09/12 16:28:37 jruoho Exp $");
>
> #include <atf-c.h>
> #include <math.h>
> @@ -45,10 +45,12 @@
>
> ATF_TC_BODY(tanh_nan, tc)
> {
> +#ifndef __vax__
> const double x = 0.0L / 0.0L;
>
> ATF_CHECK(isnan(x) != 0);
> ATF_CHECK(isnan(tanh(x)) != 0);
> +#endif
> }
>
> ATF_TC(tanh_inf_neg);
> @@ -59,9 +61,11 @@
>
> ATF_TC_BODY(tanh_inf_neg, tc)
> {
> +#ifndef __vax__
> const double x = -1.0L / 0.0L;
>
> ATF_CHECK(tanh(x) == -1.0);
> +#endif
> }
>
> ATF_TC(tanh_inf_pos);
> @@ -72,9 +76,11 @@
>
> ATF_TC_BODY(tanh_inf_pos, tc)
> {
> +#ifndef __vax__
> const double x = 1.0L / 0.0L;
>
> ATF_CHECK(tanh(x) == 1.0);
> +#endif
> }
>
> ATF_TC(tanh_zero_neg);
> @@ -85,6 +91,7 @@
>
> ATF_TC_BODY(tanh_zero_neg, tc)
> {
> +#ifndef __vax__
> const double x = -0.0L;
> double y = tanh(x);
>
> @@ -93,6 +100,7 @@
>
> ATF_REQUIRE_MSG(signbit(y) != 0,
> "compiler bug, waiting for newer gcc import, see PR lib/44057");
> +#endif
> }
>
> ATF_TC(tanh_zero_pos);
> @@ -103,12 +111,14 @@
>
> ATF_TC_BODY(tanh_zero_pos, tc)
> {
> +#ifndef __vax__
> const double x = 0.0L;
> double y = tanh(x);
>
> ATF_CHECK(x == y);
> ATF_CHECK(signbit(x) == 0);
> ATF_CHECK(signbit(y) == 0);
> +#endif
> }
>
> /*
> @@ -122,10 +132,12 @@
>
> ATF_TC_BODY(tanhf_nan, tc)
> {
> +#ifndef __vax__
> const float x = 0.0L / 0.0L;
>
> ATF_CHECK(isnan(x) != 0);
> ATF_CHECK(isnan(tanhf(x)) != 0);
> +#endif
> }
>
> ATF_TC(tanhf_inf_neg);
> @@ -136,9 +148,11 @@
>
> ATF_TC_BODY(tanhf_inf_neg, tc)
> {
> +#ifndef __vax__
> const float x = -1.0L / 0.0L;
>
> ATF_CHECK(tanhf(x) == -1.0);
> +#endif
> }
>
> ATF_TC(tanhf_inf_pos);
> @@ -149,9 +163,11 @@
>
> ATF_TC_BODY(tanhf_inf_pos, tc)
> {
> +#ifndef __vax__
> const float x = 1.0L / 0.0L;
>
> ATF_CHECK(tanhf(x) == 1.0);
> +#endif
> }
>
> ATF_TC(tanhf_zero_neg);
> @@ -162,6 +178,7 @@
>
> ATF_TC_BODY(tanhf_zero_neg, tc)
> {
> +#ifndef __vax__
> const float x = -0.0L;
> float y = tanh(x);
>
> @@ -170,6 +187,7 @@
>
> ATF_REQUIRE_MSG(signbit(y) != 0,
> "compiler bug, waiting for newer gcc import, see PR lib/44057");
> +#endif
> }
>
> ATF_TC(tanhf_zero_pos);
> @@ -180,12 +198,14 @@
>
> ATF_TC_BODY(tanhf_zero_pos, tc)
> {
> +#ifndef __vax__
> const float x = 0.0L;
> float y = tanhf(x);
>
> ATF_CHECK(x == y);
> ATF_CHECK(signbit(x) == 0);
> ATF_CHECK(signbit(y) == 0);
> +#endif
> }
>
> ATF_TP_ADD_TCS(tp)
>
Home |
Main Index |
Thread Index |
Old Index