Message ID | Y5sR1W/p4K0CEMRU@tucnak |
---|---|
State | New |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A926F388CA78 for <patchwork@sourceware.org>; Thu, 15 Dec 2022 12:24:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A926F388CA78 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671107075; bh=1mqNH8Bm95Er1p4seKkbepaegT4ouYS08awBG82apL0=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=tqu5vWnTzTLPFCAvVQvwwnNYze5O0b6/3nMyep254+dxYvQNIAmLpj2sPdO3QC5hY kzXuJ0pvT8Xgm79ugDC5fe3Q81tHHeeYmjK1/nEMhK57J3KLNIO6UsONROtbu0OBYu cAi6R8KiLeJNtn0eUK89DBFAZH/CXLmnwDBho0QY= 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 <gcc-patches@gcc.gnu.org>; 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 <rguenther@suse.de>, Arthur Cohen <arthur.cohen@embecosm.com>, Gaius Mulley <gaiusmod2@gmail.com> 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: <Y5sR1W/p4K0CEMRU@tucnak> 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-Type: text/plain; charset=us-ascii 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Jakub Jelinek via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Jakub Jelinek <jakub@redhat.com> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
testsuite: Add support for Rust and Modula-2 effective target tests
|
|
Commit Message
Jakub Jelinek
Dec. 15, 2022, 12:23 p.m. UTC
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 <jakub@redhat.com> * lib/target-supports.exp (check_compile): Add support for Rust and Modula-2. Use \* rather than * for /* comment for Assembly. Jakub
Comments
On Thu, 15 Dec 2022, Jakub Jelinek wrote: > 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? OK. Thanks, Richard. > 2022-12-15 Jakub Jelinek <jakub@redhat.com> > > * lib/target-supports.exp (check_compile): Add support for > Rust and Modula-2. Use \* rather than * for /* comment for > Assembly. > > --- 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 } > > Jakub > >
Hi Jakub, On 12/15/22 13:23, Jakub Jelinek wrote: > 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 <jakub@redhat.com> > > * lib/target-supports.exp (check_compile): Add support for > Rust and Modula-2. Use \* rather than * for /* comment for > Assembly. > > --- 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 } > > Jakub > LGTM :) Thank you, Arthur
On Dez 15 2022, Jakub Jelinek via Gcc-rust wrote: > @@ -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 } That's a no-op. Either double the backslash or quote with {} instead of "".
On Dez 15 2022, Jakub Jelinek via Gcc-rust wrote: > @@ -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 } You probably want to quote the * here too.
On Thu, Dec 15, 2022 at 02:03:36PM +0100, Andreas Schwab wrote: > On Dez 15 2022, Jakub Jelinek via Gcc-rust wrote: > > > @@ -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 } > > You probably want to quote the * here too. You're right on both, I've committed this follow-up after verifying that Assembly test still works (it works even with \\\* but doesn't with \\\\*) and verifying that changing check_effective_target_property_1_needed to have // Assembly instead of /* Assembly incorrectly works with "*/* Assembly*", "*/\* Assembly*" but correctly doesn't work with "*/\\* Assembly*" or "*/\\\* Assembly*". Committed to trunk. Sorry. 2022-12-15 Jakub Jelinek <jakub@redhat.com> * lib/target-supports.exp (check_compile): Further quoting fixes for /* Assembly, /* ObjC and (* Modula-2 *) checks. --- gcc/testsuite/lib/target-supports.exp.jj 2022-12-15 13:57:40.000000000 +0100 +++ gcc/testsuite/lib/target-supports.exp 2022-12-15 14:14:02.987854385 +0100 @@ -60,15 +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 } + "*/\\* 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 } + "*(\\* Modula-2*" { set src ${basename}[pid].mod } default { switch -- $tool { "objc" { set src ${basename}[pid].m } 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 }