]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
[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)
commit2d458da9a8e1927275589c308ae19eae577d2b3c
tree1477c03dffaffa478501a299939f0c5ad2db8e85
parentc6660615d17e89f45ac0c8a4d62e6c285f1c5636
[gdb/testsuite] Fix xfail in gdb.ada/array_of_variant.exp

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