[PATCH][gdb/testsuite] Fix gdb.base/float128.exp with --with-mpfr=no

Ulrich Weigand uweigand@de.ibm.com
Fri Dec 11 09:17:56 GMT 2020


On Thu, Dec 10, 2020 at 01:53:35PM +0100, Tom de Vries wrote:

> When configuring gdb using --with-mpfr=no and running test-case
> gdb.base/float128.exp, we run into:
> ...
> FAIL: gdb.base/float128.exp: print large128 (GDB may be missing MPFR support!)
> ...
> 
> Fix this by detecting that gdb was build without mpfr using the show
> configuration command, and changing the FAIL into UNSUPPORTED.

That part looks OK to me, but ...

> +       if { $mpfr_supported == 0 } {
> +	   if { [istarget "s390*-*-*"] || [istarget "powerpc*-*-*"] } {
> +	       # Some of these archs have native 128-bit float support, in
> +	       # which case this should be passing, even without MPFR support.
> +	       fail $test
> +	   } else {
> +	       unsupported "$test (Missing MPFR support)"
> +	   }

... the istarget check isn't quite right - if we want a check like that,
it needs to check whether the *host* platform GDB is running on supports
native 128-bit floats; the istarget check tests the target architecture
(which will be different when testing a cross-debugging scenario).

But I'm not sure we really need that check, I'd be fine with just always
returning unsupported here when GDB is compiled explicitly without MPFR
support (and the test fails).

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com


More information about the Gdb-patches mailing list