aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2023-08-28 23:42:11 +0200
committerTom de Vries <tdevries@suse.de>2023-08-28 23:42:11 +0200
commit0789a13f8af55f58cb97ca7d61fe0480512728c3 (patch)
tree3e29d3935e80aa8987a7f80f11fecae00a58fd2a
parentb3e174482ffd731ab9a990aa233656b7427f8c61 (diff)
downloadgdb-0789a13f8af55f58cb97ca7d61fe0480512728c3.zip
gdb-0789a13f8af55f58cb97ca7d61fe0480512728c3.tar.gz
gdb-0789a13f8af55f58cb97ca7d61fe0480512728c3.tar.bz2
[gdb/testsuite] Improve xfail in gdb.cp/nsusing.exp
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. Approved-By: Tom Tromey <tom@tromey.com>
-rw-r--r--gdb/testsuite/gdb.cp/nsusing.exp20
1 files changed, 16 insertions, 4 deletions
diff --git a/gdb/testsuite/gdb.cp/nsusing.exp b/gdb/testsuite/gdb.cp/nsusing.exp
index f34910b..d44e389 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"