From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22767 invoked by alias); 11 Nov 2009 19:20:01 -0000 Received: (qmail 22757 invoked by uid 22791); 11 Nov 2009 19:19:59 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 11 Nov 2009 19:19:55 +0000 Received: (qmail 22699 invoked from network); 11 Nov 2009 19:19:51 -0000 Received: from unknown (HELO localhost) (froydnj@127.0.0.2) by mail.codesourcery.com with ESMTPA; 11 Nov 2009 19:19:51 -0000 Date: Wed, 11 Nov 2009 19:20:00 -0000 From: Nathan Froyd To: gdb-patches@sourceware.org Subject: [PATCH,testsuite] fix spurious FAILs in float printing tests on mingw32 hosts Message-ID: <20091111191951.GF31393@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.13 (2006-08-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-11/txt/msg00259.txt.bz2 For compatibility reasons, mingw32's printf routine prints leading zeros on floating-point exponents. Because of this, several GDB tests fail since they do not expect leading zeros. Since these tests are testing something other than the conformance of the C library, it seems reasonable to be lax and permit leading zeros. Tested with cross to powerpc-linux-gnu on a mingw32 host. OK to commit? -Nathan 2009-11-11 Nathan Froyd * gdb.base/long_long.exp: Permit leading zeros on floating-point exponents. * gdb.base/pointers.exp: Likewise. * gdb.cp/ref-types.exp: Likewise. cvs diff: Diffing gdb.base Index: gdb.base/long_long.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/long_long.exp,v retrieving revision 1.28 diff -u -u -r1.28 long_long.exp --- gdb.base/long_long.exp 7 Jul 2009 21:33:50 -0000 1.28 +++ gdb.base/long_long.exp 11 Nov 2009 19:14:48 -0000 @@ -228,7 +228,7 @@ gdb_test_int "p/o *(int *)i" "" "0443" "0110642547" "" gdb_test_int "p/t *(int *)i" "" "100100011" "1001000110100010101100111" "" gdb_test_int "p/a *(int *)i" "" "" "0x1234567" "" -gdb_test_int "p/f *(int *)i" "" "291" "2.99881655e-38" "" +gdb_test_int "p/f *(int *)i" "" "291" "2.99881655e-0?38" "" gdb_test_int "p/c *(int *)i" "" "35 '.'" "103 'g'" "" gdb_test_long "p/x *(long *)l" "" "0x123" "0x1234567" "0x123456789abcdef" @@ -237,7 +237,7 @@ gdb_test_long "p/o *(long *)l" "" "0443" "0110642547" "04432126361152746757" gdb_test_long "p/t *(long *)l" "" "100100011" "1001000110100010101100111" "100100011010001010110011110001001101010111100110111101111" gdb_test_ptr "p/a *(long *)l" "" "" "0x1234567" "0x123456789abcdef" -gdb_test_long "p/f *(long *)l" "" "291" "2.99881655e-38" "3.5127005640885037e-303" +gdb_test_long "p/f *(long *)l" "" "291" "2.99881655e-0?38" "3.5127005640885037e-303" gdb_test_long "p/c *(long *)l" "" "35 '.'" "103 'g'" "-17 '.*'" gdb_test_long_long "p/x *(long long *)ll" "" "" "" "0x123456789abcdef" @@ -308,7 +308,7 @@ gdb_test "x/2wt w" "00000001001000110100010101100111.*10100111001011101110010100111001" gdb_test_ptr "x/2wa w" "" "" "0x1234567.*0xa72ee539" "0x1234567.*0xffffffffa72ee539" gdb_test "x/2wc w" "103 'g'.*57 '9'" -gdb_test "x/2wf w" "2.99881655e-38.*-2.42716126e-15" +gdb_test "x/2wf w" "2.99881655e-0?38.*-2.42716126e-0?15" gdb_test "x/2gx g" "0x0123456789abcdef.*0xa72ee53977053977" gdb_test "x/2gd g" "81985529216486895.*-6399925985474168457" Index: gdb.base/pointers.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/pointers.exp,v retrieving revision 1.16 diff -u -u -r1.16 pointers.exp --- gdb.base/pointers.exp 7 Jul 2009 21:33:50 -0000 1.16 +++ gdb.base/pointers.exp 11 Nov 2009 19:14:48 -0000 @@ -512,7 +512,7 @@ send_gdb "print *pF\n" gdb_expect { - -re ".\[0-9\]* = 1.2\[0-9\]*e\\+10.*$gdb_prompt $" { + -re ".\[0-9\]* = 1.2\[0-9\]*e\\+0?10.*$gdb_prompt $" { pass "print value of *pF" } -re ".*$gdb_prompt $" { fail "print value of *pF" } @@ -529,7 +529,7 @@ send_gdb "print *pD\n" gdb_expect { - -re ".\[0-9\]* = -1.2\[0-9\]*e\\-37.*$gdb_prompt $" { + -re ".\[0-9\]* = -1.2\[0-9\]*e\\-0?37.*$gdb_prompt $" { pass "print value of *pD" } -re ".*$gdb_prompt $" { fail "print value of *pD" } cvs diff: Diffing gdb.cp Index: gdb.cp/ref-types.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/ref-types.exp,v retrieving revision 1.10 diff -u -u -r1.10 ref-types.exp --- gdb.cp/ref-types.exp 7 Jul 2009 21:33:50 -0000 1.10 +++ gdb.cp/ref-types.exp 11 Nov 2009 19:14:48 -0000 @@ -412,7 +412,7 @@ send_gdb "print F\n" gdb_expect { - -re ".\[0-9\]* = 1.2\[0-9\]*e\\+10.*$gdb_prompt $" { + -re ".\[0-9\]* = 1.2\[0-9\]*e\\+0?10.*$gdb_prompt $" { pass "print value of F" } -re ".*$gdb_prompt $" { fail "print value of F" } @@ -640,7 +640,7 @@ send_gdb "print rF\n" gdb_expect { - -re ".\[0-9\]* = \\(float &\\) @$hex: 1.2\[0-9\]*e\\+10.*$gdb_prompt $" { + -re ".\[0-9\]* = \\(float &\\) @$hex: 1.2\[0-9\]*e\\+0?10.*$gdb_prompt $" { pass "print value of rF" } -re ".*$gdb_prompt $" { fail "print value of rF" }