]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Use gnat_version_compare in gdb.ada
authorTom de Vries <tdevries@suse.de>
Mon, 20 Oct 2025 17:28:29 +0000 (19:28 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 20 Oct 2025 17:28:29 +0000 (19:28 +0200)
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 <tom@tromey.com>
gdb/testsuite/gdb.ada/O2_float_param.exp
gdb/testsuite/gdb.ada/call_pn.exp
gdb/testsuite/gdb.ada/finish-var-size.exp
gdb/testsuite/gdb.ada/import.exp

index f664c78e1c1c3f3df28c97f22fb5e8f89abc0c9f..2a2f1d0b0bd97fc316c384bdf4d5cbe089ca4b94 100644 (file)
@@ -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
     }
 }
index 295e7c7932d06916333a7237f900c4ba9c5ab83e..13a6211e5b734094f08f8e379b0cf050c237a1be 100644 (file)
@@ -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.
index 4bcd7aad0dfb320f764a9491d51c9086a913a18d..06baad58eb1584d25a7f68e148c1e0905e53fb72 100644 (file)
@@ -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
 
index 6011def803694f04ada965804c3a320ef3d03177..28b030d65d4bd6a282e98b1a1b7600e4668e767e 100644 (file)
@@ -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