From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id A42411F461 for ; Wed, 26 Jun 2019 13:59:43 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :content-type:content-transfer-encoding:mime-version; q=dns; s= default; b=RNStyUhfHWN9F0gEVx/VPMPZz5tgjmYexTgiMeAga6xoTMGlRy8Ps NOKM5WdWLrrXEhbF1Na3DoYEBGWnkI3irdzRMPqY4QaV2P+bKXNt+7EFjb/QWLAH GyV1rJCwJsgG3uXAcE1zdufQoEpQrr21g++NIooryNEu2tVKAVO6ZM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :content-type:content-transfer-encoding:mime-version; s=default; bh=/nlVa0/vYqEwJ+JNZ5AjBAwDH5g=; b=Bhm2/Qrd/uSfSg0NgXs3iGwXt+8C A5JQQwOzrANCf0+GZNSYXs0MRKtzluRXSTK9LT+yAuRUCvgvVOUdR74dryn5kQQd 6e3O5SNzhdPSLZRusFbHHQ/NhqwSbzQrMUHv9bkhzGgFB67lA4C0n1400k2azdll nOmljuPi5U4Ek+M= Received: (qmail 118365 invoked by alias); 26 Jun 2019 13:59:39 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 118308 invoked by uid 89); 26 Jun 2019 13:59:39 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: EUR03-VE1-obe.outbound.protection.outlook.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iTNacqZ034j/dG71jSPXMsQuvYG7hT7oxspSOv7ffR8=; b=ZZojhHrVIbrgaC/DW0leotYL8xjUyNn11RvCcuuWay6X+CW0yglLgTsI48FhNuTrWpBkVIT0ul97vmbDnVl+IB8cloEpsOuoU7M/uqPIDa/I+l+yuGdn+VYrutNLzrlAZKUKAtTxm8wnfLghqCSZf1Ba9a1or614WlGl9ZSnCQ0= From: Wilco Dijkstra To: "libc-alpha@sourceware.org" CC: nd Subject: [PATCH 2/4] Remove finite-math tests Date: Wed, 26 Jun 2019 13:59:31 +0000 Message-ID: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wilco.Dijkstra@arm.com; x-ms-exchange-purlcount: 1 x-ms-oob-tlc-oobclassifiers: OLM:7219; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Wilco.Dijkstra@arm.com Remove the finite-math tests from the testsuite - these are no longer useful after removing math-finite.h header. Passes buildmanyglibc, build&test on x86_64 and AArch64. 2019-06-26 Wilco Dijkstra * math/Makefile: Update to remove finite-math tests. * math/gen-libm-test.py: Remove setting of NON_FINITE. * math/libm-test-driver.c: Remove TEST_FINITE, flag_test_finite. * math/libm-test-support.h: Remove flag_test_finite declartion. * math/libm-test-support.c: Remove NON_FINITE support. * math/test-finite-macros.c: Remove file. * math/test-math-finite.h: Likewise. * math/test-math-inline.h: Remove TEST_FINITE. * math/test-math-no-finite.h : Remove file. * math/test-math-vector.h: Remove TEST_FINITE. * math/test-signgam-finite.c: Remove test. * math/test-signgam-finite-c11.c: Likewise. * math/test-signgam-finite-c99.c: Likewise. -- diff --git a/math/Makefile b/math/Makefile index 8d754ed02c4e60dc9becc63e2b604e8c0d6557f7..d6eb0c430afd1586a7bcf9ebdb6= e3c841dc2839e 100644 --- a/math/Makefile +++ b/math/Makefile @@ -228,8 +228,7 @@ tests =3D test-matherr-3 test-fenv basic-test \ test-tgmath-ret bug-nextafter bug-nexttoward bug-tgmath1 \ test-tgmath-int test-tgmath2 test-powl tst-CMPLX tst-CMPLX2 test-snan \ test-fenv-tls test-fenv-preserve test-fenv-return test-fenvinline \ - test-nearbyint-except test-fenv-clear test-signgam-finite \ - test-signgam-finite-c99 test-signgam-finite-c11 \ + test-nearbyint-except test-fenv-clear \ test-nearbyint-except-2 test-signgam-uchar test-signgam-uchar-init \ test-signgam-uint test-signgam-uint-init test-signgam-ullong \ test-signgam-ullong-init test-nan-overflow test-nan-payload \ @@ -238,7 +237,7 @@ tests =3D test-matherr-3 test-fenv basic-test \ test-femode-traps test-iszero-excess-precision \ test-iseqsig-excess-precision test-flt-eval-method \ test-fp-ilogb-constants test-fp-llogb-constants \ - test-fe-snans-always-signal test-finite-macros test-narrow-macros \ + test-fe-snans-always-signal test-narrow-macros \ test-nan-const $(tests-static) tests-static =3D test-fpucw-static test-fpucw-ieee-static \ test-signgam-uchar-static test-signgam-uchar-init-static \ @@ -297,17 +296,13 @@ generated +=3D libm-test-ulps.h $(libm-test-c-auto) $= (libm-test-c-noauto) \ $(libm-test-c-narrow) =20 libm-tests-base-normal =3D $(foreach t,$(test-types),test-$(t)) -libm-tests-base-finite =3D $(foreach t,$(test-types),test-$(t)-finite) libm-tests-base-inline =3D $(foreach t,$(test-types),test-i$(t)) libm-tests-base-narrow =3D $(foreach t,$(test-type-pairs),test-$(t)) -libm-tests-base =3D $(libm-tests-base-normal) $(libm-tests-base-finite) \ - $(libm-tests-base-inline) $(libm-vec-tests) +libm-tests-base =3D $(libm-tests-base-normal) $(libm-tests-base-inline) \ + $(libm-vec-tests) libm-tests-normal =3D $(foreach t,$(libm-tests-base-normal),\ $(foreach f,$(libm-test-funcs-all),\ $(t)-$(f))) -libm-tests-finite =3D $(foreach t,$(libm-tests-base-finite),\ - $(foreach f,$(libm-test-funcs-all),\ - $(t)-$(f))) libm-tests-inline =3D $(foreach t,$(libm-tests-base-inline),\ $(foreach f,$(libm-test-funcs-all),\ $(t)-$(f))) @@ -316,11 +311,10 @@ libm-tests-narrow =3D $(foreach t,$(libm-tests-base-n= arrow),\ $(t)-$(f))) libm-tests-vector =3D $(foreach t,$(libmvec-tests),\ $(foreach f,$($(t)-funcs),test-$(t)-$(f))) -libm-tests =3D $(libm-tests-normal) $(libm-tests-finite) $(libm-tests-inli= ne) \ +libm-tests =3D $(libm-tests-normal) $(libm-tests-inline) \ $(libm-tests-narrow) $(libm-tests-vector) libm-tests-for-type =3D $(foreach f,$(libm-test-funcs-all),\ - test-$(1)-$(f) test-$(1)-finite-$(f) \ - test-i$(1)-$(f)) \ + test-$(1)-$(f) test-i$(1)-$(f)) \ $(filter test-$(1)-%,$(libm-tests-vector) \ $(libm-tests-narrow)) =20 @@ -398,8 +392,6 @@ CFLAGS-test-float-vlen16-wrappers.c +=3D $(float-vlen16= -arch-ext-cflags) # validated. libm-test-no-inline-cflags =3D -fno-inline -ffloat-store -fno-builtin \ -fsignaling-nans -libm-test-finite-cflags =3D $(libm-test-no-inline-cflags) \ - -U__FINITE_MATH_ONLY__ -D__FINITE_MATH_ONLY__=3D1 libm-test-inline-cflags =3D $(libm-test-fast-math-cflags) CFLAGS-test-tgmath.c +=3D -fno-builtin # The following testcase uses very long lines (>3 million), so it may take= a @@ -411,9 +403,6 @@ CFLAGS-test-powl.c +=3D -fno-builtin =20 CFLAGS-test-snan.c +=3D -fsignaling-nans =20 -CFLAGS-test-signgam-finite.c +=3D -ffinite-math-only -CFLAGS-test-signgam-finite-c99.c +=3D -ffinite-math-only -std=3Dc99 -CFLAGS-test-signgam-finite-c11.c +=3D -ffinite-math-only -std=3Dc11 CFLAGS-test-signgam-uchar.c +=3D -std=3Dc99 CFLAGS-test-signgam-uchar-init.c +=3D -std=3Dc99 CFLAGS-test-signgam-uchar-static.c +=3D -std=3Dc99 @@ -440,8 +429,6 @@ CFLAGS-test-flt-eval-method.c +=3D -fexcess-precision= =3Dstandard =20 CFLAGS-test-fe-snans-always-signal.c +=3D -fsignaling-nans =20 -CFLAGS-test-finite-macros.c +=3D -ffinite-math-only - CFLAGS-test-nan-const.c +=3D -fno-builtin =20 include ../Rules @@ -480,25 +467,13 @@ $(foreach t,$(libm-tests-normal),$(objpfx)$(t).c): $(= objpfx)test-%.c: func=3D$${type_func#*-}; \ ( \ echo "#include "; \ - echo "#include "; \ + echo "#define TEST_EXCEPTIONS 1"; \ echo "#include "; \ echo "#include "; \ echo "#include "; \ echo "#include "; \ ) > $@ =20 -$(foreach t,$(libm-tests-finite),$(objpfx)$(t).c): $(objpfx)test-%.c: - type_func=3D$*; \ - type=3D$${type_func%%-*}; \ - func=3D$${type_func#*-finite-}; \ - ( \ - echo "#include "; \ - echo "#include "; \ - echo "#include "; \ - echo "#include "; \ - echo "#include "; \ - ) > $@ - $(foreach t,$(libm-tests-inline),$(objpfx)$(t).c): $(objpfx)test-i%.c: type_func=3D$*; \ type=3D$${type_func%%-*}; \ @@ -519,7 +494,7 @@ $(foreach t,$(libm-tests-narrow),$(objpfx)$(t).c): $(ob= jpfx)test-%.c: ( \ echo "#include "; \ echo "#include "; \ - echo "#include "; \ + echo "#define TEST_EXCEPTIONS 1"; \ echo "#include "; \ echo "#include "; \ echo "#include "; \ @@ -571,13 +546,6 @@ include $(o-iterator) =20 define o-iterator-doit $(foreach f,$(libm-test-funcs-all),\ - $(objpfx)$(o)-$(f).o): CFLAGS +=3D $(libm-test-finite-cflags) -endef -object-suffixes-left :=3D $(libm-tests-base-finite) -include $(o-iterator) - -define o-iterator-doit -$(foreach f,$(libm-test-funcs-all),\ $(objpfx)$(o)-$(f).o): CFLAGS +=3D $(libm-test-inline-cflags) endef object-suffixes-left :=3D $(libm-tests-base-inline) diff --git a/math/gen-libm-test.py b/math/gen-libm-test.py index 4574215fec7b385b0513f85622f3cdd69c8171ab..b98a69622f5c6988dfa5ccd60e5= bf9c2d271849f 100755 --- a/math/gen-libm-test.py +++ b/math/gen-libm-test.py @@ -341,9 +341,6 @@ def apply_lit(arg, macro): =20 def gen_test_args_res(descr_args, descr_res, args, res_rm): """Generate a test given the arguments and per-rounding-mode results."= "" - # Determine whether any arguments or results, for any rounding - # mode, are non-finite. - non_finite =3D False test_snan =3D False all_args_res =3D list(args) for r in res_rm: @@ -351,10 +348,6 @@ def gen_test_args_res(descr_args, descr_res, args, res= _rm): for a in all_args_res: if 'snan_value' in a: test_snan =3D True - non_finite =3D True - elif ('qnan_value' in a or 'plus_infty' in a or 'minus_infty' in a - or 'plus_oflow' in a or 'minus_oflow' in a): - non_finite =3D True # Process the arguments. args_disp =3D [] args_c =3D [] @@ -422,8 +415,6 @@ def gen_test_args_res(descr_args, descr_res, args, res_= rm): flags =3D [] if ignore_result_any: flags.append('IGNORE_RESULT') - if non_finite: - flags.append('NON_FINITE') if test_snan: flags.append('TEST_SNAN') flags.append(res[res_pos]) diff --git a/math/libm-test-driver.c b/math/libm-test-driver.c index 4640f30d64ae800687c6fe737b43c0d305847eb2..7623df549f86775b85194bbf60e= c685cd4a2745f 100644 --- a/math/libm-test-driver.c +++ b/math/libm-test-driver.c @@ -23,7 +23,6 @@ /* Flags set by the including file. */ const int flag_test_errno =3D TEST_ERRNO; const int flag_test_exceptions =3D TEST_EXCEPTIONS; -const int flag_test_finite =3D TEST_FINITE; const int flag_test_inline =3D TEST_INLINE; const int flag_test_mathvec =3D TEST_MATHVEC; =20 @@ -44,8 +43,6 @@ const int snan_tests_arg =3D SNAN_TESTS (FLOAT); # define TEST_MSG "testing " STR_FLOAT " (vector length " STR_VEC_LEN ")\n= " #elif TEST_INLINE # define TEST_MSG "testing " STR_FLOAT " (inline functions)\n" -#elif TEST_FINITE -# define TEST_MSG "testing " STR_FLOAT " (finite-math-only)\n" #elif TEST_NARROW # define TEST_MSG "testing " STR_FLOAT " (argument " STR_ARG_FLOAT ")\n" #else diff --git a/math/libm-test-support.h b/math/libm-test-support.h index 2b8d5a3d889a76cc1e678d5db190944d84058cc4..028cf5647027ca5c9c8c7e70f33= bd2ea51871afd 100644 --- a/math/libm-test-support.h +++ b/math/libm-test-support.h @@ -34,7 +34,6 @@ =20 extern const int flag_test_errno; extern const int flag_test_exceptions; -extern const int flag_test_finite; extern const int flag_test_inline; extern const int flag_test_mathvec; extern const int snan_tests_arg; @@ -69,7 +68,6 @@ extern const char doc[]; #define ERRNO_ERANGE 0x20000 /* Flags generated by gen-libm-test.py, not entered here manually. */ #define IGNORE_RESULT 0x40000 -#define NON_FINITE 0x80000 #define TEST_SNAN 0x100000 #define NO_TEST_MATHVEC 0x200000 =20 diff --git a/math/libm-test-support.c b/math/libm-test-support.c index 5f986da75229746e62368583d4d6d8602b86d25b..ca70722720f0b6a8fb7a2e4194e= 7d419e5ac047c 100644 --- a/math/libm-test-support.c +++ b/math/libm-test-support.c @@ -983,8 +983,6 @@ enable_test (int exceptions) return 0; if (flag_test_inline && (exceptions & NO_TEST_INLINE)) return 0; - if (flag_test_finite && (exceptions & NON_FINITE) !=3D 0) - return 0; if ((!SNAN_TESTS (FLOAT) || !snan_tests_arg) && (exceptions & TEST_SNAN) !=3D 0) return 0; diff --git a/math/test-finite-macros.c b/math/test-finite-macros.c deleted file mode 100644 index 14524a357b837d020f48aec10d05ed9ca1855c4f..000000000000000000000000000= 0000000000000 --- a/math/test-finite-macros.c +++ /dev/null @@ -1,35 +0,0 @@ -/* Test finite-math-only code does not conflict with user macros (bug 2202= 8). - Copyright (C) 2017-2019 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -/* The main test is that the inclusion of compiles. */ -#define f first test macro -#define l second test macro -#define f128 third test macro - -#include - -volatile float a, b; - -static int -do_test (void) -{ - b =3D acosf (a); - return 0; -} - -#include diff --git a/math/test-math-finite.h b/math/test-math-finite.h deleted file mode 100644 index e3c8e0a2b9f9aa547c8af0d8a38b26c6830ab6ca..000000000000000000000000000= 0000000000000 --- a/math/test-math-finite.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Common definitions for libm tests for finite-math-only. - Copyright (C) 2015-2019 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#define TEST_FINITE 1 -#define TEST_ERRNO 0 -#define TEST_EXCEPTIONS 1 diff --git a/math/test-math-inline.h b/math/test-math-inline.h index b51cf52901b693aba3088da3774964c3b852e912..14553dda6ca6e82bdcf42b6122d= 8a65a9dd06dba 100644 --- a/math/test-math-inline.h +++ b/math/test-math-inline.h @@ -17,7 +17,6 @@ . */ =20 #define TEST_INLINE 1 -#define TEST_FINITE 0 #define TEST_ERRNO 0 #define TEST_EXCEPTIONS 0 =20 diff --git a/math/test-math-no-finite.h b/math/test-math-no-finite.h deleted file mode 100644 index e3456aae756375f41ef7d4cf47bb68a24dfdddfc..000000000000000000000000000= 0000000000000 --- a/math/test-math-no-finite.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Common definitions for libm tests for no-finite-math-only. - Copyright (C) 2015-2019 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#define TEST_FINITE 0 -#define TEST_EXCEPTIONS 1 diff --git a/math/test-math-vector.h b/math/test-math-vector.h index b211ddebec08daafb76a8673dbfc7bf11659c0ac..775198867e097f0f8b1e3266aba= 2eba5a75e94a7 100644 --- a/math/test-math-vector.h +++ b/math/test-math-vector.h @@ -18,7 +18,6 @@ =20 #define TEST_MATHVEC 1 #define TEST_NARROW 0 -#define TEST_FINITE 0 #define TEST_ERRNO 0 #define TEST_EXCEPTIONS 0 =20 diff --git a/math/test-signgam-finite-c11.c b/math/test-signgam-finite-c11.= c deleted file mode 100644 index dff132df934fdb2ceb593ed9326e821b4349bd8f..000000000000000000000000000= 0000000000000 --- a/math/test-signgam-finite-c11.c +++ /dev/null @@ -1 +0,0 @@ -#include "test-signgam-finite-c99.c" diff --git a/math/test-signgam-finite-c99.c b/math/test-signgam-finite-c99.= c deleted file mode 100644 index 9be03a9edc1222953b3f5c331fb729f3dfab3335..000000000000000000000000000= 0000000000000 --- a/math/test-signgam-finite-c99.c +++ /dev/null @@ -1,63 +0,0 @@ -/* Test lgamma functions do not set signgam for -ffinite-math-only for ISO= C. - Copyright (C) 2015-2019 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#undef _LIBC -#undef __LIBC_INTERNAL_MATH_INLINES -#undef _GNU_SOURCE - -#include -#include - -int signgam; - -#define RUN_TESTS(FUNC, TYPE) \ - do \ - { \ - volatile TYPE a, b, c __attribute__ ((unused)); \ - a =3D 0.5; \ - b =3D -0.5; \ - signgam =3D 123; \ - c =3D FUNC (a); \ - if (signgam =3D=3D 123) \ - puts ("PASS: " #FUNC " (0.5) setting signgam"); \ - else \ - { \ - puts ("FAIL: " #FUNC " (0.5) setting signgam"); \ - result =3D 1; \ - } \ - signgam =3D 123; \ - c =3D FUNC (b); \ - if (signgam =3D=3D 123) \ - puts ("PASS: " #FUNC " (-0.5) setting signgam"); \ - else \ - { \ - puts ("FAIL: " #FUNC " (-0.5) setting signgam"); \ - result =3D 1; \ - } \ - } \ - while (0) - -int -main (void) -{ - int result =3D 0; - RUN_TESTS (lgammaf, float); - RUN_TESTS (lgamma, double); - RUN_TESTS (lgammal, long double); - return result; -} diff --git a/math/test-signgam-finite.c b/math/test-signgam-finite.c deleted file mode 100644 index 5ec697c7738d81b87099d9585ac14b58b3d091c2..000000000000000000000000000= 0000000000000 --- a/math/test-signgam-finite.c +++ /dev/null @@ -1,63 +0,0 @@ -/* Test lgamma functions set signgam for -ffinite-math-only (bug 19211). - Copyright (C) 2015-2019 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include - -#define RUN_TESTS(FUNC, TYPE) \ - do \ - { \ - volatile TYPE a, b, c __attribute__ ((unused)); \ - a =3D 0.5; \ - b =3D -0.5; \ - signgam =3D 123; \ - c =3D FUNC (a); \ - if (signgam =3D=3D 1) \ - puts ("PASS: " #FUNC " (0.5) setting signgam"); \ - else \ - { \ - puts ("FAIL: " #FUNC " (0.5) setting signgam"); \ - result =3D 1; \ - } \ - signgam =3D 123; \ - c =3D FUNC (b); \ - if (signgam =3D=3D -1) \ - puts ("PASS: " #FUNC " (-0.5) setting signgam"); \ - else \ - { \ - puts ("FAIL: " #FUNC " (-0.5) setting signgam"); \ - result =3D 1; \ - } \ - } \ - while (0) - -static int -do_test (void) -{ - int result =3D 0; - RUN_TESTS (lgammaf, float); - RUN_TESTS (gammaf, float); - RUN_TESTS (lgamma, double); - RUN_TESTS (gamma, double); - RUN_TESTS (lgammal, long double); - RUN_TESTS (gammal, long double); - return result; -} - -#define TEST_FUNCTION do_test () -#include "../test-skeleton.c"