From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 0C86B3857C4E; Fri, 15 Apr 2022 16:01:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0C86B3857C4E Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb/gdb-12-branch] [gdb/testsuite] Fix gdb.ada/float-bits.exp with -m32 X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/gdb-12-branch X-Git-Oldrev: 04f521a6ef30fd6cffabb5c5c26574fd6474a2e9 X-Git-Newrev: f0072f79e12d88ca361de04a52434430a10c5f0e Message-Id: <20220415160112.0C86B3857C4E@sourceware.org> Date: Fri, 15 Apr 2022 16:01:12 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Apr 2022 16:01:12 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Df0072f79e12d= 88ca361de04a52434430a10c5f0e commit f0072f79e12d88ca361de04a52434430a10c5f0e Author: Tom de Vries Date: Fri Apr 15 18:01:07 2022 +0200 [gdb/testsuite] Fix gdb.ada/float-bits.exp with -m32 =20 With test-case gdb.ada/float-bits.exp and native we get: ... (gdb) print 16llf#7FFFF7FF4054A56FA5B99019A5C8#^M $9 =3D 5.0e+25^M (gdb) PASS: gdb.ada/float-bits.exp: print 16llf#7FFFF7FF4054A56FA5B9901= 9A5C8# ... but with target board unix/-m32 we have instead: ... (gdb) print 16llf#7FFFF7FF4054A56FA5B99019A5C8#^M Cannot export value 2596145952482202326224873165792712 as 96-bits \ unsigned integer (must be between 0 and 79228162514264337593543950335= )^M (gdb) FAIL: gdb.ada/float-bits.exp: print 16llf#7FFFF7FF4054A56FA5B9901= 9A5C8# ... =20 Fix this by testing whether 16llf is supported by doing ptype long_long= _float which gets us either: ... type =3D <16-byte float>^M ... or: ... type =3D <12-byte float>^M ... =20 Tested on x86_64-linux with native and unix/-m32. =20 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29041 Diff: --- gdb/testsuite/gdb.ada/float-bits.exp | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/gdb/testsuite/gdb.ada/float-bits.exp b/gdb/testsuite/gdb.ada/f= loat-bits.exp index c98afb53c06..4ca8dbf88e5 100644 --- a/gdb/testsuite/gdb.ada/float-bits.exp +++ b/gdb/testsuite/gdb.ada/float-bits.exp @@ -42,12 +42,29 @@ gdb_test "print val_double :=3D 16lf#bc0d83c94fb6d2ac#"= " =3D -2.0e-19" gdb_test "print val_double" " =3D -2.0e-19" \ "print val_double after assignment" =20 -gdb_test "print 16llf#7FFFF7FF4054A56FA5B99019A5C8#" " =3D 5.0e\\+25" +set 16llf_supported 0 +gdb_test_multiple "ptype long_long_float" "" { + -re -wrap "<16-byte float>" { + set 16llf_supported 1 + pass $gdb_test_name + } + -re -wrap "<\\d+-byte float>" { + pass $gdb_test_name + } +} + +if { $16llf_supported } { + gdb_test "print 16llf#7FFFF7FF4054A56FA5B99019A5C8#" " =3D 5.0e\\+25" +} gdb_test "print val_long_double" " =3D 5.0e\\+25" -gdb_test "print val_long_double :=3D 16llf#7FFFF7FF4054A56FA5B99019A5C8#" \ - " =3D 5.0e\\+25" +if { $16llf_supported } { + gdb_test "print val_long_double :=3D 16llf#7FFFF7FF4054A56FA5B99019A5C= 8#" \ + " =3D 5.0e\\+25" +} gdb_test "print val_long_double" " =3D 5.0e\\+25" \ "print val_long_double after assignment" =20 -gdb_test "print 16llf#a56fa5b99019a5c800007ffff7ff4054#" \ - " =3D " +if { $16llf_supported } { + gdb_test "print 16llf#a56fa5b99019a5c800007ffff7ff4054#" \ + " =3D " +}