X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Ftestsuite%2Fgdb.base%2Fexprs.exp;h=978db72137dcf62e79d39c583bb41cadf74557ac;hb=9b254dd1ce46c19dde1dde5b8d1e22e862dfacce;hp=1bffd0a12f2da81edc10215496e5940f834e643a;hpb=b6ba6518e9254bc25f88088228e93ac966ebccd1;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/testsuite/gdb.base/exprs.exp b/gdb/testsuite/gdb.base/exprs.exp index 1bffd0a12f..978db72137 100644 --- a/gdb/testsuite/gdb.base/exprs.exp +++ b/gdb/testsuite/gdb.base/exprs.exp @@ -1,9 +1,9 @@ -# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 2000 -# Free Software Foundation, Inc. +# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 2000, +# 2001, 2003, 2007, 2008 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 +# the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, @@ -12,8 +12,7 @@ # 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. +# along with this program. If not, see . # Please email any bugs, comments, and/or additions to this file to: # bug-gdb@prep.ai.mit.edu @@ -34,7 +33,8 @@ set testfile "exprs" set srcfile ${testfile}.c set binfile ${objdir}/${subdir}/${testfile} if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { - gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." + untested exprs.exp + return -1 } if [get_compiler_info ${binfile}] { @@ -98,14 +98,8 @@ test_expr "set variable v_unsigned_char=127" "print v_unsigned_char != 0" "\\$\[ test_expr "set variable v_unsigned_char=127" "print v_unsigned_char < 0" "\\$\[0-9\]* = $false" "print v_unsigned_char < 127" "\\$\[0-9\]* = $false" "print unsigned char <" test_expr "set variable v_unsigned_char=127" "print v_unsigned_char > 0" "\\$\[0-9\]* = $true" "print v_unsigned_char > 127" "\\$\[0-9\]* = $false" "print unsigned char >" # make char a minus -# FIXME: gdb mishandles the cast (unsigned char) on the i960, so I've -# set up an expected failure for this case. -setup_xfail "i960-*-*" 1821 -test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char == 0" "\\$\[0-9\]* = $false" "print v_unsigned_char == ~0" "\\$\[0-9\]* = $false" "print v_unsigned_char == (unsigned char)~0" "\\$\[0-9\]* = $true" "print unsigned char == (~0)" -# FIXME: gdb mishandles the cast (unsigned char) on the i960, so I've -# set up an expected failure for this case. -setup_xfail "i960-*-*" 1821 -test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char != 0" "\\$\[0-9\]* = $true" "print v_unsigned_char != (unsigned char)~0" "\\$\[0-9\]* = $false" "print unsigned char != (~0)" +test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char == 0" "\\$\[0-9\]* = $false" "print v_unsigned_char == ~0" "\\$\[0-9\]* = $false" "print v_unsigned_char == (unsigned char)~0" "\\$\[0-9\]* = $true" "print unsigned char == (~0)" +test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char != 0" "\\$\[0-9\]* = $true" "print v_unsigned_char != (unsigned char)~0" "\\$\[0-9\]* = $false" "print v_unsigned_char != ~0" "\\$\[0-9\]* = $true" "print unsigned char != (~0)" test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char < 0" "\\$\[0-9\]* = $false" "print v_unsigned_char < 127" "\\$\[0-9\]* = $false" "print unsigned char < (~0)" test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char > 0" "\\$\[0-9\]* = $true" "print v_unsigned_char > 127" "\\$\[0-9\]* = $true" "print unsigned char > (~0)" # @@ -140,7 +134,7 @@ test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short != 0" " test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short < 0" "\\$\[0-9\]* = $false" "print v_unsigned_short < 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned short <" test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short > 0" "\\$\[0-9\]* = $true" "print v_unsigned_short > 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned short >" # make short a minus -test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short == 0" "\\$\[0-9\]* = $false" "print v_unsigned_short == ~0" "\\$\[0-9\]* = $false" "print v_unsigned_short == (unsigned short)~0" "\\$\[0-9\]* = $true" "print unsigned short == (~0)" +test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short == 0" "\\$\[0-9\]* = $false" "print sizeof (v_unsigned_short) < sizeof (~0) && v_unsigned_short == ~0" "\\$\[0-9\]* = $false" "print v_unsigned_short == (unsigned short)~0" "\\$\[0-9\]* = $true" "print unsigned short == (~0)" test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short != 0" "\\$\[0-9\]* = $true" "print v_unsigned_short != (unsigned short)~0" "\\$\[0-9\]* = $false" "print unsigned short != (~0)" test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short < 0" "\\$\[0-9\]* = $false" "print v_unsigned_short < 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned short < (~0)" test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short > 0" "\\$\[0-9\]* = $true" "print v_unsigned_short > 0x7FFF" "\\$\[0-9\]* = $true" "print unsigned short > (~0)" @@ -238,11 +232,11 @@ test_expr "set variable v_unsigned_long = 0" "print (void*)v_unsigned_long" "\\$ # send_gdb "print sizeof (long long) > sizeof (long)\n" gdb_expect { - -re "\\$\[0-9\]* = $true" { + -re "\\$\[0-9\]* = $true.*$gdb_prompt" { set ok 1 pass "sizeof (long long) > sizeof (long) (true)" } - -re "\\$\[0-9\]* = $false" { + -re "\\$\[0-9\]* = $false.*$gdb_prompt" { set ok 0 pass "sizeof (long long) > sizeof (long) (false)" }