From patchwork Thu Feb 23 14:18:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1746993 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=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=fK+NZ3wo; dkim-atps=neutral Received: from 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 (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PMwBf1Vqkz23yr for ; Fri, 24 Feb 2023 01:19:20 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A7463385843D for ; Thu, 23 Feb 2023 14:19:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A7463385843D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677161958; bh=wruwS0YInUrn84ZPk8T9IPtbpf+2cJDUpGTy8t68IcI=; h=Date:To:Cc:Subject:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=fK+NZ3wonRq0AtFgPZPP1WMfVzDd8FmD0nh5qBzRcsH66r2TFmRYTrxrdsY3aR2A9 xDXdywH/Ft/WOvzc5jb/E4tZkR7Ugf6aKsb7j2nGaUdGO9v62QBSb8sLMituwVqIs7 m6Ov+NWCkjLLFJNIU/6MN2ivx56oi4M+klshVSSY= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 46C343857C5A for ; Thu, 23 Feb 2023 14:18:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 46C343857C5A Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-593-voUASkkQOueF9XuizzCZaw-1; Thu, 23 Feb 2023 09:18:17 -0500 X-MC-Unique: voUASkkQOueF9XuizzCZaw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9E52B3C025B0; Thu, 23 Feb 2023 14:18:16 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.62]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 55D18492C14; Thu, 23 Feb 2023 14:18:16 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 31NEI7eA557626 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 23 Feb 2023 15:18:08 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 31NEI4fo557624; Thu, 23 Feb 2023 15:18:04 +0100 Date: Thu, 23 Feb 2023 15:18:04 +0100 To: Richard Biener , Jason Merrill , Alexandre Oliva , ro@cebitec.uni-bielefeld.de, mikestump@comcast.net Cc: gcc-patches@gcc.gnu.org, nathan@acm.org Subject: [PATCH] testsuite: Fix up modules.exp [PR108899] Message-ID: References: <00f5cbe1-05b7-0e42-0b46-1e36d1e4e8b3@redhat.com> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jakub Jelinek via Gcc-patches From: Jakub Jelinek Reply-To: Jakub Jelinek Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Hi! On Wed, Feb 22, 2023 at 02:33:42PM -0300, Alexandre Oliva via Gcc-patches wrote: > When a multi-source module is found to be unsupported, we fail > module_cmi_p and subsequent sources. Override proc unsupported to > mark the result in module_do, and test it to skip module_cmp_p and > subsequent related tests. > > for gcc/testsuite/ChangeLog > > * g++.dg/modules/modules.exp: Override unsupported to update > module_do, and test it after dg-test. This patch breaks testing with more than one set of options in target board, like make check-g++ RUNTESTFLAGS='--target_board=unix\{-m32,-m64\} modules.exp' yields: ... === g++ Summary for unix/-m32 === # of expected passes 7217 # of unexpected failures 1 # of expected failures 18 # of unsupported tests 2 Running target unix/-m64 ... ERROR: tcl error sourcing /home/jakub/src/gcc/gcc/testsuite/g++.dg/modules/modules.exp. ERROR: tcl error code TCL OPERATION RENAME TARGET_EXISTS ERROR: can't rename to "saved-unsupported": command already exists while executing "rename unsupported saved-unsupported" (file "/home/jakub/src/gcc/gcc/testsuite/g++.dg/modules/modules.exp" line 322) invoked from within "source /home/jakub/src/gcc/gcc/testsuite/g++.dg/modules/modules.exp" ("uplevel" body line 1) invoked from within "uplevel #0 source /home/jakub/src/gcc/gcc/testsuite/g++.dg/modules/modules.exp" invoked from within "catch "uplevel #0 source $test_file_name" msg" In other spots where we in *.exp files rename some routine, we guard that and the following patch does that for modules.exp too. Tested with running make check-g++ RUNTESTFLAGS='--target_board=unix\{-m32,-m64\} modules.exp' again which now works properly again. Ok for trunk? 2023-02-23 Jakub Jelinek PR testsuite/108899 * g++.dg/modules/modules.exp: Only override unsupported if it exists and saved-unsupported doesn't. Jakub --- gcc/testsuite/g++.dg/modules/modules.exp.jj 2023-02-22 20:50:34.208421799 +0100 +++ gcc/testsuite/g++.dg/modules/modules.exp 2023-02-23 13:07:40.207320104 +0100 @@ -319,11 +319,15 @@ cleanup_module_files [find $DEFAULT_REPO # so that, after an unsupported result in dg-test, we can skip rather # than fail subsequent related tests. set module_do {"compile" "P"} -rename unsupported saved-unsupported -proc unsupported { args } { - global module_do - lset module_do 1 "N" - return [saved-unsupported $args] +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] + } } # not grouped tests, sadly tcl doesn't have negated glob