From patchwork Wed Oct 2 13:47:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 1992018 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XJbjR3XpKz1xt3 for ; Wed, 2 Oct 2024 23:47:55 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3DE893858283 for ; Wed, 2 Oct 2024 13:47:53 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 09E16385842A for ; Wed, 2 Oct 2024 13:47:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 09E16385842A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 09E16385842A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727876852; cv=none; b=uH2PIq9y1kLmO/hbsJv1vLvfy75voBJEadr49pAGuSFWxQakZ+pmnNofzz1kEcD7WpL/FRvp43XoVgJKmgDLgftQYcLPztMAgNiXeBJBxF8SGi7HswuBBBiw6Yp+waHCxnObUbE+x5t8nx/a1pTV79q7M/9zOBlVvaY5p0a49oY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727876852; c=relaxed/simple; bh=VucfOIuPagcV6InHaYoHR68liCgVxQGTyyiSkclVIQI=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=qWQJI1LFQEnQjrcjqsw1fpLd5q0vXhuaQF6t6kGmVGf1usl1h/0IFQnuEyJcWzHKrQRpdhyXiWgpcvLZM6/ZlpAJLaVEu4qHVWFgIvBDmp3+3Fy2Fb8kzOfdpSTsmxjeVO9eo9JfVxEFpHZuaR0UEljAjYqteD/jXnrU2jjfLHc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2CE49339 for ; Wed, 2 Oct 2024 06:47:51 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.110.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5200D3F64C for ; Wed, 2 Oct 2024 06:47:21 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [PATCH] testsuite: Unset torture_current_flags after use Date: Wed, 02 Oct 2024 14:47:20 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Spam-Status: No, score=-18.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org Before running a test with specific torture options, gcc-dg-runtest sets the global variable torture_current_flags to the set of torture options that will be used. However, it never unset the variable afterwards, which meant that the last options would hang around and potentially confuse later non-torture tests. I saw this with a follow-on patch to check-function-bodies, but it's probably possible to construct aritificial test combinations that expose it with check-function-bodies's existing flag filtering. Tested on aarch64-linux-gnu. OK to install? Richard gcc/testsuite/ * gcc/testsuite/lib/gcc-dg.exp (gcc-dg-runtest): Unset torture_current_flags after each test. --- gcc/testsuite/lib/gcc-dg.exp | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index cb401a70435..7adca02f937 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -628,6 +628,7 @@ proc gcc-dg-runtest { testcases flags default-extra-flags } { set torture_current_flags "$flags_t" verbose "Testing $nshort, $flags $flags_t" 1 dg-test $test "$flags $flags_t" ${default-extra-flags} + unset torture_current_flags } }