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: 61004 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp337443wrd; Thu, 23 Feb 2023 06:19:43 -0800 (PST) X-Google-Smtp-Source: AK7set+wXpjCnjqBLlFEIvSem+zqHtYckWC6LArjLGz+jB2SWVBg86FKshVjTWbl3hKvOPZobXly X-Received: by 2002:a17:906:4b11:b0:87e:9441:4c6c with SMTP id y17-20020a1709064b1100b0087e94414c6cmr21822722eju.49.1677161983643; Thu, 23 Feb 2023 06:19:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677161983; cv=none; d=google.com; s=arc-20160816; b=eovUIGOFGjSlQ2NMcuigOHiWxT1+oJW6IsmdrRsd7pJFYt9cO52lyHJ2WjaHEFC1oZ /gUEOy8X4Yo+iqEIa736COkcZzxCfIqAiLk84RxQUGbmOgGhROEhOiN+c0BqBIA4VeFY bhgDqHx4wPvcGYdt31HBqgw6psHhA8ovVKjFOW2q6cCgPQJWyyjo8SoK2msNP2xlRZyd V2LMXrq11Ee5Y+OXGjpLm1PG+wdu6mrk2rSe9btu4RxHnJ/aOPDSPQWhxtT3I5J6Zqye u016J/qDvyK3aInc031SZxRmdAfMrpn7ykCjfwd9JSf/GGA1i7XV/s3o2OlpK7ClVGZJ xiMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-disposition:in-reply-to:mime-version:references:message-id :subject:cc:to:date:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=wruwS0YInUrn84ZPk8T9IPtbpf+2cJDUpGTy8t68IcI=; b=JbVAX9z0atieHDAfpZuiJjceezXwS2svHCSuPafLgstWhpSh6w1qGxiYtQNxaytGNy Q5t85vy/UXuSTJQiwHd709SvElGKWDf0tK6w0PNrE50XDrXW+CIBi7EcQq71WHz8UeuT TU4l0M7VTOXbsbdLTmy9/qZHa1Q//aXdVkoC9GJyLTh+vcmNnZExkxz1pYWk7EjlFrBU bRB0BK2f7woSPEWIPh87m5/NdWIBrwRPQjp53yg1i3FZrNdN+YfqqqUUpF0sLHG25UKk NeakpG/fS1BzUZf+yWAWklzgCWIT/WIREuICAbPETxagTpF74PPyEeWatXLiFdgu4CH4 KoTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=V4iSAATB; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id t15-20020a05640203cf00b004aaa505ac5fsi12602049edw.76.2023.02.23.06.19.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Feb 2023 06:19:43 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=V4iSAATB; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 73904385828D for ; Thu, 23 Feb 2023 14:19:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 73904385828D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677161982; 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=V4iSAATBQnHWQUKUu8enWdVXMQ1lqGoKy6/D0QPVGxWauJn+57obbPYAqeMUelm/s q3AmLe35xksz1462X2c+jnVvmvylesu9ggtasOE3p/xN5oGRzzTXJL9ETuT1113Pha Wiw9hTJAHaPvW9Gaoeuk/R0M2DzjU6tOpprdU7xc= 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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758631804265983578?= X-GMAIL-MSGID: =?utf-8?q?1758631804265983578?= 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