From 809df4465f01277ab689fb82b3f16ff79f9a2606 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Mon, 6 Sep 2010 15:48:34 +0000 Subject: [PATCH] gdb/testsuite/ * 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. * gdb.objc/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. * gdb.pascal/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. --- gdb/testsuite/ChangeLog | 15 +++++++++++++++ gdb/testsuite/gdb.base/printcmds.exp | 15 ++++++++++++++- gdb/testsuite/gdb.java/jv-print.exp | 17 ++++++++++++++--- gdb/testsuite/gdb.objc/print.exp | 17 ++++++++++++++--- gdb/testsuite/gdb.pascal/print.exp | 17 ++++++++++++++--- 5 files changed, 71 insertions(+), 10 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 50c1f402ebe..a4db465fafb 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,18 @@ +2010-09-06 Jan Kratochvil + + * 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. + * gdb.objc/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. + * gdb.pascal/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. + 2010-09-04 Daniel Jacobowitz * gdb.base/watchpoint.exp: Call test_inaccessible_watchpoint diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.base/printcmds.exp index d377597c59b..497e9cf4b46 100644 --- 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" diff --git a/gdb/testsuite/gdb.java/jv-print.exp b/gdb/testsuite/gdb.java/jv-print.exp index cdb598ce0a7..d201ee8daaa 100644 --- 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" diff --git a/gdb/testsuite/gdb.objc/print.exp b/gdb/testsuite/gdb.objc/print.exp index 2988d200f96..c9d5497fd80 100644 --- a/gdb/testsuite/gdb.objc/print.exp +++ b/gdb/testsuite/gdb.objc/print.exp @@ -28,6 +28,8 @@ if $tracelevel { load_lib "objc.exp" 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" @@ -42,12 +44,21 @@ proc test_float_accepted {} { gdb_test "p 1.l" " = 1" setup_kfail gdb/11925 "*-*-*" 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 {} { - # 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" diff --git a/gdb/testsuite/gdb.pascal/print.exp b/gdb/testsuite/gdb.pascal/print.exp index 61f6d3744d0..e8e4f4417f4 100644 --- a/gdb/testsuite/gdb.pascal/print.exp +++ b/gdb/testsuite/gdb.pascal/print.exp @@ -28,6 +28,8 @@ if $tracelevel { load_lib "pascal.exp" 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" @@ -38,12 +40,21 @@ 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 {} { - # 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" -- 2.30.2