]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Fix xfail in gdb.ada/array_of_variant.exp
authorTom de Vries <tdevries@suse.de>
Thu, 3 Apr 2025 15:13:12 +0000 (17:13 +0200)
committerTom de Vries <tdevries@suse.de>
Thu, 3 Apr 2025 15:13:12 +0000 (17:13 +0200)
In commit af2b87e649b ("[gdb/testsuite] Add xfail for PR gcc/101633"), I added
an xfail that was controlled by variable old_gcc, triggering the xfail for
gcc 7 and before, but not for gcc 8 onwards:
...
set old_gcc [expr [test_compiler_info {gcc-[0-7]-*}]]
...

In commit 1411185a57e ("Introduce and use gnat_version_compare"), this changed
to:
...
set old_gcc [gnat_version_compare <= 7]
...
which still triggered the xfail for gcc 7, because of a bug in
gnat_version_compare.

After that bug got fixed, the xfail was no longer triggered because the gnatmake
version is 7.5.0, and [version_compare {7 5 0} <= {7}] == 0.

We could have the semantics for version_compare where we clip the input
arguments to the length of the shortest, and so we'd have
[version_compare {7 5 0} <= {7}] == [version_compare {7} <= {7}] == 1.

But let's stick with the current version-sort semantics, and fix this by
using [gnat_version_compare < 8] instead.

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
gdb/testsuite/gdb.ada/array_of_variant.exp

index 8b83f4ed22adbc0bb06162348b7ba2e9fc6f2c51..83b626cb6d1819b738c0382507060fae050ef9a0 100644 (file)
@@ -20,7 +20,7 @@ require allow_ada_tests
 
 standard_ada_testfile p
 
-set old_gcc [gnat_version_compare <= 7]
+set old_gcc [gnat_version_compare < 8]
 
 proc gdb_test_with_xfail { cmd re re_xfail msg } {
     global scenario old_gcc