From owner-svn-src-all@freebsd.org Wed Nov 18 19:23:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 30A2946FCF4; Wed, 18 Nov 2020 19:23:31 +0000 (UTC) (envelope-from alfredo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cbt5H0gSNz4XNN; Wed, 18 Nov 2020 19:23:31 +0000 (UTC) (envelope-from alfredo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C72C917335; Wed, 18 Nov 2020 19:23:30 +0000 (UTC) (envelope-from alfredo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AIJNUfG090690; Wed, 18 Nov 2020 19:23:30 GMT (envelope-from alfredo@FreeBSD.org) Received: (from alfredo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AIJNUMk090688; Wed, 18 Nov 2020 19:23:30 GMT (envelope-from alfredo@FreeBSD.org) Message-Id: <202011181923.0AIJNUMk090688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alfredo set sender to alfredo@FreeBSD.org using -f From: "Alfredo Dal'Ava Junior" Date: Wed, 18 Nov 2020 19:23:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367811 - head/lib/msun/tests X-SVN-Group: head X-SVN-Commit-Author: alfredo X-SVN-Commit-Paths: head/lib/msun/tests X-SVN-Commit-Revision: 367811 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Nov 2020 19:23:31 -0000 Author: alfredo Date: Wed Nov 18 19:23:30 2020 New Revision: 367811 URL: https://svnweb.freebsd.org/changeset/base/367811 Log: msun tests: use standard floating-point exception flags on lrint and fenv tests Some platforms have additional architecture-specific floating-point flags. Msun test cases lrint and test_fegsetenv (fenv) expects only standard flags, so make sure to mask them appropriately. This makes test pass on PowerPC64. Reviewed by: jhibbits, ngie Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D27202 Modified: head/lib/msun/tests/fenv_test.c head/lib/msun/tests/lrint_test.c Modified: head/lib/msun/tests/fenv_test.c ============================================================================== --- head/lib/msun/tests/fenv_test.c Wed Nov 18 19:22:24 2020 (r367810) +++ head/lib/msun/tests/fenv_test.c Wed Nov 18 19:23:30 2020 (r367811) @@ -43,13 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include -/* - * Implementations are permitted to define additional exception flags - * not specified in the standard, so it is not necessarily true that - * FE_ALL_EXCEPT == ALL_STD_EXCEPT. - */ -#define ALL_STD_EXCEPT (FE_DIVBYZERO | FE_INEXACT | FE_INVALID | \ - FE_OVERFLOW | FE_UNDERFLOW) +#include "test-utils.h" #define NEXCEPTS (sizeof(std_excepts) / sizeof(std_excepts[0])) @@ -373,7 +367,13 @@ test_fegsetenv(void) assert(fegetround() == FE_TONEAREST); assert(fesetenv(&env2) == 0); - assert(fetestexcept(FE_ALL_EXCEPT) == excepts); + + /* + * Some platforms like powerpc may set extra exception bits. Since + * only standard exceptions are tested, mask against ALL_STD_EXCEPT + */ + assert((fetestexcept(FE_ALL_EXCEPT) & ALL_STD_EXCEPT) == excepts); + assert(fegetround() == FE_DOWNWARD); assert(fesetenv(&env1) == 0); assert(fetestexcept(FE_ALL_EXCEPT) == 0); Modified: head/lib/msun/tests/lrint_test.c ============================================================================== --- head/lib/msun/tests/lrint_test.c Wed Nov 18 19:22:24 2020 (r367810) +++ head/lib/msun/tests/lrint_test.c Wed Nov 18 19:23:30 2020 (r367811) @@ -41,6 +41,8 @@ __FBSDID("$FreeBSD$"); #include #endif +#include "test-utils.h" + /* * XXX The volatile here is to avoid gcc's bogus constant folding and work * around the lack of support for the FENV_ACCESS pragma. @@ -49,7 +51,8 @@ __FBSDID("$FreeBSD$"); volatile double _d = x; \ assert(feclearexcept(FE_ALL_EXCEPT) == 0); \ assert((func)(_d) == (result) || fetestexcept(FE_INVALID)); \ - assert(fetestexcept(FE_ALL_EXCEPT) == (excepts)); \ + assert((fetestexcept(FE_ALL_EXCEPT) & ALL_STD_EXCEPT) \ + == (excepts)); \ } while (0) #define testall(x, result, excepts) do { \