aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2024-09-21 06:12:40 +0200
committerTom de Vries <tdevries@suse.de>2024-09-21 06:12:40 +0200
commitaf7dd4aac93e5d4a18080805f5ddd81fb0c29511 (patch)
tree70892f1d3c7bb8f3702455bea7133c1f6f816bb1
parent4a8a2d17999cd2b19cb568e240b208e94c428c8f (diff)
downloadbinutils-af7dd4aac93e5d4a18080805f5ddd81fb0c29511.zip
binutils-af7dd4aac93e5d4a18080805f5ddd81fb0c29511.tar.gz
binutils-af7dd4aac93e5d4a18080805f5ddd81fb0c29511.tar.bz2
[gdb/testsuite] Limit xfail in gdb.ada/call_pn.exp
Test-case gdb.ada/call_pn.exp contains an unconditional xfail, which is only necessary for gcc 8 and 9. Fix this by limiting the xfail to those releases. Tested on x86_64-linux. Approved-By: Tom Tromey <tom@tromey.com>
-rw-r--r--gdb/testsuite/gdb.ada/call_pn.exp13
1 files changed, 11 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.ada/call_pn.exp b/gdb/testsuite/gdb.ada/call_pn.exp
index 5453dd4..9114d30 100644
--- a/gdb/testsuite/gdb.ada/call_pn.exp
+++ b/gdb/testsuite/gdb.ada/call_pn.exp
@@ -37,6 +37,9 @@ if {![runto "foo.adb:$bp_location"]} {
# print.
gdb_test_no_output {maint expand-symtabs "\(pck\|foo\)\.adb"}
+set gcc_major_version [gcc_major_version]
+set have_xfail [expr $gcc_major_version >= 8 && $gcc_major_version <= 9]
+
# The xfail is for PR gcc/94469, which occurs with target board
# unix/-flto/-O0/-flto-partition=none/-ffat-lto-objects and gcc-8 and later.
# Note: We don't check for the filename in xfail_re because it might be
@@ -52,7 +55,10 @@ set xfail_re \
# Make sure that last_node_id is set to zero...
gdb_test_multiple "print last_node_id" "print last_node_id before calling pn" {
-re $xfail_re {
- xfail $gdb_test_name
+ if { $have_xfail } {
+ setup_xfail *-*-*
+ }
+ fail $gdb_test_name
# One of the choices will print the correct value, the other one
# <optimized out>. Since we don't known which one to choose to get
# the correct value, cancel.
@@ -74,7 +80,10 @@ gdb_test "print pn(4321)" "= 4321"
# Make sure that last_node_id now has the correct value...
gdb_test_multiple "print last_node_id" "print last_node_id after calling pn" {
-re $xfail_re {
- xfail $gdb_test_name
+ if { $have_xfail } {
+ setup_xfail *-*-*
+ }
+ fail $gdb_test_name
# Cancel
gdb_test_multiple "0" "cancel after xfail 2" {
-re -wrap "cancelled" {