From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 13A8E3872A87 for ; Tue, 28 Jun 2022 15:12:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 13A8E3872A87 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 43B6821F89 for ; Tue, 28 Jun 2022 15:12:05 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 316F913ACA for ; Tue, 28 Jun 2022 15:12:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id VlCtCkUau2IAbwAAMHmgww (envelope-from ) for ; Tue, 28 Jun 2022 15:12:05 +0000 Message-ID: <8adcdc74-0a77-69e7-c69a-b3ade1187eca@suse.de> Date: Tue, 28 Jun 2022 17:12:04 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: [committed][gdb/testsuite] Skip gdb.fortran/namelist.exp for gfortran 4.8 Content-Language: en-US From: Tom de Vries To: gdb-patches@sourceware.org References: <20220610071051.GA16173@delia.home> In-Reply-To: <20220610071051.GA16173@delia.home> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jun 2022 15:12:07 -0000 On 6/10/22 09:10, Tom de Vries wrote: > Hi, > > The test-case gdb.fortran/namelist.exp uses a gfortran feature (emitting > DW_TAG_namelist in the debug info) that has been supported since gfortran 4.9, > see PR gcc/37132. > > Skip the test for gfortran 4.8 and earlier. Do this using gcc_major_version, > and update it to be able to handle "gcc_major_version {gfortran-*} f90". > > Tested on x86_64-linux, with gfortran 4.8.5, 7.5.0, and 12.1.1. > > Any comments? Committed. Thanks, - Tom > [gdb/testsuite] Skip gdb.fortran/namelist.exp for gfortran 4.8 > > --- > gdb/testsuite/gdb.fortran/namelist.exp | 6 +++++- > gdb/testsuite/lib/gdb.exp | 10 +++++++--- > 2 files changed, 12 insertions(+), 4 deletions(-) > > diff --git a/gdb/testsuite/gdb.fortran/namelist.exp b/gdb/testsuite/gdb.fortran/namelist.exp > index 3917f1b9adb..39cf0e17654 100644 > --- a/gdb/testsuite/gdb.fortran/namelist.exp > +++ b/gdb/testsuite/gdb.fortran/namelist.exp > @@ -37,7 +37,11 @@ set int [fortran_int4] > gdb_breakpoint [gdb_get_line_number "Display namelist"] > gdb_continue_to_breakpoint "Display namelist" > > -if { [test_compiler_info {gfortran-*} f90] } { > +# DW_TAG_namelist is supported starting gcc 4.9. > +set supported [expr \ > + [test_compiler_info {gfortran-*} f90] \ > + && [gcc_major_version {gfortran-*} f90] >= 4.9] > +if { $supported } { > gdb_test "ptype nml" \ > "type = Type nml\r\n *$int :: a\r\n *$int :: b\r\n *End Type nml" > gdb_test "print nml" \ > diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp > index e8214e65a8b..41e1d549510 100644 > --- a/gdb/testsuite/lib/gdb.exp > +++ b/gdb/testsuite/lib/gdb.exp > @@ -4228,13 +4228,17 @@ proc test_compiler_info { {compiler ""} {language "c"} } { > # Return the gcc major version, or -1. > # For gcc 4.8.5, the major version is 4.8. > # For gcc 7.5.0, the major version 7. > +# The COMPILER and LANGUAGE arguments are as for test_compiler_info. > > -proc gcc_major_version { } { > +proc gcc_major_version { {compiler "gcc-*"} {language "c"} } { > global decimal > - if { ![test_compiler_info "gcc-*"] } { > + if { ![test_compiler_info $compiler $language] } { > return -1 > } > - set res [regexp gcc-($decimal)-($decimal)- [test_compiler_info] \ > + # Strip "gcc-*" to "gcc". > + regsub -- {-.*} $compiler "" compiler > + set res [regexp $compiler-($decimal)-($decimal)- \ > + [test_compiler_info "" $language] \ > dummy_var major minor] > if { $res != 1 } { > return -1