From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id yBD/DjweWGJjOgAAWB0awg (envelope-from ) for ; Thu, 14 Apr 2022 09:14:36 -0400 Received: by simark.ca (Postfix, from userid 112) id 3AD3D1F327; Thu, 14 Apr 2022 09:14:36 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.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 A6FF41ED17 for ; Thu, 14 Apr 2022 09:14:35 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 571C53857343 for ; Thu, 14 Apr 2022 13:14:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 571C53857343 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1649942075; bh=ZsB+yxrWViuCped3vkST4BhATTWhxUXpKTGvWlITKS0=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=B/ilL+S2t70Mo0usCHjC1JIfOGGD2vUuwtQ8tQ4pT5H1AHr8zy7ffDnzEp9Kyqiti Z1ZnOTXhuyW9D65fpDgvzioMB578T9rUKVB5iz9buVK+5TDJMf+twtZWV8myD6R5WQ eJAc2gQuy7FLu/y3kdDwhrW5H3tKNbSBnXFenoyw= Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id A6E663858C2C for ; Thu, 14 Apr 2022 13:14:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A6E663858C2C Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id C27AE21611; Thu, 14 Apr 2022 13:14:15 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A8969132C0; Thu, 14 Apr 2022 13:14:15 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id QDXdJyceWGLHPwAAMHmgww (envelope-from ); Thu, 14 Apr 2022 13:14:15 +0000 Date: Thu, 14 Apr 2022 15:14:14 +0200 To: gdb-patches@sourceware.org Subject: [PATCH][gdb/testsuite] Fix gdb.ada/float-bits.exp with -m32 Message-ID: <20220414131412.GA9234@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: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Cc: Tom Tromey Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi, With test-case gdb.ada/float-bits.exp and native we get: ... (gdb) print 16llf#7FFFF7FF4054A56FA5B99019A5C8#^M $9 = 5.0e+25^M (gdb) PASS: gdb.ada/float-bits.exp: print 16llf#7FFFF7FF4054A56FA5B99019A5C8# ... 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#7FFFF7FF4054A56FA5B99019A5C8# ... Fix this by testing whether 16llf is supported by doing ptype long_long_float which gets us either: ... type = <16-byte float>^M ... or: ... type = <12-byte float>^M ... Tested on x86_64-linux with native and unix/-m32. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29041 Any comments? Thanks, - Tom [gdb/testsuite] Fix gdb.ada/float-bits.exp with -m32 --- 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/float-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 := 16lf#bc0d83c94fb6d2ac#" " = -2.0e-19" gdb_test "print val_double" " = -2.0e-19" \ "print val_double after assignment" -gdb_test "print 16llf#7FFFF7FF4054A56FA5B99019A5C8#" " = 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#" " = 5.0e\\+25" +} gdb_test "print val_long_double" " = 5.0e\\+25" -gdb_test "print val_long_double := 16llf#7FFFF7FF4054A56FA5B99019A5C8#" \ - " = 5.0e\\+25" +if { $16llf_supported } { + gdb_test "print val_long_double := 16llf#7FFFF7FF4054A56FA5B99019A5C8#" \ + " = 5.0e\\+25" +} gdb_test "print val_long_double" " = 5.0e\\+25" \ "print val_long_double after assignment" -gdb_test "print 16llf#a56fa5b99019a5c800007ffff7ff4054#" \ - " = " +if { $16llf_supported } { + gdb_test "print 16llf#a56fa5b99019a5c800007ffff7ff4054#" \ + " = " +}