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.133.124]) by sourceware.org (Postfix) with ESMTPS id B1DEA388CA60 for ; Thu, 15 Dec 2022 12:24:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B1DEA388CA60 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=1671107046; 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; bh=1mqNH8Bm95Er1p4seKkbepaegT4ouYS08awBG82apL0=; b=cTUqlEEGkruIjsx55U8hyopj+fJQvW5Njlj46XTvhRBcdk/hsabYfG5e1WYEwXVRTHm/O/ AHkPoQmMdWz4QYcrfUETqsfgv2efPc0cmKvvJOb1ALY5ix6w1ck1AfiUCQwUgWQRFP7EhA CZy54gE+0jTNJGQf4lX0fcbNKHgxui0= 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 From: Jakub Jelinek 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: Reply-To: Jakub Jelinek 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=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! 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. --- 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