public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Doug Evans <dje@google.com>
Cc: "Joseph S. Myers" <joseph@codesourcery.com>,
	       Andreas Schwab <schwab@redhat.com>,
	gdb-patches@sourceware.org
Subject: Re: [patch] Fix new FAIL `reject p 0x1.1' [fixup]
Date: Tue, 31 Aug 2010 19:38:00 -0000	[thread overview]
Message-ID: <20100831193749.GA18505@host1.dyn.jankratochvil.net> (raw)
In-Reply-To: <AANLkTimuUUe2HKQsUNjE6cKX8NvqTs2W7CzV0UZi2M_4@mail.gmail.com>

On Mon, 23 Aug 2010 21:57:19 +0200, Doug Evans wrote:
> On Mon, Aug 23, 2010 at 12:49 PM, Doug Evans <dje@google.com> wrote:
> >> While thanks for catching it I still believe now my testcase update is the
> >> appropriate fix - if glibc supports then extended input syntax let the GDB
> >> user benefit from it.
> >
> > It's ok with me.
> 
> I should add that IWBN to have an additional testcase that exercises
> sscanf (...) == 0 on newer glibcs.

OK, I forgot first.  OK to check-in?  Tested both cases (RHEL-4.8 and
Fedora14snapshot).


Thanks,
Jan


gdb/testsuite/
2010-08-31  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* gdb.base/printcmds.exp (test_float_accepted): Import gdb_prompt.
	Move here, negate and extend by XFAIL the "p 0x1.1" test from ...
	(test_float_rejected): ... here.
	* gdb.java/jv-print.exp (test_float_accepted): Import gdb_prompt.
	Move here, negate and extend by XFAIL the "p 0x1.1" test from ...
	(test_float_rejected): ... here.

--- a/gdb/testsuite/gdb.base/printcmds.exp
+++ b/gdb/testsuite/gdb.base/printcmds.exp
@@ -119,6 +119,8 @@ proc test_integer_literals_rejected {} {
 }
 
 proc test_float_accepted {} {
+    global gdb_prompt
+
     # This test is useful to catch successful parsing of the first fp value.
     gdb_test "p 123.4+56.7" " = 180.(099\[0-9]*|100\[0-9\]*)" "check for floating addition"
 
@@ -129,6 +131,18 @@ proc test_float_accepted {} {
     gdb_test "p 1.5f" " = 1.5"
     gdb_test "p 1.l" " = 1"
     gdb_test "p 1.5l" " = 1.5"
+
+    # Test hexadecimal floating point.
+    set test "p 0x1.1"
+    gdb_test_multiple $test $test {
+	-re " = 1\\.0625\r\n$gdb_prompt $" {
+	    pass $test
+	}
+	-re "Invalid number \"0x1\\.1\"\\.\r\n$gdb_prompt $" {
+	    # Older glibc does not support hex float, newer does.
+	    xfail $test
+	}
+    }
 }
 
 proc test_float_rejected {} {
@@ -140,7 +154,6 @@ proc test_float_rejected {} {
 
     test_print_reject "p 123foobar.bazfoo3"
     test_print_reject "p 123EEEEEEEEEEEEEEEEE33333k333"
-    test_print_reject "p 0x1.1"
 
     # Test bad suffixes.
     test_print_reject "p 1.1x"
--- a/gdb/testsuite/gdb.java/jv-print.exp
+++ b/gdb/testsuite/gdb.java/jv-print.exp
@@ -98,6 +98,8 @@ proc test_integer_literals_rejected {} {
 }
 
 proc test_float_accepted {} {
+    global gdb_prompt
+
     # Test parsing of fp value with legit text following.
     gdb_test "p 1234.5+1" " = 1235.5" "check fp + text"
 
@@ -108,12 +110,21 @@ proc test_float_accepted {} {
     gdb_test "p 1.5f" " = 1.5"
     gdb_test "p 1.d" " = 1"
     gdb_test "p 1.5d" " = 1.5"
+
+    # Test hexadecimal floating point.
+    set test "p 0x1.1"
+    gdb_test_multiple $test $test {
+	-re " = 1\\.0625\r\n$gdb_prompt $" {
+	    pass $test
+	}
+	-re "Invalid number \"0x1\\.1\"\r\n$gdb_prompt $" {
+	    # Older glibc does not support hex float, newer does.
+	    xfail $test
+	}
+    }
 }
 
 proc test_float_rejected {} {
-    # Test invalid fp values.
-    test_print_reject "p 0x1.1"
-
     # Test bad suffixes.
     test_print_reject "p 1.1x"
     test_print_reject "p 1.1ff"

  reply	other threads:[~2010-08-31 19:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-17  0:31 [patch] Handle 0 result from sscanf when parsing fp values Doug Evans
2010-08-17  8:18 ` Andreas Schwab
2010-08-17 11:37   ` Doug Evans
2010-08-18 20:38     ` Doug Evans
2010-08-20  7:34       ` [patch] Fix new FAIL `reject p 0x1.1' [Re: [patch] Handle 0 result from sscanf when parsing fp values.] Jan Kratochvil
2010-08-20  7:37         ` [patch] Fix new FAIL `reject p 0x1.1' [fixup] " Jan Kratochvil
2010-08-20 11:58           ` Joseph S. Myers
2010-08-23 15:35             ` Doug Evans
2010-08-23 18:55               ` [patch] Fix new FAIL `reject p 0x1.1' [fixup] Jan Kratochvil
2010-08-23 19:49                 ` Doug Evans
2010-08-23 19:57                   ` Doug Evans
2010-08-31 19:38                     ` Jan Kratochvil [this message]
2010-08-31 22:51                       ` Doug Evans
2010-09-02 15:11                         ` Jan Kratochvil
2010-09-06 22:29                           ` Jan Kratochvil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100831193749.GA18505@host1.dyn.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=joseph@codesourcery.com \
    --cc=schwab@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).