From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id F+8eB1Ya0l9GPwAAWB0awg (envelope-from ) for ; Thu, 10 Dec 2020 07:53:42 -0500 Received: by simark.ca (Postfix, from userid 112) id 109571F0A9; Thu, 10 Dec 2020 07:53:42 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 4847B1E590 for ; Thu, 10 Dec 2020 07:53:41 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9F79F383F857; Thu, 10 Dec 2020 12:53:40 +0000 (GMT) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id C4107383F851 for ; Thu, 10 Dec 2020 12:53:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C4107383F851 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id DE12EAB91; Thu, 10 Dec 2020 12:53:36 +0000 (UTC) Date: Thu, 10 Dec 2020 13:53:35 +0100 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH][gdb/testsuite] Fix gdb.base/float128.exp with --with-mpfr=no Message-ID: <20201210125334.GA1267@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ulrich Weigand Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" 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? Thanks, - Tom [gdb/testsuite] Fix gdb.base/float128.exp with --with-mpfr=no gdb/testsuite/ChangeLog: 2020-12-10 Tom de Vries 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"