From owner-svn-src-head@freebsd.org Wed Jun 24 13:11:20 2020 Return-Path: Delivered-To: svn-src-head@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 8605F34E9D4; Wed, 24 Jun 2020 13:11:20 +0000 (UTC) (envelope-from mhorne@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 49sNnh333Nz471j; Wed, 24 Jun 2020 13:11:20 +0000 (UTC) (envelope-from mhorne@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 63CF91216C; Wed, 24 Jun 2020 13:11:20 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05ODBKej017749; Wed, 24 Jun 2020 13:11:20 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05ODBJkg017747; Wed, 24 Jun 2020 13:11:19 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202006241311.05ODBJkg017747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Wed, 24 Jun 2020 13:11:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362576 - in head/lib: libc/tests/gen libc/tests/stdlib msun/tests X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: in head/lib: libc/tests/gen libc/tests/stdlib msun/tests X-SVN-Commit-Revision: 362576 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jun 2020 13:11:20 -0000 Author: mhorne Date: Wed Jun 24 13:11:19 2020 New Revision: 362576 URL: https://svnweb.freebsd.org/changeset/base/362576 Log: Enable long double tests on RISC-V Some of the NetBSD contributed tests are gated behind the __HAVE_LONG_DOUBLE flag. This flag seems to be defined only for platforms whose long double is larger than their double. I could not find this explicitly documented anywhere, but it is implied by the definitions in NetBSD's sys/arch/${arch}/include/math.h headers, and the following assertion from the UBSAN code: #ifdef __HAVE_LONG_DOUBLE long double LD; ASSERT(sizeof(LD) > sizeof(uint64_t)); #endif RISC-V has 128-bit long doubles, so enable the tests on this platform, and update the comments to better explain the purpose of this flag. Reviewed by: ngie MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25419 Modified: head/lib/libc/tests/gen/Makefile head/lib/libc/tests/stdlib/Makefile head/lib/msun/tests/Makefile Modified: head/lib/libc/tests/gen/Makefile ============================================================================== --- head/lib/libc/tests/gen/Makefile Wed Jun 24 12:17:40 2020 (r362575) +++ head/lib/libc/tests/gen/Makefile Wed Jun 24 13:11:19 2020 (r362576) @@ -35,11 +35,12 @@ posix_spawn_test_FILESPACKAGE= ${PACKAGE} CFLAGS+= -DTEST_LONG_DOUBLE -# Not sure why this isn't defined for all architectures, since most -# have long double. +# Define __HAVE_LONG_DOUBLE for architectures whose long double has greater +# precision than their double. .if ${MACHINE_CPUARCH} == "aarch64" || \ ${MACHINE_CPUARCH} == "amd64" || \ - ${MACHINE_CPUARCH} == "i386" + ${MACHINE_CPUARCH} == "i386" || \ + ${MACHINE_CPUARCH} == "riscv" CFLAGS+= -D__HAVE_LONG_DOUBLE .endif Modified: head/lib/libc/tests/stdlib/Makefile ============================================================================== --- head/lib/libc/tests/stdlib/Makefile Wed Jun 24 12:17:40 2020 (r362575) +++ head/lib/libc/tests/stdlib/Makefile Wed Jun 24 13:11:19 2020 (r362576) @@ -19,11 +19,12 @@ ATF_TESTS_CXX+= cxa_thread_atexit_nothr_test # All architectures on FreeBSD have fenv.h CFLAGS+= -D__HAVE_FENV -# Not sure why this isn't defined for all architectures, since most -# have long double. +# Define __HAVE_LONG_DOUBLE for architectures whose long double has greater +# precision than their double. .if ${MACHINE_CPUARCH} == "aarch64" || \ ${MACHINE_CPUARCH} == "amd64" || \ - ${MACHINE_CPUARCH} == "i386" + ${MACHINE_CPUARCH} == "i386" || \ + ${MACHINE_CPUARCH} == "riscv" CFLAGS+= -D__HAVE_LONG_DOUBLE .endif Modified: head/lib/msun/tests/Makefile ============================================================================== --- head/lib/msun/tests/Makefile Wed Jun 24 12:17:40 2020 (r362575) +++ head/lib/msun/tests/Makefile Wed Jun 24 13:11:19 2020 (r362576) @@ -10,11 +10,12 @@ CFLAGS+= -DHAVE_FENV_H # For isqemu.h CFLAGS+= -I${TESTSRC:H}/libc/gen -# Not sure why this isn't defined for all architectures, since most -# have long double. +# Define __HAVE_LONG_DOUBLE for architectures whose long double has greater +# precision than their double. .if ${MACHINE_CPUARCH} == "aarch64" || \ ${MACHINE_CPUARCH} == "amd64" || \ - ${MACHINE_CPUARCH} == "i386" + ${MACHINE_CPUARCH} == "i386" || \ + ${MACHINE_CPUARCH} == "riscv" CFLAGS+= -D__HAVE_LONG_DOUBLE .endif