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 29D333858D39 for ; Thu, 6 Apr 2023 02:39:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 29D333858D39 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 AD84411656D; Wed, 5 Apr 2023 22:38:59 -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 6Tk6PUJ-fqkw; Wed, 5 Apr 2023 22:38:59 -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 4C93E1160CE; Wed, 5 Apr 2023 22:38:59 -0400 (EDT) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 3362chZU1763810 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 5 Apr 2023 23:38:44 -0300 From: Alexandre Oliva To: Thomas Schwinge Cc: 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> <87y1n6ojni.fsf@euler.schwinge.homeip.net> Errors-To: aoliva@lxoliva.fsfla.org Date: Wed, 05 Apr 2023 23:38:43 -0300 In-Reply-To: <87y1n6ojni.fsf@euler.schwinge.homeip.net> (Thomas Schwinge's message of "Wed, 5 Apr 2023 09:47:13 +0200") 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 Apr 5, 2023, Thomas Schwinge wrote: > Given the two "OK"s that you got end of last week, are you going to push > that anytime soon, please? Apologies for the delay. > With... > Co-authored-by: Thomas Schwinge > ... added, I suppose. I wrote the patch based on your report, before even seeing your patch, though I only posted mine later, so I tried to give you credit for the report in the commit message, but if you feel that the note is appropriate, sure :-) Thanks again! Here's what I'm checking in. testsuite: fix proc unsupported overriding in modules.exp [PR108899] 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. Co-authored-by: Thomas Schwinge 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