From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by sourceware.org (Postfix) with ESMTPS id 6F158384A872 for ; Fri, 18 Nov 2022 08:14:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6F158384A872 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-x22d.google.com with SMTP id h12so5831370ljg.9 for ; Fri, 18 Nov 2022 00:14:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=/KQ6FdgSrcMuBc8uZThH3gKNgaEH2OxtdFlM92ZkdpY=; b=nK0xiUuVIZ8WvbVIEqrXSBus20JevoHaRKMn/Q7oweg2nUn+nyAsIk++DvGIcREuht SA6tBl0psEJIlF4CRfHA8Wg8d+W0491nlC/xXAX3Hr4LeGIlwkfGjDbKwrAJ47+1hGkR e+E5I0aPCb7BU1S8XXwAR7E+JrvmQa+XBDdr8LV6agcjWCmb+p5A7rAP2KssDPeOnDwh s+wDeLbeZPOqO22VF/MNL9b52eRfcXKi5fwzGVyMjiWk4MrZ0c5eXY0mMcZWrBnaD/iD gb5WqNBmH0/DYjNvt/69z63gadocR7dxnXUo6fAKUKbp9z6TMNu/4Aa1fLmos/CWA4nU P3FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/KQ6FdgSrcMuBc8uZThH3gKNgaEH2OxtdFlM92ZkdpY=; b=v/VVoohaV/iWJJwM+tOWSK3iZQFI4yYtd9vyBYI3Ak5mhbT8S81LrhlgHh5Cnkk1at aBU7d+ZysVmsRkGHSUn/bSNN+U/dOJXm0CBW2ehtcQfO8Iy/NYYqyLKT5MSo/LalJn9k EvDpSAN8vnHzSfDDDfaMTIGWTvxTgJvAwXCnfQTp0qWYqNKzPqMVEl799TDVqSdirXEd +5SHWTdtdtZM3rfuPpZE8C7YRlahhgTlG56/E8vp4t8pCDpd5uSEcMI8IBIJpsAoVZQT jgn7fv4yDXsUO16hFxLEiJAwrU19zYY9OXb002kpPApY/coQ3TbkPkTPPZs3ikQUe9C/ sIIw== X-Gm-Message-State: ANoB5pl2EG47XaL6GGZpEyxO3NFrExH5MGSITTBITbSv58X1TXJi0iI/ EKsk90Nbh3fhmWYEodvbYb6u+zA+BvuXi1ylZyo= X-Google-Smtp-Source: AA0mqf5nhoi3PovEOXCL4K3keyAD07ASpX9Z7LR95ID4rjcDpYi+VO3i5nijLBDK2bLoWDi4nnmimr2+G/bQVb8XYl8= X-Received: by 2002:a2e:b11c:0:b0:261:d86f:3cde with SMTP id p28-20020a2eb11c000000b00261d86f3cdemr2309083ljl.86.1668759279656; Fri, 18 Nov 2022 00:14:39 -0800 (PST) MIME-Version: 1.0 References: <20220923120331.4136741-1-torbjorn.svensson@foss.st.com> <7e6bb5c3-3fae-6cfd-e0e1-8e295045f4b7@foss.st.com> <854beb3d-7553-af23-cd38-819cabf21896@foss.st.com> <81cd87f1-8125-faf4-1617-f00b230720ed@foss.st.com> In-Reply-To: <81cd87f1-8125-faf4-1617-f00b230720ed@foss.st.com> From: Richard Biener Date: Fri, 18 Nov 2022 09:14:26 +0100 Message-ID: Subject: Re: PING^5 [PATCH] testsuite: Verify that module-mapper is available To: Torbjorn SVENSSON Cc: gcc-patches@gcc.gnu.org, richard.earnshaw@arm.com, nathan@acm.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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: On Thu, Nov 17, 2022 at 6:09 PM Torbjorn SVENSSON via Gcc-patches wrote: > > Hi, > > Ping, https://gcc.gnu.org/pipermail/gcc-patches/2022-November/604895.html > > Ok for trunk? OK. > Kind regards, > Torbj=C3=B6rn > > On 2022-11-02 19:13, Torbjorn SVENSSON wrote: > > Hi, > > > > Ping, https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602844.htm= l > > > > Ok for trunk? > > > > Kind regards, > > Torbj=C3=B6rn > > > > On 2022-10-25 16:24, Torbjorn SVENSSON via Gcc-patches wrote: > >> Hi, > >> > >> Ping, https://gcc.gnu.org/pipermail/gcc-patches/2022-October/603544.ht= ml > >> > >> Kind regards, > >> Torbj=C3=B6rn > >> > >> On 2022-10-14 09:42, Torbjorn SVENSSON wrote: > >>> Hi, > >>> > >>> Ping, https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602843.h= tml > >>> > >>> Kind regards, > >>> Torbj=C3=B6rn > >>> > >>> On 2022-10-05 11:17, Torbjorn SVENSSON wrote: > >>>> Hi, > >>>> > >>>> Ping, > >>>> https://gcc.gnu.org/pipermail/gcc-patches/2022-September/602111.html > >>>> > >>>> Kind regards, > >>>> Torbj=C3=B6rn > >>>> > >>>> On 2022-09-23 14:03, Torbj=C3=B6rn SVENSSON wrote: > >>>>> For some test cases, it's required that the optional module mapper > >>>>> "g++-mapper-server" is built. As the server is not required, the > >>>>> test cases will fail if it can't be found. > >>>>> > >>>>> gcc/testsuite/ChangeLog: > >>>>> > >>>>> * lib/target-supports.exp (check_is_prog_name_available): > >>>>> New. > >>>>> * lib/target-supports-dg.exp > >>>>> (dg-require-prog-name-available): New. > >>>>> * g++.dg/modules/modules.exp: Verify avilability of module > >>>>> mapper. > >>>>> > >>>>> Signed-off-by: Torbj=C3=B6rn SVENSSON > >>>>> --- > >>>>> gcc/testsuite/g++.dg/modules/modules.exp | 31 > >>>>> ++++++++++++++++++++++++ > >>>>> gcc/testsuite/lib/target-supports-dg.exp | 15 ++++++++++++ > >>>>> gcc/testsuite/lib/target-supports.exp | 15 ++++++++++++ > >>>>> 3 files changed, 61 insertions(+) > >>>>> > >>>>> diff --git a/gcc/testsuite/g++.dg/modules/modules.exp > >>>>> b/gcc/testsuite/g++.dg/modules/modules.exp > >>>>> index afb323d0efd..4784803742a 100644 > >>>>> --- a/gcc/testsuite/g++.dg/modules/modules.exp > >>>>> +++ b/gcc/testsuite/g++.dg/modules/modules.exp > >>>>> @@ -279,6 +279,29 @@ proc module-init { src } { > >>>>> return $option_list > >>>>> } > >>>>> +# Return 1 if requirements are met > >>>>> +proc module-check-requirements { tests } { > >>>>> + foreach test $tests { > >>>>> + set tmp [dg-get-options $test] > >>>>> + foreach op $tmp { > >>>>> + switch [lindex $op 0] { > >>>>> + "dg-additional-options" { > >>>>> + # Example strings to match: > >>>>> + # -fmodules-ts -fmodule-mapper=3D|@g++-mapper-server\\ > >>>>> -t\\ [srcdir]/inc-xlate-1.map > >>>>> + # -fmodules-ts -fmodule-mapper=3D|@g++-mapper-server > >>>>> + if [regexp -- {(^| )-fmodule-mapper=3D\|@([^\\ ]*)} > >>>>> [lindex $op 2] dummy dummy2 prog] { > >>>>> + verbose "Checking that mapper exist: $prog" > >>>>> + if { ![ check_is_prog_name_available $prog ] } { > >>>>> + return 0 > >>>>> + } > >>>>> + } > >>>>> + } > >>>>> + } > >>>>> + } > >>>>> + } > >>>>> + return 1 > >>>>> +} > >>>>> + > >>>>> # cleanup any detritus from previous run > >>>>> cleanup_module_files [find $DEFAULT_REPO *.gcm] > >>>>> @@ -307,6 +330,14 @@ foreach src [lsort [find $srcdir/$subdir > >>>>> {*_a.[CHX}]] { > >>>>> set tests [lsort [find [file dirname $src] \ > >>>>> [regsub {_a.[CHX]$} [file tail $src] > >>>>> {_[a-z].[CHX]}]]] > >>>>> + if { ![module-check-requirements $tests] } { > >>>>> + set testcase [regsub {_a.[CH]} $src {}] > >>>>> + set testcase \ > >>>>> + [string range $testcase [string length "$srcdir/"] end] > >>>>> + unsupported $testcase > >>>>> + continue > >>>>> + } > >>>>> + > >>>>> set std_list [module-init $src] > >>>>> foreach std $std_list { > >>>>> set mod_files {} > >>>>> diff --git a/gcc/testsuite/lib/target-supports-dg.exp > >>>>> b/gcc/testsuite/lib/target-supports-dg.exp > >>>>> index aa2164bc789..6ce3b2b1a1b 100644 > >>>>> --- a/gcc/testsuite/lib/target-supports-dg.exp > >>>>> +++ b/gcc/testsuite/lib/target-supports-dg.exp > >>>>> @@ -683,3 +683,18 @@ proc dg-require-symver { args } { > >>>>> set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"] > >>>>> } > >>>>> } > >>>>> + > >>>>> +# If this target does not provide prog named "$args", skip this te= st. > >>>>> + > >>>>> +proc dg-require-prog-name-available { args } { > >>>>> + # The args are within another list; pull them out. > >>>>> + set args [lindex $args 0] > >>>>> + > >>>>> + set prog [lindex $args 1] > >>>>> + > >>>>> + if { ![ check_is_prog_name_available $prog ] } { > >>>>> + upvar dg-do-what dg-do-what > >>>>> + set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"] > >>>>> + } > >>>>> +} > >>>>> + > >>>>> diff --git a/gcc/testsuite/lib/target-supports.exp > >>>>> b/gcc/testsuite/lib/target-supports.exp > >>>>> index 703aba412a6..c3b7a6c17b3 100644 > >>>>> --- a/gcc/testsuite/lib/target-supports.exp > >>>>> +++ b/gcc/testsuite/lib/target-supports.exp > >>>>> @@ -11928,3 +11928,18 @@ main: > >>>>> .byte 0 > >>>>> } ""] > >>>>> } > >>>>> + > >>>>> +# Return 1 if this target has prog named "$prog", 0 otherwise. > >>>>> + > >>>>> +proc check_is_prog_name_available { prog } { > >>>>> + global tool > >>>>> + > >>>>> + set options [list "additional_flags=3D-print-prog-name=3D$prog= "] > >>>>> + set output [lindex [${tool}_target_compile "" "" "none" > >>>>> $options] 0] > >>>>> + > >>>>> + if { $output =3D=3D $prog } { > >>>>> + return 0 > >>>>> + } > >>>>> + > >>>>> + return 1 > >>>>> +}