[binutils-gdb] [gdb/testsuite] Limit xfail in gdb.ada/call_pn.exp

Tom de Vries vries@sourceware.org
Sat Sep 21 04:12:48 GMT 2024


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=af7dd4aac93e5d4a18080805f5ddd81fb0c29511

commit af7dd4aac93e5d4a18080805f5ddd81fb0c29511
Author: Tom de Vries <tdevries@suse.de>
Date:   Sat Sep 21 06:12:40 2024 +0200

    [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>

Diff:
---
 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
 	# <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" {


More information about the Gdb-cvs mailing list