From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id BB3423858D28 for ; Thu, 6 Apr 2023 20:12:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BB3423858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.98,323,1673942400"; d="scan'208";a="1907585" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 06 Apr 2023 12:12:01 -0800 IronPort-SDR: AV/ki6xQfpYFRaniD++24wh7tyR4neP/sIA2qtZYwqpXO+0YWMiWOmusVXv7jxDH+mnHHCsXhW UChhFvWBjvdfaC5HduRJB85N4JEIWgIaiwxJQtbQw/pnc4uooYB4kSMmLa0bac7thhsznKUS36 u0uld4+3oLjN6r6imvgTOOUWKi/KzKtTvbWSvR+68xN+lRmNaxfPDZBUD76nViApYjnidOEjnJ m2CfWqCBXWrN/sUgjglgEg+mDo9x34cxwvpRBMjn9FDnP4DaEkM/ZPmdbYTKzw4yNarnjJ/Otd oP4= From: Thomas Schwinge To: Alexandre Oliva CC: Subject: Re: 'g++.dg/modules/modules.exp': don't leak local 'unsupported' proc [PR108899] In-Reply-To: References: <00f5cbe1-05b7-0e42-0b46-1e36d1e4e8b3@redhat.com> <87o7ob2usn.fsf@euler.schwinge.homeip.net> <87y1n6ojni.fsf@euler.schwinge.homeip.net> User-Agent: Notmuch/0.29.1+93~g67ed7df (https://notmuchmail.org) Emacs/27.1 (i686-pc-linux-gnu) Date: Thu, 6 Apr 2023 22:11:57 +0200 Message-ID: <87mt3krcs2.fsf@dirichlet.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,SPF_HELO_PASS,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: Hi Alexandre! On 2023-04-05T23:38:43-0300, Alexandre Oliva via Gcc-patches wrote: > On Apr 5, 2023, Thomas Schwinge wrote: >> With... > >> Co-authored-by: Thomas Schwinge > >> ... added, I suppose. > > I wrote the patch based on your report, before even seeing your patch Eh, given your "Ooh, nice, I didn't know [...]" comment in : On 2023-03-30T04:00:03-0300, Alexandre Oliva via Gcc-patches wrote: | On Mar 29, 2023, Thomas Schwinge wrote: |> ..., this isn't sufficient. Instead, we should undo the 'rename' at the |> end of 'g++.dg/modules/modules.exp'. OK to push the attached |> "'g++.dg/modules/modules.exp': don't leak local 'unsupported' proc [PR10= 8899]" |> after proper testing? | | Ooh, nice, I didn't know how to drop the renaming after we were done | with it, [...] ..., I had certainly assumed that you'd learned "how to drop [...]" from looking at my 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! Thanks. > 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 Confirmed, thanks. Gr=C3=BC=C3=9Fe Thomas > 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++= .dg/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] > } > > # not grouped tests, sadly tcl doesn't have negated glob > @@ -412,4 +408,10 @@ foreach src [lsort [find $srcdir/$subdir {*_a.[CHX}]= ] { > } > } > > +# 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 > > > ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955