NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lib/51427: libm issues triggered by py-numpy



The following reply was made to PR lib/51427; it has been noted by GNATS.

From: coypu%SDF.ORG@localhost
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: lib/51427: libm issues triggered by py-numpy
Date: Mon, 22 Aug 2016 06:01:40 +0000

 --k1lZvvs/B4yU6o8G
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 How about this test?
 (I am unsure about -INFINITE)
 
 --k1lZvvs/B4yU6o8G
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename=ilogb-test
 
 Index: Makefile
 ===================================================================
 RCS file: /cvsroot/src/tests/lib/libm/Makefile,v
 retrieving revision 1.37
 diff -u -r1.37 Makefile
 --- Makefile	24 Jan 2016 20:26:47 -0000	1.37
 +++ Makefile	22 Aug 2016 06:00:03 -0000
 @@ -23,6 +23,7 @@
  TESTS_C+=	t_fenv
  TESTS_C+=	t_fmod
  TESTS_C+=	t_hypot
 +TESTS_C+=	t_ilogb
  TESTS_C+=	t_infinity
  TESTS_C+=	t_ldexp
  TESTS_C+=	t_log
 Index: t_ilogb.c
 ===================================================================
 RCS file: t_ilogb.c
 diff -N t_ilogb.c
 --- /dev/null	1 Jan 1970 00:00:00 -0000
 +++ t_ilogb.c	22 Aug 2016 06:00:03 -0000
 @@ -0,0 +1,71 @@
 +/* $NetBSD$ */
 +
 +/*-
 + * Copyright (c) 2016 The NetBSD Foundation, Inc.
 + * All rights reserved.
 + *
 + * This code is derived from software contributed to The NetBSD Foundation
 + * by Maya Rashish.
 + *
 + * Redistribution and use in source and binary forms, with or without
 + * modification, are permitted provided that the following conditions
 + * are met:
 + * 1. Redistributions of source code must retain the above copyright
 + *    notice, this list of conditions and the following disclaimer.
 + * 2. Redistributions in binary form must reproduce the above copyright
 + *    notice, this list of conditions and the following disclaimer in the
 + *    documentation and/or other materials provided with the distribution.
 + *
 + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 + * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 + * POSSIBILITY OF SUCH DAMAGE.
 + */
 +
 +#include <atf-c.h>
 +#include <float.h>
 +#include <math.h>
 +
 +ATF_TC(ilogb);
 +ATF_TC_HEAD(ilogb, tc)
 +{
 +	atf_tc_set_md_var(tc, "descr","Check ilogb family");
 +}
 +
 +ATF_TC_BODY(ilogb, tc)
 +{
 +  atf_tc_expect_fail("PR lib/51427");
 +
 +	ATF_CHECK(ilogbf(0) == FP_ILOGB0);
 +	ATF_CHECK(ilogb(0) == FP_ILOGB0);
 +	ATF_CHECK(ilogbl(0) == FP_ILOGB0);
 +
 +	ATF_CHECK(ilogbf(INFINITY) == INT_MAX);
 +	ATF_CHECK(ilogb(INFINITY) == INT_MAX);
 +	ATF_CHECK(ilogbl(INFINITY) == INT_MAX);
 +
 +	ATF_CHECK(ilogbf(-INFINITY) == INT_MAX);
 +	ATF_CHECK(ilogb(-INFINITY) == INT_MAX);
 +	ATF_CHECK(ilogbl(-INFINITY) == INT_MAX);
 +
 +#ifndef __vax__
 +	ATF_CHECK(ilogbf(NAN) == FP_ILOGBNAN);
 +	ATF_CHECK(ilogb(NAN) == FP_ILOGBNAN);
 +	ATF_CHECK(ilogbl(NAN) == FP_ILOGBNAN);
 +#endif
 +}
 +
 +ATF_TP_ADD_TCS(tp)
 +{
 +
 +	ATF_TP_ADD_TC(tp, ilogb);
 +
 +	return atf_no_error();
 +}
 
 --k1lZvvs/B4yU6o8G--
 



Home | Main Index | Thread Index | Old Index