From patchwork Thu Dec 15 12:23:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 33609 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp318592wrn; Thu, 15 Dec 2022 04:24:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf7G5YJ6vsi2GBuwCNseJnYNvb519iP1YZ3+sduxUPT2hG1wXL7UKy6EsWQjJW+vefDZenBS X-Received: by 2002:a17:906:c088:b0:7c4:a773:4d72 with SMTP id f8-20020a170906c08800b007c4a7734d72mr7630805ejz.64.1671107091892; Thu, 15 Dec 2022 04:24:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671107091; cv=none; d=google.com; s=arc-20160816; b=BqcdDRMKxu9uycZFeK57Vc7AdczH7w1zlUaAI78NmzxiO1RA4llHCBi0ssSqfKqdR4 N5gPdw/KIlm+lAGVKxqDLKdfTpzN1oAAijp5iplg7De2wHxcxoIjrbLpw95R7pWaLg66 wYlXXTPw/7IDqAIoOejxHomK0vgoJofOeR4i2Lac6K08WFZ7Xju7q4Wg7I0rH6mtEtaj KoZ0zktI0wkbfIlPhR9ZjUIE+jIHQhQiZGkDOrdZEym9X+XdEXbh0nAKEy6qY9Q9ORa7 tLmhNXcNE6vkpg51P5z3M/7PWTEA6BSqAkQDeiGI4GRF6fnx8XnPBBBnoXxvo82DqG4Q 2tIQ== 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:mime-version:message-id:subject:cc:to:date :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=1mqNH8Bm95Er1p4seKkbepaegT4ouYS08awBG82apL0=; b=f4YQdDg7sAgKkL7qk+pmNw2+XFlNtCFL9SNn7qX63cId0k5SOfZ+bJNl20w930iJvT BN7AZ0OdhlKsxixFE6F+rxzyk1DHZNmFCnXfts4gtXQMEkR0G8O+oeRolQ+HtDJsgFt6 km6QEZ/FWKY8eOr78dwRLaMFs2/GEcrAWy3Qdo6J0T/FlsvG2UZQWOeIZk9i7l1iAWHj cn4RWp18imrQu6cPrC3kfrEil1znjt0AZqFi/cBrhIR1T8rVxu1aviuXakG3xmyh36j2 vAWiAX3VJ6AnLmPE2RP7FITyo+aOToApUplJEH6ddmuEgPhwQ3/AButoPisjRvz4d1id PigA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=oiYq59g8; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id ht16-20020a170907609000b0077f92be81adsi14725212ejc.212.2022.12.15.04.24.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 04:24:51 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=oiYq59g8; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 DB224388CF13 for ; Thu, 15 Dec 2022 12:24:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DB224388CF13 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671107090; bh=1mqNH8Bm95Er1p4seKkbepaegT4ouYS08awBG82apL0=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=oiYq59g8UIqleg7GKdeP0bHLpLqIo/Wsr+C4MtzTJWTbe7Y1EHVgejJURVyWUtDgA mDCYalCvU0WXLdDq+AMdNmXLo+x9WYWIOhqOPlj1SM5uWxu0CgrP6Z9AE8CRV9dpTV /zph4ygPYlJ9XeQtfZXYl3+CdvHFM2r3dT6Vk3Ig= 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.133.124]) by sourceware.org (Postfix) with ESMTPS id 8361F388CA61 for ; Thu, 15 Dec 2022 12:24:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8361F388CA61 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-216-LvpEeJhPNXyn_G1Gwq_Q3w-1; Thu, 15 Dec 2022 07:24:03 -0500 X-MC-Unique: LvpEeJhPNXyn_G1Gwq_Q3w-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C5F5685D061; Thu, 15 Dec 2022 12:24:02 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.195.114]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7BA771121314; Thu, 15 Dec 2022 12:24:02 +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 2BFCNvUu3315949 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 15 Dec 2022 13:23:57 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 2BFCNokg3315948; Thu, 15 Dec 2022 13:23:50 +0100 Date: Thu, 15 Dec 2022 13:23:49 +0100 To: Richard Biener , Arthur Cohen , Gaius Mulley Cc: gcc-patches@gcc.gnu.org, gcc-rust@gcc.gnu.org Subject: [PATCH] testsuite: Add support for Rust and Modula-2 effective target tests Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.5 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=unavailable 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?1752282789910325443?= X-GMAIL-MSGID: =?utf-8?q?1752282789910325443?= Hi! This patch allows magic comments also for Rust and Modula-2 for effective target tests etc. and fixes up the Assembly entry - it is a glob, so /* Assembly can match /whatever Assembly and not just /* Assembly. Tested on x86_64-linux with make check-g++ RUNTESTFLAGS=i386.exp=pr35513* and verifying it still uses *.S extension for the property_1_needed effective target test. Ok for trunk? 2022-12-15 Jakub Jelinek * lib/target-supports.exp (check_compile): Add support for Rust and Modula-2. Use \* rather than * for /* comment for Assembly. Jakub --- gcc/testsuite/lib/target-supports.exp.jj 2022-11-30 10:29:42.217698938 +0100 +++ gcc/testsuite/lib/target-supports.exp 2022-12-15 13:08:47.941221943 +0100 @@ -36,7 +36,9 @@ # "! Fortran" for Fortran code, # "/* ObjC", for ObjC # "// ObjC++" for ObjC++ -# and "// Go" for Go +# "// Go" for Go +# "// Rust" for Rust +# and "(* Modula-2" for Modula-2 # If the tool is ObjC/ObjC++ then we overide the extension to .m/.mm to # allow for ObjC/ObjC++ specific flags. @@ -58,13 +60,15 @@ proc check_compile {basename type conten set options "" } switch -glob -- $contents { - "*/* Assembly*" { set src ${basename}[pid].S } + "*/\* Assembly*" { set src ${basename}[pid].S } "*! Fortran*" { set src ${basename}[pid].f90 } "*// C++*" { set src ${basename}[pid].cc } "*// D*" { set src ${basename}[pid].d } "*// ObjC++*" { set src ${basename}[pid].mm } "*/* ObjC*" { set src ${basename}[pid].m } "*// Go*" { set src ${basename}[pid].go } + "*// Rust*" { set src ${basename}[pid].rs } + "*(\* Modula-2*" { set src ${basename}[pid].mod } default { switch -- $tool { "objc" { set src ${basename}[pid].m }