From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rock.gnat.com (rock.gnat.com [205.232.38.15]) by sourceware.org (Postfix) with ESMTPS id 9B8173858CDA for ; Thu, 30 Mar 2023 07:00:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9B8173858CDA 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 76C06116417; Thu, 30 Mar 2023 03:00:24 -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 1OKkVgkSblLX; Thu, 30 Mar 2023 03:00:24 -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 A32CE1162FE; Thu, 30 Mar 2023 03:00:23 -0400 (EDT) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 32U703Cd1534043 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 30 Mar 2023 04:00:05 -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 04:00:03 -0300 In-Reply-To: <87o7ob2usn.fsf@euler.schwinge.homeip.net> (Thomas Schwinge's message of "Wed, 29 Mar 2023 21:59:20 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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 29, 2023, Thomas Schwinge wrote: > I assume that the second UNSUPPORTED: > -UNSUPPORTED: g++.dg/modules/explicit-bool-1_b.C -std=c++17 > ... disappears is the intention of this patch? Yup > But surely the curly braces in: > -UNSUPPORTED: g++.dg/modules/explicit-bool-1_a.H -std=c++17 > +UNSUPPORTED: {g++.dg/modules/explicit-bool-1_a.H -std=c++17} > ... are not intentional? (Alexandre?) Unintended indeed, will look, thanks for letting me know > But worse, the latter also "bleeds into" all other testing Eeek Yeah, that's a much bigger problem indeed. > ..., 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 [PR108899]" > after proper testing? Ooh, nice, I didn't know how to drop the renaming after we were done with it, and hoped the end of the .exp would have accomplished that by ending a scope. Jakub had already pointed out this wasn't the case, but I didn't realize, when he did, that this would carry over onto other modules. 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... diff --git a/gcc/testsuite/g++.dg/modules/modules.exp b/gcc/testsuite/g++.dg/modules/modules.exp index 80aa392bc7f3b..6fd5050cef79b 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] != [list] \ - && [info procs saved-unsupported] == [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 [eval 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 -- 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