Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Luis Machado via Gdb-patches <gdb-patches@sourceware.org>
To: Tom de Vries <tdevries@suse.de>, gdb-patches@sourceware.org
Cc: Ulrich Weigand <uweigand@de.ibm.com>
Subject: Re: [PATCH][gdb/testsuite] Fix gdb.base/float128.exp with --with-mpfr=no
Date: Thu, 10 Dec 2020 10:08:53 -0300	[thread overview]
Message-ID: <8175f4fe-dcb5-8580-85f9-a1af1a79221b@linaro.org> (raw)
In-Reply-To: <20201210125334.GA1267@delia>

On 12/10/20 9:53 AM, Tom de Vries wrote:
> Hi,
> 
> 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.
> 
> Tested on x86_64-linux.
> 
> Any comments?

Would it be more convenient to turn this into a reusable check across 
all tests? Something like "supports_128_floats"?

Then again, if only this particular test will use it, it may not be 
worth it.

> 
> Thanks,
> - Tom
> 
> [gdb/testsuite] Fix gdb.base/float128.exp with --with-mpfr=no
> 
> gdb/testsuite/ChangeLog:
> 
> 2020-12-10  Tom de Vries  <tdevries@suse.de>
> 
> 	PR testsuite/26954
> 	* gdb.base/float128.exp: Detect and handle no mprf support.
> 
> ---
>   gdb/testsuite/gdb.base/float128.exp | 23 ++++++++++++++++++++++-
>   1 file changed, 22 insertions(+), 1 deletion(-)
> 
> diff --git a/gdb/testsuite/gdb.base/float128.exp b/gdb/testsuite/gdb.base/float128.exp
> index 40babcadc1..66f4d89c12 100644
> --- a/gdb/testsuite/gdb.base/float128.exp
> +++ b/gdb/testsuite/gdb.base/float128.exp
> @@ -78,13 +78,34 @@ gdb_test "print f128" ".* = 20\\.375.*" "the value of f128 is changed to 20.375"
>   # Note: If we get "inf" instead of the correct result, we may have run into
>   # an internal overflow.  This typically happens on host platforms without
>   # native IEEE-128 support where GDB was built without MPFR support.
> +
> +set mpfr_supported -1
> +gdb_test_multiple "show configuration" "" {
> +    -wrap -re "--with-mpfr\r\n.*" {
> +       set mpfr_supported 1
> +    }
> +    -wrap -re "--without-mpfr\r\n.*" {
> +       set mpfr_supported 0
> +    }
> +}
> +
>   set test "print large128"
>   gdb_test_multiple "print large128" "$test" {
>       -re ".* = 1\\.18973149535723176508575932662800702e\\+4932.*$gdb_prompt $" {
>   	pass "$test"
>       }
>       -re ".* = inf.*$gdb_prompt $" {
> -	fail "$test (GDB may be missing MPFR support!)"
> +       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)"
> +	   }
> +       } else {
> +           fail $test
> +       }
>       }
>       -re ".*$gdb_prompt $" {
>   	fail "$test"
> 

  reply	other threads:[~2020-12-10 13:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-10 12:53 Tom de Vries
2020-12-10 13:08 ` Luis Machado via Gdb-patches [this message]
2020-12-11  9:17 ` Ulrich Weigand via Gdb-patches
2020-12-11 12:56   ` Tom de Vries

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8175f4fe-dcb5-8580-85f9-a1af1a79221b@linaro.org \
    --to=gdb-patches@sourceware.org \
    --cc=luis.machado@linaro.org \
    --cc=tdevries@suse.de \
    --cc=uweigand@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox