From af7dd4aac93e5d4a18080805f5ddd81fb0c29511 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Sat, 21 Sep 2024 06:12:40 +0200 Subject: [PATCH] [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 --- gdb/testsuite/gdb.ada/call_pn.exp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.ada/call_pn.exp b/gdb/testsuite/gdb.ada/call_pn.exp index 5453dd40329..9114d30221b 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 # . 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" { -- 2.47.3