From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH][gdb/testsuite] Skip gdb.fortran/namelist.exp for gfortran 4.8
Date: Fri, 10 Jun 2022 09:10:54 +0200 [thread overview]
Message-ID: <20220610071051.GA16173@delia.home> (raw)
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?
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
next reply other threads:[~2022-06-10 7:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-10 7:10 Tom de Vries [this message]
2022-06-28 15:12 ` [committed][gdb/testsuite] " Tom de Vries
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220610071051.GA16173@delia.home \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).