From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rock.gnat.com (rock.gnat.com [IPv6:2620:20:4000:0:a9e:1ff:fe9b:1d1]) by sourceware.org (Postfix) with ESMTPS id B23B33858CDA for ; Thu, 30 Mar 2023 13:51:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B23B33858CDA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 6FEF7116584; Thu, 30 Mar 2023 09:51:47 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at gnat.com Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id DJ+tHDmD+Ttp; Thu, 30 Mar 2023 09:51:47 -0400 (EDT) Received: from free.home (tron.gnat.com [IPv6:2620:20:4000:0:46a8:42ff:fe0e:e294]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPS id EDFDE116579; Thu, 30 Mar 2023 09:51:46 -0400 (EDT) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 32UDpWME1548962 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 30 Mar 2023 10:51:32 -0300 From: Alexandre Oliva To: Thomas Schwinge Cc: , Jakub Jelinek , "Richard Biener" , Jason Merrill , , , Subject: Re: 'g++.dg/modules/modules.exp': don't leak local 'unsupported' proc [PR108899] Organization: Free thinker, does not speak for AdaCore References: <00f5cbe1-05b7-0e42-0b46-1e36d1e4e8b3@redhat.com> <87o7ob2usn.fsf@euler.schwinge.homeip.net> Errors-To: aoliva@lxoliva.fsfla.org Date: Thu, 30 Mar 2023 10:51:32 -0300 In-Reply-To: (Alexandre Oliva's message of "Thu, 30 Mar 2023 04:00:03 -0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mar 30, 2023, Alexandre Oliva wrote: > If we're dropping the renaming, I suppose we could also revert Jakub's > change. I suppose this patch will take care of it, pending testing... Regstrapped on x86_64-linux-gnu and also tested on arm-vx7r2 (with gcc-12), where I used to get fails after an unsupported modules.exp test, but there are no curly braces in the log files after the patch. Ok to install? [PR108899] testsuite: fix proc unsupported overriding in modules.exp The overrider of proc unsupported in modules.exp had two problems reported by Thomas Schwinge, even after Jakub Jel=C3=ADnek's fix: - it remained in effect while running other dejagnu testsets - it didn't quote correctly the argument list passed to it, which caused test names to be surrounded by curly braces, as in: UNSUPPORTED: {...} This patch fixes both issues, obsoleting and reverting Jakub's change, by dropping the overrider and renaming the saved proc back, and by using uplevel's argument list splicing. for gcc/testsuite/ChangeLog PR testsuite/108899 * g++.dg/modules/modules.exp (unsupported): Drop renaming. Fix quoting. --- gcc/testsuite/g++.dg/modules/modules.exp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/gcc/testsuite/g++.dg/modules/modules.exp b/gcc/testsuite/g++.d= g/modules/modules.exp index 80aa392bc7f3b..dc302d3d0af48 100644 --- a/gcc/testsuite/g++.dg/modules/modules.exp +++ b/gcc/testsuite/g++.dg/modules/modules.exp @@ -319,15 +319,11 @@ cleanup_module_files [find $DEFAULT_REPO *.gcm] # so that, after an unsupported result in dg-test, we can skip rather # than fail subsequent related tests. set module_do {"compile" "P"} -if { [info procs unsupported] !=3D [list] \ - && [info procs saved-unsupported] =3D=3D [list] } { - rename unsupported saved-unsupported - - proc unsupported { args } { - global module_do - lset module_do 1 "N" - return [saved-unsupported $args] - } +rename unsupported modules-saved-unsupported +proc unsupported { args } { + global module_do + lset module_do 1 "N" + return [uplevel 1 modules-saved-unsupported $args] } =20 # not grouped tests, sadly tcl doesn't have negated glob @@ -412,4 +408,10 @@ foreach src [lsort [find $srcdir/$subdir {*_a.[CHX}]] { } } =20 +# Restore the original unsupported proc, lest it will affect +# subsequent test runs, or even fail renaming if we run modules.exp +# for multiple targets/multilibs/options. +rename unsupported {} +rename modules-saved-unsupported unsupported + dg-finish --=20 Alexandre Oliva, happy hacker https://FSFLA.org/blogs/lxo/ Free Software Activist GNU Toolchain Engineer Disinformation flourishes because many people care deeply about injustice but very few check the facts. Ask me about