This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: New FAIL gdb.base/float128.exp on ppc64le [Re: [RFC v2][2/2] Target FP: Make use of MPFR if available]


Jan Kratochvil wrote:
> On Wed, 20 Jun 2018 14:33:30 +0200, Ulrich Weigand wrote:
> > A result of "inf" instead of the large number is exactly the problem that
> > is fixed by using MPFR.  So I'm wondering: is the GDB that shows the FAIL
> > actually built against MPFR?  If at build time MPFR was not detected,
> > then this failure is exactly what you'd expect ...
> 
> Thanks for the heads up, our GDB build was really missing this dependency.

Ah good, that explains it.
 
> Still maybe the testcase should contain such explanation of the FAIL.

Agreed.  The attached patch adds a comment, and also updates the FAIL
message to indicate possible lack of MPFR support as reason.  Does
this look good to you?

> Moreover maybe it could be an XFAIL.

I guess ...  On the other hand, it does indicate a real bug in GDB;
if it had been an XFAIL, you probably wouldn't have noticed missing
MPFR support in your build now.

Bye,
Ulrich

testsuite/ChangeLog:

	* gdb.base/float128.exp: Add comment and improved fail message
	to the failure case of "print large128" test.

diff --git a/gdb/testsuite/gdb.base/float128.exp b/gdb/testsuite/gdb.base/float128.exp
index 4c322b8ab3..26cabac776 100644
--- a/gdb/testsuite/gdb.base/float128.exp
+++ b/gdb/testsuite/gdb.base/float128.exp
@@ -75,5 +75,19 @@ gdb_test "print ld" ".* = 10\\.375.*" "the value of ld is changed to 10.375"
 gdb_test "print f128" ".* = 20\\.375.*" "the value of f128 is changed to 20.375"
 
 # Test that we can correctly handle the largest IEEE-128 value
-gdb_test "print large128" ".* = 1\\.18973149535723176508575932662800702e\\+4932" "print large128"
+# 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 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!)"
+    }
+    -re ".*$gdb_prompt $" {
+	fail "$test"
+    }
+}
 

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]