From patchwork Mon Feb 13 17:12:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tulio Magno Quites Machado Filho X-Patchwork-Id: 19241 X-Patchwork-Delegate: joseph@codesourcery.com Received: (qmail 24876 invoked by alias); 13 Feb 2017 17:13:45 -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 Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 24861 invoked by uid 89); 13 Feb 2017 17:13:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, URIBL_RED autolearn=no version=3.3.2 spammy=1937, Hx-languages-length:5827, 1, 18, 6199 X-HELO: mx0a-001b2d01.pphosted.com From: "Tulio Magno Quites Machado Filho" To: libc-alpha@sourceware.org, joseph@codesourcery.com Cc: gftg@linux.vnet.ibm.com Subject: [RFC] Add math tests for libieee Date: Mon, 13 Feb 2017 15:12:47 -0200 In-Reply-To: References: X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17021317-0032-0000-0000-0000053E1EA0 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17021317-0033-0000-0000-000011C11EAA Message-Id: <1487005967-32387-1-git-send-email-tuliom@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-02-13_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702130166 Joseph Myers writes: > On Wed, 8 Feb 2017, Gabriel F. T. Gomes wrote: > >> The code that this patch changes is not executed, because the wrappers >> (in math/w_j0_compat.c and math/w_j1_compat.c) call __kernel_standard >> and return. > > It's executed with -lieee (meaning this is user-visible and should have a > bug filed in Bugzilla accordingly). In this case, should we be testing libieee too? --- 8< --- Reuse the math tests to test IEEE error handling rules. Integrating this patch will cause 148 errors on each math type test for the following ppc64, ppc64le and x86_64. 2017-02-13 Tulio Magno Quites Machado Filho * math/Makefile (libm-tests): Add ieee tests. (LDLIBS-test-float-ieee): New. (LDLIBS-test-double-ieee): Likewise. (LDLIBS-test-ldouble-ieee): Likewise. * math/libm-test-support.c (check_float_internal): Avoid testing errno under IEEE error handling rules. * math/test-double-ieee.c: New file. * math/test-float-ieee.c: Likewise. * math/test-ldouble-ieee.c: Likewise. --- math/Makefile | 7 ++++++- math/libm-test-support.c | 4 +++- math/test-double-ieee.c | 18 ++++++++++++++++++ math/test-float-ieee.c | 18 ++++++++++++++++++ math/test-ldouble-ieee.c | 18 ++++++++++++++++++ 5 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 math/test-double-ieee.c create mode 100644 math/test-float-ieee.c create mode 100644 math/test-ldouble-ieee.c diff --git a/math/Makefile b/math/Makefile index 2735212..c1d7676 100644 --- a/math/Makefile +++ b/math/Makefile @@ -193,7 +193,8 @@ endif ifneq (no,$(PERL)) libm-vec-tests = $(addprefix test-,$(libmvec-tests)) -libm-tests = $(foreach t,$(types),test-$(t) test-$(t)-finite test-i$(t)) \ +libm-tests = $(foreach t,$(types),test-$(t) test-$(t)-finite test-i$(t) \ + test-$(t)-ieee) \ $(libm-vec-tests) libm-tests.o = $(addsuffix .o,$(libm-tests)) @@ -334,6 +335,10 @@ CFLAGS-test-flt-eval-method.c = -fexcess-precision=standard CFLAGS-test-fe-snans-always-signal.c = -fsignaling-nans +LDLIBS-test-float-ieee = -lieee +LDLIBS-test-double-ieee = -lieee +LDLIBS-test-ldouble-ieee = -lieee + # The -lieee module sets the _LIB_VERSION_ switch to IEEE mode # for error handling in the -lm functions. install-lib += libieee.a diff --git a/math/libm-test-support.c b/math/libm-test-support.c index d387f81..dabf6bc 100644 --- a/math/libm-test-support.c +++ b/math/libm-test-support.c @@ -619,7 +619,9 @@ check_float_internal (const char *test_name, FLOAT computed, FLOAT expected, int errno_value = errno; test_exceptions (test_name, exceptions); - test_errno (test_name, errno_value, exceptions); + /* IEEE error handling (via libieee) doesn't support errno. */ + if (_LIB_VERSION != _IEEE_) + test_errno (test_name, errno_value, exceptions); if (exceptions & IGNORE_RESULT) goto out; if (issignaling (computed) && issignaling (expected)) diff --git a/math/test-double-ieee.c b/math/test-double-ieee.c new file mode 100644 index 0000000..f638c45 --- /dev/null +++ b/math/test-double-ieee.c @@ -0,0 +1,18 @@ +/* Copyright (C) 2017 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 "test-double.c" diff --git a/math/test-float-ieee.c b/math/test-float-ieee.c new file mode 100644 index 0000000..88b68e1 --- /dev/null +++ b/math/test-float-ieee.c @@ -0,0 +1,18 @@ +/* Copyright (C) 2017 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 "test-float.c" diff --git a/math/test-ldouble-ieee.c b/math/test-ldouble-ieee.c new file mode 100644 index 0000000..e8c3cc6 --- /dev/null +++ b/math/test-ldouble-ieee.c @@ -0,0 +1,18 @@ +/* Copyright (C) 2017 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 "test-ldouble.c"