Switch the license of all .exp files to GPLv3.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.cp / userdef.exp
index 86e901dcd941433e39ef4cc4b08f57336ffec282..c0e4ae3610e81f8f40c11b951d4a9e48ced20427 100644 (file)
@@ -1,19 +1,19 @@
 # Tests of overloaded operators resolution.
-# Copyright 1998, 1999, 2002, 2004 Free Software Foundation, Inc.
+# Copyright 1998, 1999, 2002, 2004, 2005, 2006, 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
+# 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,
 # 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.  
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # written by Elena Zannoni (ezannoni@cygnus.com)
 #
@@ -26,12 +26,18 @@ if $tracelevel then {
 
 if { [skip_cplus_tests] } { continue }
 
+# On SPU this test fails because the executable exceeds local storage size.
+if { [istarget "spu*-*-*"] } {
+        return 0
+}
+
 set testfile "userdef"
 set srcfile ${testfile}.cc
 set binfile ${objdir}/${subdir}/${testfile}
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
-     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+     untested userdef.exp
+     return -1
 }
 
 
@@ -143,5 +149,11 @@ gdb_test "print two = one" "\\\$\[0-9\]* = {x = 9, y = 10}"
 gdb_test "break A2::'operator+'" ".*Breakpoint $decimal at.*"
 gdb_test "break A2::'operator +'" ".*Breakpoint $decimal at.*"
 
+# Check that GDB handles operator* correctly.
+gdb_test "print c" "\\\$\[0-9\]* = {m = {z = .*}}"
+gdb_test "print *c" "\\\$\[0-9\]* = \\(Member &\\) @$hex: {z = .*}"
+gdb_test "print &*c" "\\\$\[0-9\]* = \\(Member \\*\\) $hex"
+gdb_test "ptype &*c" "type = struct Member {\[\r\n \]+int z;\[\r\n\]+} &\\*"
+
 gdb_exit
 return 0
This page took 0.024926 seconds and 4 git commands to generate.