This commit was manufactured by cvs2svn to create branch 'gdb_7_0-branch'.
[external/binutils.git] / gdb / testsuite / gdb.base / exprs.exp
index f6ce719..711c72e 100644 (file)
@@ -1,9 +1,9 @@
 #   Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 2000,
-#   2001, 2003 Free Software Foundation, Inc.
+#   2001, 2003, 2007, 2008, 2009 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,
 # 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.  
-
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-gdb@prep.ai.mit.edu
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # This file was written by Rob Savoye. (rob@cygnus.com)
 
@@ -34,7 +30,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}] {
@@ -251,3 +248,14 @@ gdb_test "print (void*) ((long long) (unsigned long) -1 + 1)" \
 if [expr ! $ok] { setup_xfail "*-*-*" }
 gdb_test "print (void*) (~((long long)(unsigned long) -1) - 1)" \
        "warning: value truncated.*" "truncate (void*) 0xffffffff00000000 - 1"
+
+# String concatentation.
+test_expr "print \"x\" \"y\"" "\\$\[0-9\]* = \"xy\""
+test_expr "print \"x\" \"y\" \"z\"" "\\$\[0-9\]* = \"xyz\""
+
+# Enum formatting tests.
+test_expr "print red" "\\$\[0-9\]* = red"
+gdb_test "set output-radix 8" ""
+test_expr "print red" "\\$\[0-9\]* = red"
+test_expr "print/d red" "\\$\[0-9\]* = 0"
+gdb_test "set output-radix 10" ""