diff options
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/infnan.c | 30 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/infnan.exp | 36 |
3 files changed, 70 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index beea1bc..74d754d 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2007-03-30 Daniel Jacobowitz <dan@codesourcery.com> + * gdb.base/infnan.c, gdb.base/infnan.exp: New files. + +2007-03-30 Daniel Jacobowitz <dan@codesourcery.com> + * config/netware.exp: Delete file. 2007-03-29 Joel Brobecker <brobecker@adacore.com> diff --git a/gdb/testsuite/gdb.base/infnan.c b/gdb/testsuite/gdb.base/infnan.c new file mode 100644 index 0000000..4973663 --- /dev/null +++ b/gdb/testsuite/gdb.base/infnan.c @@ -0,0 +1,30 @@ +/* This test file is part of GDB, the GNU debugger. + + 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. */ + +double a = 1.0/0.0; +double b = 0.0/0.0; +double c; + +int +main() +{ + c = a + b; + return 0; +} 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.*\\)" |