From patchwork Fri Jun 16 19:30:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 109333 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1568891vqr; Fri, 16 Jun 2023 12:31:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6hlAxrXhFPF58c00AbMo/Waxsz8SFzNoFgur1f8zzocy63L8iwltrMV+cYmGInJKC5HpnA X-Received: by 2002:a17:907:d8c:b0:987:3ef4:e6be with SMTP id go12-20020a1709070d8c00b009873ef4e6bemr108354ejc.12.1686943883983; Fri, 16 Jun 2023 12:31:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686943883; cv=none; d=google.com; s=arc-20160816; b=y8MaJ2yKMQCb020SdjmsJ4px6oiOehC8W66sFCqSWTzj73nWRQr1hd7F0wVYsGWx1x 3vBnEDXRTOYLK5Wzio0Ud4ZOFjoHGteTUsXVe5mgYiw0SNg4H+Fo7TXZW7UtCV4zItKz WhAY0cdjeBoEBUl105Ew8jaegBQvu+Ro4WBbsmrndVPHvwzipgd4hp+QMKW/k6z8R5xr gMn4TY6oMylBFxp9GGaapAyTAu92nWJcaY1my0aynYSjNYZCnliQbLvrNdH16R3A3D2w DFdMQmSmQ9kxDhAkYxDbKrlFmRt8ON+I73aeTShEWlyMxFLmUBZIJe+Ky0oVGniBtC0e J4yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:to:subject :message-id:date:mime-version:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=u3E/6Z/l3WQT1NOXxm6iTZHkpndJ2zw8IMJZRxYpsdA=; b=b+s3pgWbF9j2YujPYK7KsDw+T8BGuf7juqaDxDRPxG6EPoKX+rUNZHidFR+AMsS91X kopt8yZcWpHTmlJgXs57mMiKMlMyqjWbr9tU/yT/p+2e7fdcYpFodSJJtxT/UhRpZqJq FycpO8UzzehVqQxB/tAIxhlts/jVXQ/bJAHv649QFZHsMA0ykfA6FikbrAztPXsc50WK fU7n2a3lSguWqexoatav4mKoqRdStS4QW8MmB2+sAkS3A1HY6uAPTgq6YwbJwDiKjpEu sYGQiffaxm/lFiKOCw0NOTNvW5SCf/bfJ+0IEpwH5YcTrZqkushuY/2+4yeb6t/IPDvF MHPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=nShr5sHC; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id s17-20020a1709066c9100b00982a4d13431si2561149ejr.536.2023.06.16.12.31.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jun 2023 12:31:23 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=nShr5sHC; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D6E363858039 for ; Fri, 16 Jun 2023 19:31:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D6E363858039 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686943882; bh=u3E/6Z/l3WQT1NOXxm6iTZHkpndJ2zw8IMJZRxYpsdA=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=nShr5sHC95GUWjbwSXIOkeJ73X+mPmyPDmk5ZpficPlEF9j9n05xKBLua2WNjgqln XQTlOa9gxoXainbryCCp2X4QlqqLFr55qdBSJmOKdnq09cIrjyWh/Y2eT/csYssGdl F2kj0dK83vKi6iSBJKb9uazRDbEhhtAkTF55Mk4U= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by sourceware.org (Postfix) with ESMTPS id 639DE3858D35 for ; Fri, 16 Jun 2023 19:30:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 639DE3858D35 Received: by mail-pj1-x102d.google.com with SMTP id 98e67ed59e1d1-25eb401995aso635755a91.2 for ; Fri, 16 Jun 2023 12:30:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686943838; x=1689535838; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=u3E/6Z/l3WQT1NOXxm6iTZHkpndJ2zw8IMJZRxYpsdA=; b=Ph5XdLgkMkrlOe5ZFJcAznW2+bYiQnjMKEuGZMb86nXICrtodxg+avnQrm6TIT15RZ 7+rqidS58GW3voVUgEOwi5uwpRGckJMD8Bgq9ScOHGW+hUVoMmtYBl2bSYf+SoTbz+s2 aJKW218K7X7r+ke2iLYZxv0EV0eDk2uODpO4uUevZpsXTRQ8zWLI8pl5lkZMOuojF9ax 7AzWwDabZjyndxAHfmPIDPpm1dkrpRFivKJeq6i1EQqi4cCKmywZns9cd6TVIem/LN8x 5qjBaRIKVYL2kRw+Oewx9ZWY9HXFxWvDBy0uPN5uh5LDTV4oIaGtK6NC6uTKwXhb5DkM Teqg== X-Gm-Message-State: AC+VfDy9AdoLBuG5RrDB7PmLFnNlu9lw1KrfXsPh/vSb3hrnMSSgZFCE 3YEmm75QjfmGCaVmXbXMwNw+1ChIP8JjOfYFtdZVWf8C7fv6Up6NN+A= X-Received: by 2002:a17:90a:17ce:b0:25b:ce91:c204 with SMTP id q72-20020a17090a17ce00b0025bce91c204mr2207726pja.46.1686943837847; Fri, 16 Jun 2023 12:30:37 -0700 (PDT) MIME-Version: 1.0 Date: Fri, 16 Jun 2023 12:30:26 -0700 Message-ID: Subject: libgo patch committed: Add benchmarks and examples to test list To: gcc-patches , gofrontend-dev X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Ian Lance Taylor via Gcc-patches From: Ian Lance Taylor Reply-To: Ian Lance Taylor Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768888870097228801?= X-GMAIL-MSGID: =?utf-8?q?1768888870097228801?= In https://go.dev/cl/384695 (https://gcc.gnu.org/pipermail/gcc-patches/2022-February/590289.html) I simplified the code that built lists of benchmarks, examples, and fuzz tests, and managed to break it. This patch corrects the code to once again make the benchmarks available, and to run the examples with output and the fuzz targets. Doing this revealed a test failure in internal/fuzz on 32-bit x86: a signalling NaN is turned into a quiet NaN on the 387 floating-point stack that GCC uses by default. This CL skips the test. This fixes https://go.dev/issue/60826. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian bc6bd0d608da1609c1caeb04ab795a83720add55 diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 702257009d2..1191a8d663d 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -737de90a63002d4872b19772a7116404ee5815b4 +a3a3c3a2d1bc6a8ca51b302d08c94ef27cdd8f0f The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/libgo/go/internal/fuzz/encoding_test.go b/libgo/go/internal/fuzz/encoding_test.go index 8e3800eb77f..53fc5b8dc71 100644 --- a/libgo/go/internal/fuzz/encoding_test.go +++ b/libgo/go/internal/fuzz/encoding_test.go @@ -6,6 +6,7 @@ package fuzz import ( "math" + "runtime" "strconv" "testing" "unicode" @@ -330,6 +331,14 @@ func FuzzFloat64RoundTrip(f *testing.F) { f.Add(math.Float64bits(math.Inf(-1))) f.Fuzz(func(t *testing.T, u1 uint64) { + // The signaling NaN test fails on 32-bit x86 with gccgo, + // which uses the 387 floating-point stack by default. + // Converting a signaling NaN in and out of the stack + // changes the NaN to a quiet NaN. + if runtime.GOARCH == "386" && u1 == 0x7FF0000000000001 { + t.Skip("skipping signalling NaN test on 386 with gccgo") + } + x1 := math.Float64frombits(u1) b := marshalCorpusFile(x1) diff --git a/libgo/testsuite/gotest b/libgo/testsuite/gotest index 0a0a7e14d74..33c98d804d6 100755 --- a/libgo/testsuite/gotest +++ b/libgo/testsuite/gotest @@ -577,13 +577,13 @@ symtogo() { # Find Go benchmark/fuzz/example functions. # The argument is the function name prefix. findfuncs() { - pattern='$1([^a-z].*)?' + pattern="$1([^a-z].*)?" syms=$($NM -p -v _gotest_.o | egrep " $text .*\."$pattern'$' | fgrep -v ' __go_' | egrep -v '\.\.\w+$' | sed 's/.* //') if $havex; then xsyms=$($NM -p -v $xofile | egrep " $text .*\."$pattern'$' | fgrep -v ' __go_' | egrep -v '\.\.\w+$' | sed 's/.* //') syms="$syms $xsyms" fi - $(symtogo "$benchmarksyms") + symtogo "$syms" } # Takes an example name and puts any output into the file example.txt. @@ -643,11 +643,13 @@ exampleoutput() { fi if $havex; then needxtest=false - if test -n "$testxsyms" -o -n "$benchmarkxsyms"; then + if test -n "$testxsyms"; then + needxtest=true + elif echo "$benchmarks" | grep '_test\.' >/dev/null; then needxtest=true else # Check whether any example has output. - for i in $(symtogo "$examplexsyms"); do + for i in $(echo "$examples" | grep '_test\.'); do exampleoutput $i if test -f example.txt; then rm -f example.txt