From patchwork Tue May 18 11:24:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 1480197 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Fktw036mRz9sWF for ; Tue, 18 May 2021 21:25:19 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A5F40383D01D; Tue, 18 May 2021 11:25:16 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id 63A4A3844036 for ; Tue, 18 May 2021 11:25:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 63A4A3844036 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Thomas_Schwinge@mentor.com IronPort-SDR: NjisLO7Yz2v9g3uBLUJ2rjLZ99bMQWF6X1PkqjhikQL8HEFNAeFNT+KW9y5sqWKuUXv+6Uwoe8 tkSMQ323U3XIs57cP0eFkTCCO+31hMjt5JgRAADQYbrv6HiMO0XjW74VEaDfHqsJbxJvLTfGY+ vPp0l3qr8nvShMDBm0vNn/UifPqISlSsSbVVvOvNYWEmqzcnaHMsSUxR13A/h4GtP6zbztNEtD +AuD/18Ml3PCvI/iXlVgQgmO2yLjGeLU6CIV/E1WO6NC9dGv4sMdwX7p5MY0Qt8KmIHQjHNCZ3 q9s= X-IronPort-AV: E=Sophos;i="5.82,310,1613462400"; d="scan'208,223";a="61481030" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 18 May 2021 03:25:12 -0800 IronPort-SDR: VMEUUT+YX9RwRC9djq7iXwvTWJ/i3jrtkarSorScfikTbWm+n6uctnBVvXgBFd6zCSXIZFPZqr aQjrEK82R+OR0I8+yF2GTKB6Ycrc4SUWsEnNApACVT5dbv+mzK7OG2GxMT1ZOk+NVgfW9fXfK+ Ev/pKHE4hu19FoCsLRutuXfLiBQouajzLsbRlITUv6247kmlIv2s1Zuh7qVBhfe1QuqduG5ewr w8ZD7LUrmvP3AsBXclmCgKuSjUg9DbBsLRjnsuMeUprd5zZNWteEURm7GNSVF2swYRsqe77qKc Wqw= From: Thomas Schwinge To: Subject: [libgomp, testsuite] Don't shadow global 'offload_targets' variable (was: [patch, libgomp] Add tests for print from offload target) In-Reply-To: <87h82pmcgq.fsf@euler.schwinge.homeip.net> References: <763f86ad-c8b0-de34-e752-f591a87ea851@codesourcery.com> <20191114170513.GC4650@tucnak> <9a6c8cc3-f963-f872-2602-32de03b57d7d@codesourcery.com> <20191114172239.GD4650@tucnak> <87h82pmcgq.fsf@euler.schwinge.homeip.net> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/27.1 (x86_64-pc-linux-gnu) Date: Tue, 18 May 2021 13:24:57 +0200 Message-ID: <875yzgthbq.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-12.5 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.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jakub Jelinek , Andrew Stubbs , Tobias Burnus Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi! On 2019-11-27T18:54:45+0100, I wrote: > On 2019-11-14T18:22:39+0100, Jakub Jelinek wrote: >> On Thu, Nov 14, 2019 at 05:18:41PM +0000, Andrew Stubbs wrote: >>> On 14/11/2019 17:05, Jakub Jelinek wrote: >>> > On Thu, Nov 14, 2019 at 04:47:49PM +0000, Andrew Stubbs wrote: >>> > > This patch [...] > Note that for libgomp OpenMP testing [...] means FAIL as soon as nvptx > plus possibly any other offload targets are configured, as we will always > compile for all offload targets, as no specific '-foffload' gets passed > -- in contrast to the libgomp OpenACC testing. (Changing that would be a > separate discussion.) > To fix [...], I'm adding > 'check_effective_target_offload_target_nvptx' to generally test whether > "compiling for offload target nvptx", [...] (Later bug-fixed and generalized by Tobias -- thanks, belatedly!) > Committed "Fix 'libgomp.fortran/target-print-1.f90', > 'libgomp.oacc-fortran/print-1.f90' for offload target nvptx" to trunk in > r278779, see attached. > --- a/libgomp/testsuite/lib/libgomp.exp > +++ b/libgomp/testsuite/lib/libgomp.exp > +# Return 1 if compiling for offload target nvptx. > +proc check_effective_target_offload_target_nvptx { } { > + [...] > + if [regexp "(?n)^OFFLOAD_TARGET_NAMES=(.*)" $gcc_output dummy offload_targets] { > + verbose "compiling for offload targets: $offload_targets" > + return [string match "*:nvptx*:*" ":$offload_targets:"] > + } > + [...] > +} As a clean-up (no behavioral change), I've now pushed "[libgomp, testsuite] Don't shadow global 'offload_targets' variable" to master branch in commit b5c3145ad9ac04654d4947d34d1e9dc5c26f4c53, see attached. Grüße Thomas ----------------- Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 München Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Frank Thürauf From b5c3145ad9ac04654d4947d34d1e9dc5c26f4c53 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Mon, 27 Apr 2020 08:22:36 +0200 Subject: [PATCH] [libgomp, testsuite] Don't shadow global 'offload_targets' variable See local 'offload_targets' variable in 'libgomp/testsuite/lib/libgomp.exp:libgomp_check_effective_target_offload_target' vs. global 'libgomp/testsuite/libgomp-test-support.exp.in:offload_targets' variable. libgomp/ * testsuite/lib/libgomp.exp (check_effective_target_offload_target_nvptx): Don't shadow global 'offload_targets' variable. --- libgomp/testsuite/lib/libgomp.exp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp index 46cce9b8445..089c2bba9fc 100644 --- a/libgomp/testsuite/lib/libgomp.exp +++ b/libgomp/testsuite/lib/libgomp.exp @@ -354,9 +354,9 @@ proc libgomp_check_effective_target_offload_target { target_name } { # decides. This is somewhat modelled after # 'gcc/testsuite/lib/target-supports.exp:check_configured_with'. set gcc_output [libgomp_target_compile "" "" "none" $options] - if [regexp "(?n)^OFFLOAD_TARGET_NAMES=(.*)" $gcc_output dummy offload_targets] { - verbose "compiling for offload targets: $offload_targets" - return [string match "*:$target_name*:*" ":$offload_targets:"] + if [regexp "(?n)^OFFLOAD_TARGET_NAMES=(.*)" $gcc_output dummy gcc_offload_targets] { + verbose "compiling for offload targets: $gcc_offload_targets" + return [string match "*:$target_name*:*" ":$gcc_offload_targets:"] } verbose "not compiling for $target_name offload target" -- 2.30.2