public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] [gdb/testsuite] Improve xfail in gdb.cp/nsusing.exp
@ 2023-08-28 12:12 Tom de Vries
  2023-08-28 14:19 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Tom de Vries @ 2023-08-28 12:12 UTC (permalink / raw)
  To: gdb-patches

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] [gdb/testsuite] Improve xfail in gdb.cp/nsusing.exp
  2023-08-28 12:12 [PATCH] [gdb/testsuite] Improve xfail in gdb.cp/nsusing.exp Tom de Vries
@ 2023-08-28 14:19 ` Tom Tromey
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2023-08-28 14:19 UTC (permalink / raw)
  To: Tom de Vries via Gdb-patches; +Cc: Tom de Vries

>>>>> "Tom" == Tom de Vries via Gdb-patches <gdb-patches@sourceware.org> writes:

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

Seems fine to me.
Approved-By: Tom Tromey <tom@tromey.com>

Tom

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-28 19:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-28 12:12 [PATCH] [gdb/testsuite] Improve xfail in gdb.cp/nsusing.exp Tom de Vries
2023-08-28 14:19 ` Tom Tromey

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).