aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2020-12-11 13:55:04 +0100
committerTom de Vries <tdevries@suse.de>2020-12-11 13:55:04 +0100
commit9cd7a95a2bb9ba9d5a6af022e5454c8ce78aee56 (patch)
tree577d2cd95c8df7dd64f11140a98a104cc4ac0233
parent4483a8e72ad265b5d428899d384bf190db071759 (diff)
downloadbinutils-9cd7a95a2bb9ba9d5a6af022e5454c8ce78aee56.zip
binutils-9cd7a95a2bb9ba9d5a6af022e5454c8ce78aee56.tar.gz
binutils-9cd7a95a2bb9ba9d5a6af022e5454c8ce78aee56.tar.bz2
[gdb/testsuite] Fix gdb.base/float128.exp with --with-mpfr=no
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. gdb/testsuite/ChangeLog: 2020-12-11 Tom de Vries <tdevries@suse.de> PR testsuite/26954 * gdb.base/float128.exp: Detect and handle no mpfr support.
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.base/float128.exp22
2 files changed, 26 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 07e206a..5b89bcd 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2020-12-11 Tom de Vries <tdevries@suse.de>
+
+ PR testsuite/26954
+ * gdb.base/float128.exp: Detect and handle no mpfr support.
+
2020-12-10 Simon Marchi <simon.marchi@efficios.com>
PR gdb/24694
diff --git a/gdb/testsuite/gdb.base/float128.exp b/gdb/testsuite/gdb.base/float128.exp
index 40babca..6fe479b 100644
--- a/gdb/testsuite/gdb.base/float128.exp
+++ b/gdb/testsuite/gdb.base/float128.exp
@@ -74,6 +74,16 @@ gdb_test_multiple "set var f128=20.375l" "$test" {
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"
+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
+ }
+}
+
# Test that we can correctly handle the largest IEEE-128 value
# 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
@@ -84,7 +94,17 @@ gdb_test_multiple "print large128" "$test" {
pass "$test"
}
-re ".* = inf.*$gdb_prompt $" {
- fail "$test (GDB may be missing MPFR support!)"
+ if { $mpfr_supported == 0 } {
+ # If the host platform has native 128-bit float support (as is
+ # the case for some versions of s390 and powerpc), the
+ # "print large128" test should be passing, even without MPFR
+ # support. So, in those cases we should have fail here rather than
+ # unsupported. However, given that we don't have a way to readily
+ # test for this, we fall back to unsupported.
+ unsupported "$test (Missing MPFR support)"
+ } else {
+ fail $test
+ }
}
-re ".*$gdb_prompt $" {
fail "$test"