aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2018-06-20 16:24:16 +0200
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2018-06-20 16:24:16 +0200
commit1d554008b3747c6ccaa8e3a08cc797cfade242f3 (patch)
tree3732301c3d4d26c0ae1776e66576b67e7a12acb1
parentb939d8a0dedbe0f0667500e1741e25baf03fe64c (diff)
downloadgdb-1d554008b3747c6ccaa8e3a08cc797cfade242f3.zip
gdb-1d554008b3747c6ccaa8e3a08cc797cfade242f3.tar.gz
gdb-1d554008b3747c6ccaa8e3a08cc797cfade242f3.tar.bz2
Improve gdb.base/float128.exp failure message
If the "print large128" sub-test fails in a manner that typically indicates internal overflow due to GDB being built without MPFR support, explicitly state this in the failure message. gdb/testsuite/ChangeLog: 2018-06-20 Ulrich Weigand <uweigand@de.ibm.com> * gdb.base/float128.exp: Add comment and improved fail message to the failure case of "print large128" test.
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.base/float128.exp16
2 files changed, 20 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index e981535..df218ef 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2018-06-20 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * gdb.base/float128.exp: Add comment and improved fail message
+ to the failure case of "print large128" test.
+
2018-06-19 Simon Marchi <simon.marchi@ericsson.com>
* configure.ac: Remove AC_PREREQ.
diff --git a/gdb/testsuite/gdb.base/float128.exp b/gdb/testsuite/gdb.base/float128.exp
index 4c322b8..26cabac 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"
+ }
+}