[PATCH] Make gdb.ada/float-bits.exp more generic
Tom de Vries
tdevries@suse.de
Tue May 3 14:53:19 GMT 2022
On 4/27/22 16:52, Luis Machado via Gdb-patches wrote:
> There are assumptions in the test about the 128-bit long double format
> being used. While the results are OK for i387 128-bit long doubles, it
> is not correct for IEEE quad 128-bit long doubles.
>
> Also, depending on the target (64-bit/32-bit), 128-bit long doubles may not
> be available at all. And it may be the case that the compiler for a 64-bit
> target doesn't support 128-bit long doubles, but GDB might will support it
> internally.
>
> Lastly, not every 128-bit long double format has invalid values. Some formats
> consider all values as valid floating point numbers.
>
> With the above in mind, extend the test a little so it behaves well on
> different architectures and so it works with different 128-bit long double
> formats.
>
> Main changes:
>
> - Use 128-bit long double values appropriate for the long double format.
> - Test 128-bit long double assignment to compiler-generated 128-bit long
> double variables.
> - Test 128-bit long double assignment to GDB internal variables.
>
> Tested on x86_64 (16 PASS), aarch64 (12 PASS) and arm (9 PASS).
With target board unix/-m32 on x86_64-linux, this patch regresses as
follows:
...
(gdb) print 16llf#a56fa5b99019a5c800007ffff7ff4054#^M
Cannot export value 219902325555200000000000140737354088532 as 96-bits
unsigned integer (must be between 0 and 79228162514264337593543950335)^M
(gdb) FAIL: gdb.ada/float-bits.exp: print
16llf#a56fa5b99019a5c800007ffff7ff4054#
...
Note that this was fixed recently in commit 3b9809bc62c
("[gdb/testsuite] Fix gdb.ada/float-bits.exp with -m32").
Thanks,
- Tom
More information about the Gdb-patches
mailing list