]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/testsuite/gdb.cp/userdef.exp
update copyright year range in GDB files
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.cp / userdef.exp
index 98bd10517ef5a8ad78df67befdda49763b8f5821..c78c696dae1d7651cb3c7264f179d7dcff511c0c 100644 (file)
@@ -1,5 +1,5 @@
 # Tests of overloaded operators resolution.
-# Copyright 1998-1999, 2002, 2004-2012 Free Software Foundation, Inc.
+# Copyright 1998-2017 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
 # source file "userdef.cc"
 #
 
-if $tracelevel then {
-        strace $tracelevel
-}
-
 if { [skip_stl_tests] } { continue }
 
 # On SPU this test fails because the executable exceeds local storage size.
@@ -30,22 +26,12 @@ if { [istarget "spu*-*-*"] } {
         return 0
 }
 
-set testfile "userdef"
-set srcfile ${testfile}.cc
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .cc
 
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
-     untested userdef.exp
-     return -1
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
+    return -1
 }
 
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
-
 if ![runto_main] then {
     perror "couldn't run to breakpoint"
     continue
@@ -140,14 +126,14 @@ gdb_test "print one += 7" "\\\$\[0-9\]* = {x = 9, y = 10}"
 gdb_test "print two = one" "\\\$\[0-9\]* = {x = 9, y = 10}"
 
 # Check that GDB tolerates whitespace in operator names.
-gdb_test "break A2::'operator+'" ".*Breakpoint $decimal at.*"
-gdb_test "break A2::'operator +'" ".*Breakpoint $decimal at.*"
+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|class) Member {(\[\r\n \]+public:)?\[\r\n \]+int z;\[\r\n\].*} &\\*"
+gdb_test "ptype &*c" "type = (struct|class) Member {(\[\r\n \]+public:)?\[\r\n \]+int z;\[\r\n\].*} \\*"
 
 gdb_test "print operator== (mem1, mem2)" " = false"
 gdb_test "print operator== (mem1, mem1)" " = true"