From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677161900; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=wruwS0YInUrn84ZPk8T9IPtbpf+2cJDUpGTy8t68IcI=; b=R+OY0Ph2mbvBbe0LcfZLQCzC/q/AA3PjhTey0U2PAhi9uzDDAw56L8EFz4O4ShMKlR1Vbw kVfyzd489OcHKzjgIeZBkPnQ73Ma0ovFCAiVyPExaGnnw2zV2CcYL54vOOL2qSCu42gQUQ M9Q+s0NAO60cZVCQHJgeRu6IjeLEkwc= 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 From: Jakub Jelinek 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: Reply-To: Jakub Jelinek 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-Type: text/plain; charset=us-ascii 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 List-Id: 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. --- 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 Jakub