]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Limit xfail in gdb.ada/call_pn.exp
authorTom de Vries <tdevries@suse.de>
Sat, 21 Sep 2024 04:12:40 +0000 (06:12 +0200)
committerTom de Vries <tdevries@suse.de>
Sat, 21 Sep 2024 04:12:40 +0000 (06:12 +0200)
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>
gdb/testsuite/gdb.ada/call_pn.exp

index 5453dd4032905cf74a40107d609ff0f61378c548..9114d30221bf56303ef2d6dfd502e263920af2c6 100644 (file)
@@ -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" {