public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH] [gdb/testsuite] Improve xfail in gdb.cp/nsusing.exp
Date: Mon, 28 Aug 2023 14:12:53 +0200	[thread overview]
Message-ID: <20230828121253.8127-1-tdevries@suse.de> (raw)

In test-case gdb.cp/nsusing.exp I came across these xfails without PRMS
mentioned:
...
XFAIL: gdb.cp/nsusing.exp: print x, before using statement
XFAIL: gdb.cp/nsusing.exp: print x, only using M
...

Add the missing PRMS, such that we have:
...
XFAIL: gdb.cp/nsusing.exp: print x, before using statement (PRMS gcc/108716)
XFAIL: gdb.cp/nsusing.exp: print x, only using M (PRMS gcc/108716)
...
and limit the xfail to unfixed versions.

The PR is fixed starting gcc 13, but it has been backported to release
branches stretching back to gcc 10.  For simplicity we just stick to testing
for the major version and ignore the backported fixes.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.cp/nsusing.exp | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/gdb/testsuite/gdb.cp/nsusing.exp b/gdb/testsuite/gdb.cp/nsusing.exp
index f34910bac0d..d44e389a8bb 100644
--- a/gdb/testsuite/gdb.cp/nsusing.exp
+++ b/gdb/testsuite/gdb.cp/nsusing.exp
@@ -122,14 +122,23 @@ if { [test_compiler_info {gcc-[0-3]-*}] ||
     return
 }
 
+# Xfail for incorrect decl_line on DW_TAG_imported_module,
+# gcc PR debug/108716.
+set have_gcc108716_xfail \
+    [expr [test_compiler_info gcc-*] && [gcc_major_version] < 13]
+
 gdb_test_multiple "print x" "print x, before using statement" {
     -re -wrap "No symbol .x. in current context.*" {
 	pass $gdb_test_name
     }
     -re -wrap "Reference to .x. is ambiguous.*" {
-	# GCC doesn't properly set the decl_line for namespaces, so GDB believes
-	# that the "using namespace M" line has already passed at this point.
-	xfail $gdb_test_name
+	if { $have_gcc108716_xfail } {
+	    # GCC doesn't properly set the decl_line for namespaces, so GDB
+	    # believes that the "using namespace M" line has already passed at
+	    # this point.
+	    setup_xfail *-*-* gcc/108716
+	}
+	fail $gdb_test_name
     }
 }
 gdb_test "next" ".*" "using namespace M"
@@ -138,7 +147,10 @@ gdb_test_multiple "print x" "print x, only using M" {
 	pass $gdb_test_name
     }
     -re -wrap "Reference to .x. is ambiguous.*" {
-	xfail $gdb_test_name
+	if { $have_gcc108716_xfail } {
+	    setup_xfail *-*-* gcc/108716
+	}
+	fail $gdb_test_name
     }
 }
 gdb_test "next" ".*" "using namespace N"

base-commit: f5362c933e2280398d7aea3cc0748bec8f66a1ab
-- 
2.35.3


             reply	other threads:[~2023-08-28 12:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-28 12:12 Tom de Vries [this message]
2023-08-28 14:19 ` Tom Tromey

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=20230828121253.8127-1-tdevries@suse.de \
    --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).