head	1.2;
access;
symbols
	netbsd-11-0-RC4:1.2
	netbsd-11-0-RC3:1.2
	netbsd-11-0-RC2:1.2
	netbsd-11-0-RC1:1.2
	perseant-exfatfs-base-20250801:1.2
	netbsd-11:1.2.0.4
	netbsd-11-base:1.2
	netbsd-10-1-RELEASE:1.1
	perseant-exfatfs-base-20240630:1.2
	perseant-exfatfs:1.2.0.2
	perseant-exfatfs-base:1.2
	netbsd-9-4-RELEASE:1.1
	netbsd-10-0-RELEASE:1.1
	netbsd-10-0-RC6:1.1
	netbsd-10-0-RC5:1.1
	netbsd-10-0-RC4:1.1
	netbsd-10-0-RC3:1.1
	netbsd-10-0-RC2:1.1
	netbsd-10-0-RC1:1.1
	netbsd-10:1.1.0.14
	netbsd-10-base:1.1
	netbsd-9-3-RELEASE:1.1
	cjep_sun2x-base1:1.1
	cjep_sun2x:1.1.0.12
	cjep_sun2x-base:1.1
	cjep_staticlib_x-base1:1.1
	netbsd-9-2-RELEASE:1.1
	cjep_staticlib_x:1.1.0.10
	cjep_staticlib_x-base:1.1
	netbsd-9-1-RELEASE:1.1
	phil-wifi-20200421:1.1
	phil-wifi-20200411:1.1
	is-mlppp:1.1.0.8
	is-mlppp-base:1.1
	phil-wifi-20200406:1.1
	netbsd-9-0-RELEASE:1.1
	netbsd-9-0-RC2:1.1
	netbsd-9-0-RC1:1.1
	phil-wifi-20191119:1.1
	netbsd-9:1.1.0.6
	netbsd-9-base:1.1
	phil-wifi-20190609:1.1
	pgoyette-compat-merge-20190127:1.1.2.2
	pgoyette-compat-20190127:1.1
	pgoyette-compat-20190118:1.1
	pgoyette-compat-1226:1.1
	pgoyette-compat-1126:1.1
	pgoyette-compat-1020:1.1
	pgoyette-compat-0930:1.1
	pgoyette-compat-0906:1.1
	pgoyette-compat-0728:1.1
	phil-wifi:1.1.0.4
	phil-wifi-base:1.1
	pgoyette-compat:1.1.0.2
	pgoyette-compat-0625:1.1;
locks; strict;
comment	@// @;


1.2
date	2024.05.06.15.40.55;	author riastradh;	state Exp;
branches;
next	1.1;
commitid	L5zK9vVCSePHbX8F;

1.1
date	2018.06.20.03.51.27;	author maya;	state Exp;
branches
	1.1.2.1;
next	;
commitid	rhxX8uLzPZ0EgYGA;

1.1.2.1
date	2018.06.20.03.51.27;	author pgoyette;	state dead;
branches;
next	1.1.2.2;
commitid	8PtAu9af7VvhiDHA;

1.1.2.2
date	2018.06.25.07.26.09;	author pgoyette;	state Exp;
branches;
next	;
commitid	8PtAu9af7VvhiDHA;


desc
@@


1.2
log
@tests/lib/libm/t_cabsl: Nix __HAVE_LONG_DOUBLE conditionals.

__HAVE_LONG_DOUBLE just means long double is different from double.
This test should always pass on all ports, even if long double is the
same as double; it doesn't test any additional precision.
@
text
@/*-
 * Copyright (c) 2018 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.
 */

/*
 * Test that C++ "cabsl" is usable. PR lib/50646
 */

#include <atf-c++.hpp>
#include <complex>

ATF_TEST_CASE(cabsl);
ATF_TEST_CASE_HEAD(cabsl)
{
	set_md_var("descr", "Check that cabsl is usable from C++");
}
ATF_TEST_CASE_BODY(cabsl)
{
	int sum = 0;

	std::complex<long double> cld(3.0,4.0);
	sum += std::abs(cld);
	std::complex<double> cd(3.0,4.0);
	sum += std::abs(cd);

	std::complex<float> cf(3.0,4.0);
	sum += std::abs(cf);

	ATF_REQUIRE_EQ(sum, 3*5);
}

ATF_INIT_TEST_CASES(tcs)
{
	ATF_ADD_TEST_CASE(tcs, cabsl);
}
@


1.1
log
@Add test case for PR lib/50646.

Make sure that cabsl (aka __c99_cabsl) is usable from C++.
@
text
@a45 1
#ifdef __HAVE_LONG_DOUBLE
a47 1
#endif
a53 1
#ifdef __HAVE_LONG_DOUBLE
a54 3
#else
	ATF_REQUIRE_EQ(sum, 2*5);
#endif
@


1.1.2.1
log
@file t_cabsl.cxx was added on branch pgoyette-compat on 2018-06-25 07:26:09 +0000
@
text
@d1 66
@


1.1.2.2
log
@Sync with HEAD
@
text
@a0 66
/*-
 * Copyright (c) 2018 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.
 */

/*
 * Test that C++ "cabsl" is usable. PR lib/50646
 */

#include <atf-c++.hpp>
#include <complex>

ATF_TEST_CASE(cabsl);
ATF_TEST_CASE_HEAD(cabsl)
{
	set_md_var("descr", "Check that cabsl is usable from C++");
}
ATF_TEST_CASE_BODY(cabsl)
{
	int sum = 0;

#ifdef __HAVE_LONG_DOUBLE
	std::complex<long double> cld(3.0,4.0);
	sum += std::abs(cld);
#endif
	std::complex<double> cd(3.0,4.0);
	sum += std::abs(cd);

	std::complex<float> cf(3.0,4.0);
	sum += std::abs(cf);

#ifdef __HAVE_LONG_DOUBLE
	ATF_REQUIRE_EQ(sum, 3*5);
#else
	ATF_REQUIRE_EQ(sum, 2*5);
#endif
}

ATF_INIT_TEST_CASES(tcs)
{
	ATF_ADD_TEST_CASE(tcs, cabsl);
}
@


