From: Tom de Vries Date: Mon, 20 Oct 2025 17:28:29 +0000 (+0200) Subject: [gdb/testsuite] Use gnat_version_compare in gdb.ada X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d840a1720793373b4f05a391102b7fa48dbc6b0c;p=thirdparty%2Fbinutils-gdb.git [gdb/testsuite] Use gnat_version_compare in gdb.ada Convert the remaining uses of gcc_major_version in gdb.ada. Tested on x86_64-linux with gcc 7, gcc 13 and gcc 15. Approved-By: Tom Tromey --- diff --git a/gdb/testsuite/gdb.ada/O2_float_param.exp b/gdb/testsuite/gdb.ada/O2_float_param.exp index f664c78e1c1..2a2f1d0b0bd 100644 --- a/gdb/testsuite/gdb.ada/O2_float_param.exp +++ b/gdb/testsuite/gdb.ada/O2_float_param.exp @@ -21,7 +21,7 @@ standard_ada_testfile foo set have_xfail 0 if {[is_aarch64_target]} { - if { [gcc_major_version] <= 8 } { + if { [gnat_version_compare < 9] } { set have_xfail 1 } } diff --git a/gdb/testsuite/gdb.ada/call_pn.exp b/gdb/testsuite/gdb.ada/call_pn.exp index 295e7c7932d..13a6211e5b7 100644 --- a/gdb/testsuite/gdb.ada/call_pn.exp +++ b/gdb/testsuite/gdb.ada/call_pn.exp @@ -37,8 +37,7 @@ 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}] +set have_xfail [expr {[gnat_version_compare >= 8] && [gnat_version_compare < 10]}] # 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. diff --git a/gdb/testsuite/gdb.ada/finish-var-size.exp b/gdb/testsuite/gdb.ada/finish-var-size.exp index 4bcd7aad0df..06baad58eb1 100644 --- a/gdb/testsuite/gdb.ada/finish-var-size.exp +++ b/gdb/testsuite/gdb.ada/finish-var-size.exp @@ -18,7 +18,7 @@ load_lib "ada.exp" require allow_ada_tests # GCC 12 has the needed fix. -require {expr {[gcc_major_version] >= 12}} +require {gnat_version_compare >= 12} standard_ada_testfile p diff --git a/gdb/testsuite/gdb.ada/import.exp b/gdb/testsuite/gdb.ada/import.exp index 6011def8036..28b030d65d4 100644 --- a/gdb/testsuite/gdb.ada/import.exp +++ b/gdb/testsuite/gdb.ada/import.exp @@ -21,7 +21,7 @@ require allow_ada_tests # declarations only") is required. The commit makes sure that file-scope # function and variable declarations are emitted in dwarf. This allows the # description of imported entries, making them available to the debugger. -require {expr {[gcc_major_version] >= 8}} +require {gnat_version_compare >= 8} standard_ada_testfile prog @@ -81,7 +81,7 @@ gdb_test "print copy" " = 42" # (without pinpointing it to a specific gcc PR or commit). foreach func {"pkg.imported_func_ada" "imported_func"} { clean_restart $testfile - if { [gcc_major_version] < 10 } { + if { [gnat_version_compare < 10] } { setup_xfail *-*-* } gdb_breakpoint $func message