aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/infnan.exp
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2007-03-30 14:31:44 +0000
committerDaniel Jacobowitz <drow@false.org>2007-03-30 14:31:44 +0000
commit203890574da95d16f8c453491026d349be4b2721 (patch)
tree710bf3d3ba4bba96d041b36ee261296db68f66a4 /gdb/testsuite/gdb.base/infnan.exp
parent30b50213ec9759b035bc719efb13ef5e090ed7ef (diff)
downloadgdb-203890574da95d16f8c453491026d349be4b2721.zip
gdb-203890574da95d16f8c453491026d349be4b2721.tar.gz
gdb-203890574da95d16f8c453491026d349be4b2721.tar.bz2
* doublest.c (convert_floatformat_to_doublest): Use
floatformat_classify. (floatformat_is_nan): Rename to... (floatformat_classify): ...this. Return more information. * doublest.h (enum float_kind): New. (floatformat_is_nan): Replace prototype... (floatformat_classify): ...with this one. * valprint.c (print_floating): Use floatformat_classify. Handle infinity. * gdb.base/infnan.c, gdb.base/infnan.exp: New files.
Diffstat (limited to 'gdb/testsuite/gdb.base/infnan.exp')
-rw-r--r--gdb/testsuite/gdb.base/infnan.exp36
1 files changed, 36 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/infnan.exp b/gdb/testsuite/gdb.base/infnan.exp
new file mode 100644
index 0000000..b14b6f3
--- /dev/null
+++ b/gdb/testsuite/gdb.base/infnan.exp
@@ -0,0 +1,36 @@
+# Copyright 2007 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Script to test floating point infinities and NaNs.
+
+set testfile "infnan"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ untested infnan.exp
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+runto_main
+
+gdb_test "print a" "\\\$$decimal = inf"
+gdb_test "print b" "\\\$$decimal = nan\\(0x.*\\)"