* gdb.cp/abstract-origin.exp: Use standard_testfile.

* gdb.cp/ambiguous.exp: Use standard_testfile,
	prepare_for_testing.
	* gdb.cp/annota2.exp: Use standard_testfile, prepare_for_testing.
	* gdb.cp/annota3.exp: Use standard_testfile, prepare_for_testing.
	* gdb.cp/anon-ns.exp: Use standard_testfile.
	* gdb.cp/anon-struct.exp: Use standard_testfile.
	* gdb.cp/anon-union.exp: Use standard_testfile,
	prepare_for_testing.
	* gdb.cp/arg-reference.exp: Use standard_testfile,
	prepare_for_testing.
	* gdb.cp/bool.exp: Use standard_testfile, prepare_for_testing.
	* gdb.cp/breakpoint.exp: Use standard_testfile,
	prepare_for_testing.
	* gdb.cp/bs15503.exp: Use standard_testfile, prepare_for_testing.
	* gdb.cp/call-c.exp: Use standard_testfile, clean_restart,
	standard_output_file.
	* gdb.cp/casts.exp: Use standard_testfile, prepare_for_testing.
	* gdb.cp/class2.exp: Use standard_testfile, prepare_for_testing.
	* gdb.cp/classes.exp: Use standard_testfile, prepare_for_testing.
	(test_static_members): Update.
	* gdb.cp/cmpd-minsyms.exp: Use standard_testfile.
	* gdb.cp/converts.exp: Use standard_testfile.
	* gdb.cp/cp-relocate.exp: Use standard_testfile.
	* gdb.cp/cpcompletion.exp: Use standard_testfile,
	prepare_for_testing.
	* gdb.cp/cpexprs.exp: Use standard_testfile, prepare_for_testing.
	* gdb.cp/cplabel.exp: Use standard_testfile.
	* gdb.cp/cplusfuncs.exp: Use standard_testfile,
	prepare_for_testing.
	* gdb.cp/ctti.exp: Use standard_testfile, prepare_for_testing.
	* gdb.cp/derivation.exp: Use standard_testfile,
	prepare_for_testing.
	* gdb.cp/destrprint.exp: Use standard_testfile.
	* gdb.cp/dispcxx.exp: Use standard_testfile.
	* gdb.cp/exception.exp: Use standard_testfile,
	prepare_for_testing.
	* gdb.cp/expand-psymtabs-cxx.exp: Use standard_testfile.
	* gdb.cp/extern-c.exp: Use standard_testfile,
	prepare_for_testing.
	* gdb.cp/formatted-ref.exp: Use standard_testfile,
	prepare_for_testing.
	* gdb.cp/fpointer.exp: Use standard_testfile.
	* gdb.cp/gdb1355.exp: Use standard_testfile, prepare_for_testing.
	* gdb.cp/gdb2384.exp: Use standard_testfile, clean_restart,
	standard_output_file.
	* gdb.cp/gdb2495.exp: Use standard_testfile, prepare_for_testing.
	* gdb.cp/hang.exp: Use standard_testfile, prepare_for_testing.
	* gdb.cp/infcall-dlopen.exp: Use standard_testfile,
	standard_output_file.
	* gdb.cp/inherit.exp: Use standard_testfile, prepare_for_testing.
	(do_tests): Update.
	* gdb.cp/koenig.exp: Use standard_testfile.
	* gdb.cp/local.exp: Use standard_testfile, prepare_for_testing.
	* gdb.cp/m-data.exp: Use standard_testfile, prepare_for_testing.
	* gdb.cp/m-static.exp: Use standard_testfile,
	prepare_for_testing.
	* gdb.cp/mb-ctor.exp: Use standard_testfile, prepare_for_testing.
	* gdb.cp/mb-inline.exp: Use standard_testfile,
	prepare_for_testing.
	* gdb.cp/mb-templates.exp: Use standard_testfile,
	prepare_for_testing.
	* gdb.cp/member-ptr.exp: Use standard_testfile,
	prepare_for_testing.
	* gdb.cp/meth-typedefs.exp: Use standard_testfile.
	* gdb.cp/method.exp: Use standard_testfile, prepare_for_testing.
	* gdb.cp/method2.exp: Use standard_testfile.
	* gdb.cp/minsym-fallback.exp: Use standard_testfile,
	standard_output_file.
	* gdb.cp/misc.exp: Use standard_testfile, prepare_for_testing.
	(do_tests): Update.
	* gdb.cp/namespace-enum.exp: Use standard_testfile,
	prepare_for_testing.
	* gdb.cp/namespace-nested-import.exp: Use standard_testfile,
	prepare_for_testing.
	* gdb.cp/namespace.exp: Use standard_testfile,
	prepare_for_testing.
	* gdb.cp/nextoverthrow.exp: Use standard_testfile.
	* gdb.cp/no-dmgl-verbose.exp: Use standard_testfile.
	* gdb.cp/nsdecl.exp: Use standard_testfile, prepare_for_testing.
	* gdb.cp/nsimport.exp: Use standard_testfile,
	prepare_for_testing.
	* gdb.cp/nsnested.exp: Use standard_testfile.
	* gdb.cp/nsnoimports.exp: Use standard_testfile.
	* gdb.cp/nsrecurs.exp: Use standard_testfile,
	prepare_for_testing.
	* gdb.cp/nsstress.exp: Use standard_testfile,
	prepare_for_testing.
	* gdb.cp/nsusing.exp: Use standard_testfile, prepare_for_testing.
	* gdb.cp/operator.exp: Use standard_testfile.
	* gdb.cp/oranking.exp: Use standard_testfile.
	* gdb.cp/overload-const.exp: Use standard_testfile.
	* gdb.cp/overload.exp: Use standard_testfile,
	prepare_for_testing.
	* gdb.cp/ovldbreak.exp: Use standard_testfile.
	* gdb.cp/ovsrch.exp: Use standard_testfile.
	* gdb.cp/paren-type.exp: Use standard_testfile.
	* gdb.cp/pass-by-ref.exp: Use standard_testfile,
	prepare_for_testing.
	* gdb.cp/pr-1023.exp: Use standard_testfile, prepare_for_testing.
	* gdb.cp/pr-1210.exp: Use standard_testfile, prepare_for_testing.
	* gdb.cp/pr-574.exp: Use standard_testfile, prepare_for_testing.
	* gdb.cp/pr10687.exp: Use standard_testfile, clean_restart.
	* gdb.cp/pr10728.exp: Use standard_testfile,
	standard_output_file.
	* gdb.cp/pr12028.exp: Use standard_testfile.
	* gdb.cp/pr9067.exp: Use standard_testfile, prepare_for_testing.
	* gdb.cp/pr9167.exp: Use standard_testfile.
	* gdb.cp/pr9631.exp: Use standard_testfile, prepare_for_testing.
	* gdb.cp/printmethod.exp: Use standard_testfile,
	prepare_for_testing.
	* gdb.cp/psmang.exp: Use standard_testfile, clean_restart.
	* gdb.cp/psymtab-parameter.exp: Use standard_testfile.
	* gdb.cp/ptype-cv-cp.exp: Use standard_testfile.
	* gdb.cp/re-set-overloaded.exp: Use standard_testfile,
	standard_output_file.
	* gdb.cp/readnow-language.exp: Use standard_testfile.
	* gdb.cp/ref-params.exp: Use standard_testfile, build_executable.
	(gdb_start_again): Use clean_restart.
	* gdb.cp/ref-types.exp: Use standard_testfile,
	prepare_for_testing.
	* gdb.cp/rtti.exp: Use standard_testfile, prepare_for_testing.
	* gdb.cp/shadow.exp: Use standard_testfile, prepare_for_testing.
	* gdb.cp/smartp.exp: Use standard_testfile.
	* gdb.cp/static-method.exp: Use standard_testfile.
	* gdb.cp/static-print-quit.exp: Use standard_testfile.
	* gdb.cp/temargs.exp: Use standard_testfile.
	* gdb.cp/templates.exp: Use standard_testfile,
	prepare_for_testing.
	(do_tests): Update.
	* gdb.cp/try_catch.exp: Use standard_testfile,
	prepare_for_testing.
	* gdb.cp/typedef-operator.exp: Use standard_testfile.
	* gdb.cp/userdef.exp: Use standard_testfile, prepare_for_testing.
	* gdb.cp/virtbase.exp: Use standard_testfile,
	prepare_for_testing.
	* gdb.cp/virtfunc.exp: Use standard_testfile,
	prepare_for_testing.
	(do_tests): Update.
	* gdb.cp/virtfunc2.exp: Use standard_testfile,
	prepare_for_testing.
This commit is contained in:
Tom Tromey 2012-07-10 15:18:18 +00:00
parent 81c82a68dc
commit f5f3a911ec
101 changed files with 460 additions and 1027 deletions

View File

@ -1,3 +1,147 @@
2012-07-10 Tom Tromey <tromey@redhat.com>
* gdb.cp/abstract-origin.exp: Use standard_testfile.
* gdb.cp/ambiguous.exp: Use standard_testfile,
prepare_for_testing.
* gdb.cp/annota2.exp: Use standard_testfile, prepare_for_testing.
* gdb.cp/annota3.exp: Use standard_testfile, prepare_for_testing.
* gdb.cp/anon-ns.exp: Use standard_testfile.
* gdb.cp/anon-struct.exp: Use standard_testfile.
* gdb.cp/anon-union.exp: Use standard_testfile,
prepare_for_testing.
* gdb.cp/arg-reference.exp: Use standard_testfile,
prepare_for_testing.
* gdb.cp/bool.exp: Use standard_testfile, prepare_for_testing.
* gdb.cp/breakpoint.exp: Use standard_testfile,
prepare_for_testing.
* gdb.cp/bs15503.exp: Use standard_testfile, prepare_for_testing.
* gdb.cp/call-c.exp: Use standard_testfile, clean_restart,
standard_output_file.
* gdb.cp/casts.exp: Use standard_testfile, prepare_for_testing.
* gdb.cp/class2.exp: Use standard_testfile, prepare_for_testing.
* gdb.cp/classes.exp: Use standard_testfile, prepare_for_testing.
(test_static_members): Update.
* gdb.cp/cmpd-minsyms.exp: Use standard_testfile.
* gdb.cp/converts.exp: Use standard_testfile.
* gdb.cp/cp-relocate.exp: Use standard_testfile.
* gdb.cp/cpcompletion.exp: Use standard_testfile,
prepare_for_testing.
* gdb.cp/cpexprs.exp: Use standard_testfile, prepare_for_testing.
* gdb.cp/cplabel.exp: Use standard_testfile.
* gdb.cp/cplusfuncs.exp: Use standard_testfile,
prepare_for_testing.
* gdb.cp/ctti.exp: Use standard_testfile, prepare_for_testing.
* gdb.cp/derivation.exp: Use standard_testfile,
prepare_for_testing.
* gdb.cp/destrprint.exp: Use standard_testfile.
* gdb.cp/dispcxx.exp: Use standard_testfile.
* gdb.cp/exception.exp: Use standard_testfile,
prepare_for_testing.
* gdb.cp/expand-psymtabs-cxx.exp: Use standard_testfile.
* gdb.cp/extern-c.exp: Use standard_testfile,
prepare_for_testing.
* gdb.cp/formatted-ref.exp: Use standard_testfile,
prepare_for_testing.
* gdb.cp/fpointer.exp: Use standard_testfile.
* gdb.cp/gdb1355.exp: Use standard_testfile, prepare_for_testing.
* gdb.cp/gdb2384.exp: Use standard_testfile, clean_restart,
standard_output_file.
* gdb.cp/gdb2495.exp: Use standard_testfile, prepare_for_testing.
* gdb.cp/hang.exp: Use standard_testfile, prepare_for_testing.
* gdb.cp/infcall-dlopen.exp: Use standard_testfile,
standard_output_file.
* gdb.cp/inherit.exp: Use standard_testfile, prepare_for_testing.
(do_tests): Update.
* gdb.cp/koenig.exp: Use standard_testfile.
* gdb.cp/local.exp: Use standard_testfile, prepare_for_testing.
* gdb.cp/m-data.exp: Use standard_testfile, prepare_for_testing.
* gdb.cp/m-static.exp: Use standard_testfile,
prepare_for_testing.
* gdb.cp/mb-ctor.exp: Use standard_testfile, prepare_for_testing.
* gdb.cp/mb-inline.exp: Use standard_testfile,
prepare_for_testing.
* gdb.cp/mb-templates.exp: Use standard_testfile,
prepare_for_testing.
* gdb.cp/member-ptr.exp: Use standard_testfile,
prepare_for_testing.
* gdb.cp/meth-typedefs.exp: Use standard_testfile.
* gdb.cp/method.exp: Use standard_testfile, prepare_for_testing.
* gdb.cp/method2.exp: Use standard_testfile.
* gdb.cp/minsym-fallback.exp: Use standard_testfile,
standard_output_file.
* gdb.cp/misc.exp: Use standard_testfile, prepare_for_testing.
(do_tests): Update.
* gdb.cp/namespace-enum.exp: Use standard_testfile,
prepare_for_testing.
* gdb.cp/namespace-nested-import.exp: Use standard_testfile,
prepare_for_testing.
* gdb.cp/namespace.exp: Use standard_testfile,
prepare_for_testing.
* gdb.cp/nextoverthrow.exp: Use standard_testfile.
* gdb.cp/no-dmgl-verbose.exp: Use standard_testfile.
* gdb.cp/nsdecl.exp: Use standard_testfile, prepare_for_testing.
* gdb.cp/nsimport.exp: Use standard_testfile,
prepare_for_testing.
* gdb.cp/nsnested.exp: Use standard_testfile.
* gdb.cp/nsnoimports.exp: Use standard_testfile.
* gdb.cp/nsrecurs.exp: Use standard_testfile,
prepare_for_testing.
* gdb.cp/nsstress.exp: Use standard_testfile,
prepare_for_testing.
* gdb.cp/nsusing.exp: Use standard_testfile, prepare_for_testing.
* gdb.cp/operator.exp: Use standard_testfile.
* gdb.cp/oranking.exp: Use standard_testfile.
* gdb.cp/overload-const.exp: Use standard_testfile.
* gdb.cp/overload.exp: Use standard_testfile,
prepare_for_testing.
* gdb.cp/ovldbreak.exp: Use standard_testfile.
* gdb.cp/ovsrch.exp: Use standard_testfile.
* gdb.cp/paren-type.exp: Use standard_testfile.
* gdb.cp/pass-by-ref.exp: Use standard_testfile,
prepare_for_testing.
* gdb.cp/pr-1023.exp: Use standard_testfile, prepare_for_testing.
* gdb.cp/pr-1210.exp: Use standard_testfile, prepare_for_testing.
* gdb.cp/pr-574.exp: Use standard_testfile, prepare_for_testing.
* gdb.cp/pr10687.exp: Use standard_testfile, clean_restart.
* gdb.cp/pr10728.exp: Use standard_testfile,
standard_output_file.
* gdb.cp/pr12028.exp: Use standard_testfile.
* gdb.cp/pr9067.exp: Use standard_testfile, prepare_for_testing.
* gdb.cp/pr9167.exp: Use standard_testfile.
* gdb.cp/pr9631.exp: Use standard_testfile, prepare_for_testing.
* gdb.cp/printmethod.exp: Use standard_testfile,
prepare_for_testing.
* gdb.cp/psmang.exp: Use standard_testfile, clean_restart.
* gdb.cp/psymtab-parameter.exp: Use standard_testfile.
* gdb.cp/ptype-cv-cp.exp: Use standard_testfile.
* gdb.cp/re-set-overloaded.exp: Use standard_testfile,
standard_output_file.
* gdb.cp/readnow-language.exp: Use standard_testfile.
* gdb.cp/ref-params.exp: Use standard_testfile, build_executable.
(gdb_start_again): Use clean_restart.
* gdb.cp/ref-types.exp: Use standard_testfile,
prepare_for_testing.
* gdb.cp/rtti.exp: Use standard_testfile, prepare_for_testing.
* gdb.cp/shadow.exp: Use standard_testfile, prepare_for_testing.
* gdb.cp/smartp.exp: Use standard_testfile.
* gdb.cp/static-method.exp: Use standard_testfile.
* gdb.cp/static-print-quit.exp: Use standard_testfile.
* gdb.cp/temargs.exp: Use standard_testfile.
* gdb.cp/templates.exp: Use standard_testfile,
prepare_for_testing.
(do_tests): Update.
* gdb.cp/try_catch.exp: Use standard_testfile,
prepare_for_testing.
* gdb.cp/typedef-operator.exp: Use standard_testfile.
* gdb.cp/userdef.exp: Use standard_testfile, prepare_for_testing.
* gdb.cp/virtbase.exp: Use standard_testfile,
prepare_for_testing.
* gdb.cp/virtfunc.exp: Use standard_testfile,
prepare_for_testing.
(do_tests): Update.
* gdb.cp/virtfunc2.exp: Use standard_testfile,
prepare_for_testing.
2012-07-10 Tom Tromey <tromey@redhat.com> 2012-07-10 Tom Tromey <tromey@redhat.com>
* lib/gdb.exp (standard_testfile): Unset output variables from * lib/gdb.exp (standard_testfile): Unset output variables from

View File

@ -13,9 +13,9 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set testfile abstract-origin standard_testfile .cc
set srcfile ${testfile}.cc
if [prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}] { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
return -1 return -1
} }

View File

@ -28,9 +28,7 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "ambiguous" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if [get_compiler_info "c++"] { if [get_compiler_info "c++"] {
return -1; return -1;
@ -38,18 +36,10 @@ if [get_compiler_info "c++"] {
if { [test_compiler_info gcc-*] } then { continue } if { [test_compiler_info gcc-*] } then { continue }
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
untested ambiguous.exp return -1
return -1
} }
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
# #
# set it up at a breakpoint so we can play with the variable values # set it up at a breakpoint so we can play with the variable values
# #

View File

@ -22,12 +22,10 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "annota2" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++ nowarnings}] != "" } { if {[prepare_for_testing $testfile.exp $testfile $srcfile \
untested annota2.exp {debug c++ nowarnings}]} {
return -1 return -1
} }
@ -40,12 +38,6 @@ if [is_remote target] then {
return 0 return 0
} }
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
# #
# line number where we need to stop in main # line number where we need to stop in main
# #

View File

@ -22,12 +22,10 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "annota3" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++ nowarnings}] != "" } { if {[prepare_for_testing $testfile.exp $testfile $srcfile \
untested annota3.exp {debug c++ nowarnings}]} {
return -1 return -1
} }
@ -40,12 +38,6 @@ if [is_remote target] then {
return 0 return 0
} }
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
# #
# line number where we need to stop in main # line number where we need to stop in main
# #

View File

@ -19,9 +19,7 @@
if {[skip_cplus_tests]} { continue } if {[skip_cplus_tests]} { continue }
# Tests for c++/12750/12704 standard_testfile .cc
set testfile "anon-ns"
set srcfile $testfile.cc
if {[prepare_for_testing $testfile $testfile $srcfile {c++ debug}]} { if {[prepare_for_testing $testfile $testfile $srcfile {c++ debug}]} {
return -1 return -1

View File

@ -14,9 +14,8 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set testfile anon-struct standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug c++}] } { if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug c++}] } {
return -1 return -1
} }

View File

@ -26,22 +26,12 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "anon-union" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
perror "Testcase compile failed" 0 return -1
continue
} }
# Start with a fresh gdb
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
if ![runto_main] then { if ![runto_main] then {
perror "couldn't run to breakpoint" perror "couldn't run to breakpoint"
continue continue

View File

@ -24,18 +24,10 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "arg-reference" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
untested ${testfile}.exp
return -1 return -1
} }
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
gdb_test "ptype foo" "type = int \\\(Obj\\\)" "No false reference" gdb_test "ptype foo" "type = int \\\(Obj\\\)" "No false reference"

View File

@ -23,20 +23,12 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "bool" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
untested bool.exp
return -1 return -1
} }
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
runto_main runto_main
# Testcases for tdep/2075. # Testcases for tdep/2075.

View File

@ -23,23 +23,15 @@ if { [skip_cplus_tests] } { continue }
# test running programs # test running programs
# #
set testfile "breakpoint" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
untested breakpoint.exp
return -1
}
if [get_compiler_info "c++"] { if [get_compiler_info "c++"] {
return -1 return -1
} }
gdb_exit if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
gdb_start return -1
gdb_reinitialize_dir $srcdir/$subdir }
gdb_load ${binfile}
proc test_breakpoint {name} { proc test_breakpoint {name} {
# Restart the program every time, so that a single failure doesn't # Restart the program every time, so that a single failure doesn't

View File

@ -24,24 +24,16 @@ if { [istarget "spu*-*-*"] } {
return 0 return 0
} }
set testfile "bs15503" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if [get_compiler_info] { if [get_compiler_info] {
return -1 return -1
} }
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "debug c++"] != "" } { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
untested bs15503.exp
return -1 return -1
} }
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
if ![runto_main] then { if ![runto_main] then {
perror "couldn't run to breakpoint" perror "couldn't run to breakpoint"
continue continue

View File

@ -16,24 +16,18 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile call-c standard_testfile .cc call-c-1.c
set binfile ${objdir}/${subdir}/${testfile} set objfilec [standard_output_file ${testfile}-1.o]
set srcfilec ${srcdir}/${subdir}/${testfile}-1.c set objfilecpp [standard_output_file ${testfile}.o]
set srcfilecpp ${srcdir}/${subdir}/${testfile}.cc
set objfilec ${objdir}/${subdir}/${testfile}-1.o
set objfilecpp ${objdir}/${subdir}/${testfile}.o
if {[gdb_compile "${srcfilec}" "${objfilec}" object {debug}] != "" if {[gdb_compile "$srcdir/$subdir/${srcfile2}" "${objfilec}" object {debug}] != ""
|| [gdb_compile "${srcfilecpp}" "${objfilecpp}" object {c++ debug}] != "" || [gdb_compile "$srcdir/$subdir/${srcfile}" "${objfilecpp}" object {c++ debug}] != ""
|| [gdb_compile "${objfilecpp} ${objfilec}" "${binfile}" executable {c++ debug}] != ""} { || [gdb_compile "${objfilecpp} ${objfilec}" "${binfile}" executable {c++ debug}] != ""} {
untested ${testfile}.exp untested ${testfile}.exp
return -1 return -1
} }
gdb_exit clean_restart ${binfile}
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
runto_main runto_main

View File

@ -27,25 +27,16 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "casts" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if [get_compiler_info "c++"] { if [get_compiler_info "c++"] {
return -1; return -1;
} }
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
untested casts.exp return -1
return -1
} }
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
if ![runto_main] then { if ![runto_main] then {
perror "couldn't run to breakpoint" perror "couldn't run to breakpoint"
continue continue

View File

@ -16,9 +16,7 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "class2" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
# Create and source the file that provides information about the compiler # Create and source the file that provides information about the compiler
# used to compile the test case. # used to compile the test case.
@ -26,16 +24,10 @@ if [get_compiler_info "c++"] {
return -1 return -1
} }
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
untested class2.exp
return -1 return -1
} }
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
# Start with "set print object off". # Start with "set print object off".
gdb_test_no_output "set print object off" gdb_test_no_output "set print object off"

View File

@ -22,13 +22,10 @@ if { [skip_cplus_tests] } { continue }
load_lib "cp-support.exp" load_lib "cp-support.exp"
set testfile "classes" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
untested classes.exp return -1
return -1
} }
# Test ptype of class objects. # Test ptype of class objects.
@ -541,21 +538,10 @@ proc test_static_members {} {
} }
proc do_tests {} { proc do_tests {} {
global subdir
global objdir
global srcdir
global binfile
global gdb_prompt global gdb_prompt
global nl global nl
# Start with a fresh gdb.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $binfile
gdb_test_no_output "set language c++" "" gdb_test_no_output "set language c++" ""
gdb_test_no_output "set width 0" "" gdb_test_no_output "set width 0" ""

View File

@ -20,9 +20,10 @@
if {[skip_cplus_tests]} { continue } if {[skip_cplus_tests]} { continue }
# Tests for c++/12273, breakpoint/12803 # Tests for c++/12273, breakpoint/12803
set testfile "cmpd-minsyms" standard_testfile .cc
# Do NOT compile with debug flag. # Do NOT compile with debug flag.
if {[prepare_for_testing $testfile $testfile $testfile.cc {c++}]} { if {[prepare_for_testing $testfile $testfile $srcfile {c++}]} {
return -1 return -1
} }

View File

@ -13,8 +13,8 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set testfile converts standard_testfile .cc
set srcfile ${testfile}.cc
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug c++}] } { if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug c++}] } {
return -1 return -1
} }

View File

@ -15,9 +15,8 @@
# Test loading symbols from unrelocated C++ object files. # Test loading symbols from unrelocated C++ object files.
set testfile cp-relocate standard_testfile .cc
set srcfile ${testfile}.cc append binfile .o
set binfile ${objdir}/${subdir}/${testfile}.o
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }

View File

@ -51,25 +51,12 @@ proc test_class_complete {class expr name matches} {
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile pr9594 standard_testfile pr9594.cc
set binfile ${objdir}/${subdir}/${testfile}
if {[gdb_compile "${srcdir}/${subdir}/${testfile}.cc" "${testfile}.o" object {c++ debug}] != ""} { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
untested cpcompletion.exp
return -1 return -1
} }
if {[gdb_compile "${testfile}.o" ${binfile} executable {c++ debug}] != "" } {
untested cpcompletion.exp
return -1
}
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
# Test that completion is restricted by class name (all methods) # Test that completion is restricted by class name (all methods)
test_class_complete Foo "" "complete class methods" \ test_class_complete Foo "" "complete class methods" \
[list Foo Foofoo get_foo set_foo ~Foo] [list Foo Foofoo get_foo set_foo ~Foo]
@ -79,9 +66,9 @@ test_class_complete Foo F "complete class methods beginning with F" \
# The tests below depend on the current code scope. # The tests below depend on the current code scope.
set bp_location [gdb_get_line_number "Set breakpoint here" ${testfile}.cc] set bp_location [gdb_get_line_number "Set breakpoint here" ${srcfile}]
if {![runto "${testfile}.cc:$bp_location"]} { if {![runto "${srcfile}:$bp_location"]} {
perror "test suppressed" perror "test suppressed"
return return
} }

View File

@ -674,24 +674,15 @@ if { [istarget "spu*-*-*"] } {
# test running programs # test running programs
# #
set testfile "cpexprs" standard_testfile .cc
set srcfile "${testfile}.cc"
set binfile [file join $objdir $subdir $testfile]
if {[gdb_compile [file join $srcdir $subdir $srcfile] $binfile \
executable {debug c++}] != "" } {
untested "$testfile.exp"
return -1
}
if {[get_compiler_info "c++"]} { if {[get_compiler_info "c++"]} {
return -1 return -1
} }
gdb_exit if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
gdb_start return -1
gdb_reinitialize_dir [file join $srcdir $subdir] }
gdb_load $binfile
if {![runto_main]} { if {![runto_main]} {
perror "couldn't run to breakpoint" perror "couldn't run to breakpoint"

View File

@ -17,8 +17,8 @@
if {[skip_cplus_tests]} { continue } if {[skip_cplus_tests]} { continue }
set testfile cplabel standard_testfile .cc
set srcfile "$testfile.cc"
if {[prepare_for_testing "$testfile.exp" $testfile $srcfile {c++ debug}]} { if {[prepare_for_testing "$testfile.exp" $testfile $srcfile {c++ debug}]} {
return -1 return -1
} }

View File

@ -19,17 +19,14 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "cplusfuncs" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [get_compiler_info "c++"] } { if { [get_compiler_info "c++"] } {
return -1 return -1
} }
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
untested cplusfuncs.exp return -1
return -1
} }
# #
@ -584,20 +581,10 @@ proc test_paddr_hairy_functions {} {
} }
proc do_tests {} { proc do_tests {} {
global subdir
global objdir
global srcdir
global binfile global binfile
global gdb_prompt
global dm_type_int_star global dm_type_int_star
clean_restart $binfile
# Start with a fresh gdb.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $binfile
gdb_test_no_output "set width 0" gdb_test_no_output "set width 0"

View File

@ -24,50 +24,16 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "cttiadd" standard_testfile cttiadd.cc cttiadd1.cc cttiadd2.cc cttiadd3.cc
set srcfile "${testfile}.cc"
set srcfile1 "${testfile}1.cc"
set srcfile2 "${testfile}2.cc"
set srcfile3 "${testfile}3.cc"
set objfile "${testfile}.o"
set objfile1 "${testfile}1.o"
set objfile2 "${testfile}2.o"
set objfile3 "${testfile}3.o"
set binfile "${objdir}/${subdir}/${testfile}"
if { [gdb_compile "$srcdir/$subdir/$srcfile" "$objdir/$subdir/$objfile" object {debug c++}] != "" } {
untested ctti.exp
return -1
}
if { [gdb_compile "$srcdir/$subdir/$srcfile1" "$objdir/$subdir/$objfile1" object {debug c++}] != "" } {
untested ctti.exp
return -1
}
if { [gdb_compile "$srcdir/$subdir/$srcfile2" "$objdir/$subdir/$objfile2" object {debug c++}] != "" } {
untested ctti.exp
return -1
}
if { [gdb_compile "$srcdir/$subdir/$srcfile3" "$objdir/$subdir/$objfile3" object {debug c++}] != "" } {
untested ctti.exp
return -1
}
if { [gdb_compile "$objdir/$subdir/$objfile $objdir/$subdir/$objfile1 $objdir/$subdir/$objfile2 $objdir/$subdir/$objfile3" "${binfile}" executable {debug c++}] != "" } {
untested ctti.exp
return -1
}
if [get_compiler_info "c++"] { if [get_compiler_info "c++"] {
return -1; return -1;
} }
gdb_exit if {[prepare_for_testing $testfile.exp $testfile \
gdb_start [list $srcfile $srcfile2 $srcfile3 $srcfile4] {debug c++}]} {
gdb_reinitialize_dir $srcdir/$subdir return -1
gdb_load ${binfile} }
if ![runto_main] then { if ![runto_main] then {
perror "couldn't run to breakpoint" perror "couldn't run to breakpoint"

View File

@ -32,20 +32,12 @@ if { [skip_cplus_tests] } { continue }
load_lib "cp-support.exp" load_lib "cp-support.exp"
set testfile "derivation" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
untested derivation.exp return -1
return -1
} }
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
# Set it up at a breakpoint so we can play with the variable values. # Set it up at a breakpoint so we can play with the variable values.
if ![runto 'marker1'] then { if ![runto 'marker1'] then {

View File

@ -13,9 +13,9 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set testfile destrprint standard_testfile .cc
set srcfile ${testfile}.cc
if [prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}] { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
return -1 return -1
} }

View File

@ -15,9 +15,7 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile dispcxx standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if [get_compiler_info "c++"] { if [get_compiler_info "c++"] {
untested dispcxx.exp untested dispcxx.exp

View File

@ -41,23 +41,12 @@ if { [istarget "spu*-*-*"] } {
return 0 return 0
} }
set testfile "exception" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
untested exception.exp return -1
return -1
} }
# Start with a fresh gdb
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
# Set a catch catchpoint # Set a catch catchpoint
gdb_test "catch catch" "Catchpoint \[0-9\]+ \\(catch\\)" \ gdb_test "catch catch" "Catchpoint \[0-9\]+ \\(catch\\)" \

View File

@ -16,10 +16,8 @@
# #
# This file is part of the gdb testsuite. # This file is part of the gdb testsuite.
set testfile expand-psymtabs-cxx standard_testfile .cc
set srcfile ${testfile}.cc set executable ${testfile}
set executable ${testfile}.x
set binfile ${objdir}/${subdir}/${executable}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {debug c++} ] != "" } { if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {debug c++} ] != "" } {
untested ${testfile}.exp untested ${testfile}.exp

View File

@ -17,22 +17,12 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "extern-c" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
untested extern-c.exp return -1
return -1
} }
# Start with a fresh gdb
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
runto_main runto_main
if { [gdb_breakpoint "c_func"] == 1 } { if { [gdb_breakpoint "c_func"] == 1 } {

View File

@ -30,13 +30,10 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "formatted-ref" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
untested formatted-ref.exp return -1
return -1
} }
proc get_address { var } { proc get_address { var } {
@ -113,11 +110,6 @@ proc test_p_op1_equals_op2 {op1 op2} {
gdb_test $test "\\$\[0-9\]+ = true" gdb_test $test "\\$\[0-9\]+ = true"
} }
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
runto ${srcfile}:[gdb_get_line_number "marker here"] runto ${srcfile}:[gdb_get_line_number "marker here"]
set s1_address [get_address "s1"] set s1_address [get_address "s1"]

View File

@ -16,8 +16,8 @@
# This tests for evaluation of functions in the form of # This tests for evaluation of functions in the form of
# complex expressions. # complex expressions.
set testfile fpointer standard_testfile .cc
set srcfile ${testfile}.cc
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug c++}] } { if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug c++}] } {
return -1 return -1
} }

View File

@ -27,23 +27,15 @@ if { [skip_cplus_tests] } { continue }
# test running programs # test running programs
# #
set testfile "gdb1355" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
untested gdb1355.exp
return -1
}
if [get_compiler_info "c++"] { if [get_compiler_info "c++"] {
return -1 return -1
} }
gdb_exit if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
gdb_start return -1
gdb_reinitialize_dir $srcdir/$subdir }
gdb_load ${binfile}
if ![runto_main] then { if ![runto_main] then {
perror "couldn't run to main" perror "couldn't run to main"

View File

@ -24,13 +24,9 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
if { [skip_shlib_tests] } { continue } if { [skip_shlib_tests] } { continue }
set testfile "gdb2384" standard_testfile .cc gdb2384-base.cc
set srcfile ${testfile}.cc
set binfile $objdir/$subdir/$testfile
set libfile "gdb2384-base" set sofile [standard_output_file gdb2384-base.so]
set libsrcfile ${libfile}.cc
set sofile $objdir/$subdir/${libfile}.so
# Create and source the file that provides information about the compiler # Create and source the file that provides information about the compiler
# used to compile the test case. # used to compile the test case.
@ -38,16 +34,13 @@ if [get_compiler_info "c++"] {
return -1 return -1
} }
if { [gdb_compile_shlib $srcdir/$subdir/$libsrcfile $sofile {debug c++}] != "" if { [gdb_compile_shlib $srcdir/$subdir/$srcfile2 $sofile {debug c++}] != ""
|| [gdb_compile $srcdir/$subdir/$srcfile $binfile executable [list debug "c++" shlib=${sofile}]] != ""} { || [gdb_compile $srcdir/$subdir/$srcfile $binfile executable [list debug "c++" shlib=${sofile}]] != ""} {
untested gdb2384.exp untested gdb2384.exp
return -1 return -1
} }
gdb_exit clean_restart ${binfile}
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
gdb_load_shlibs ${sofile} gdb_load_shlibs ${sofile}

View File

@ -43,9 +43,7 @@ if { [istarget "spu*-*-*"] } {
return 0 return 0
} }
set testfile "gdb2495" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile $objdir/$subdir/$testfile
# Create and source the file that provides information about the compiler # Create and source the file that provides information about the compiler
# used to compile the test case. # used to compile the test case.
@ -53,11 +51,6 @@ if [get_compiler_info "c++"] {
return -1 return -1
} }
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
untested gdb2495.exp
return -1
}
# Some targets can't do function calls, so don't even bother with this # Some targets can't do function calls, so don't even bother with this
# test. # test.
if [target_info exists gdb,cannot_call_functions] { if [target_info exists gdb,cannot_call_functions] {
@ -66,10 +59,9 @@ if [target_info exists gdb,cannot_call_functions] {
continue continue
} }
gdb_exit if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
gdb_start return -1
gdb_reinitialize_dir $srcdir/$subdir }
gdb_load ${binfile}
if ![runto_main] then { if ![runto_main] then {
perror "couldn't run to main" perror "couldn't run to main"

View File

@ -16,28 +16,13 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile hang standard_testfile hang1.cc hang2.cc hang3.cc
set binfile ${objdir}/${subdir}/${testfile}
foreach file {hang1 hang2 hang3} { if {[prepare_for_testing $testfile.exp $testfile \
if {[gdb_compile "${srcdir}/${subdir}/${file}.cc" "${file}.o" object {c++ debug}] != ""} { [list $srcfile $srcfile2 $srcfile3] {debug c++}]} {
untested hang.exp return -1
return -1
}
} }
if {[gdb_compile "hang1.o hang2.o hang3.o" ${binfile} executable {c++ debug}] != "" } {
untested hang.exp
return -1
}
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
# As of May 1, 2002, GDB hangs trying to read the debug info for the # As of May 1, 2002, GDB hangs trying to read the debug info for the
# `hang2.o' compilation unit from the executable `hang', when compiled # `hang2.o' compilation unit from the executable `hang', when compiled
# by g++ 2.96 with STABS debugging info. Here's what's going on, as # by g++ 2.96 with STABS debugging info. Here's what's going on, as

View File

@ -21,17 +21,13 @@ if [get_compiler_info] {
return -1 return -1
} }
set testfile "infcall-dlopen" standard_testfile .cc infcall-dlopen-lib.cc
set srcmainfile ${testfile}.cc set libfile [standard_output_file ${testfile}.so]
set srclibfile ${testfile}-lib.cc set lib_dlopen [shlib_target_file ${testfile}.so]
set executable ${testfile}
set libfile ${objdir}/${subdir}/${executable}.so
set binfile ${objdir}/${subdir}/${executable}
set lib_dlopen [shlib_target_file ${executable}.so]
# Use completely arbitrary file for $libfile source. # Use completely arbitrary file for $libfile source.
if { [gdb_compile_shlib ${srcdir}/${subdir}/${srclibfile} ${libfile} {debug c++}] != "" if { [gdb_compile_shlib ${srcdir}/${subdir}/${srcfile2} ${libfile} {debug c++}] != ""
|| [prepare_for_testing ${testfile}.exp ${executable} ${srcmainfile} {debug c++ shlib_load}] } { || [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug c++ shlib_load}] } {
return -1 return -1
} }

View File

@ -25,13 +25,10 @@ if { [skip_cplus_tests] } { continue }
load_lib "cp-support.exp" load_lib "cp-support.exp"
set testfile "inherit" standard_testfile misc.cc
set srcfile misc.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
untested inherit.exp return -1
return -1
} }
# Single inheritance, print type definitions. # Single inheritance, print type definitions.
@ -658,19 +655,6 @@ proc test_print_mvi_classes { } {
} }
proc do_tests { } { proc do_tests { } {
global subdir
global objdir
global srcdir
global binfile
# Start with a fresh gdb.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $binfile
gdb_test_no_output "set width 0" gdb_test_no_output "set width 0"
if { ![runto_main] } then { if { ![runto_main] } then {

View File

@ -13,8 +13,8 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set testfile koenig standard_testfile .cc
set srcfile ${testfile}.cc
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug c++}] } { if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug c++}] } {
return -1 return -1
} }

View File

@ -29,24 +29,15 @@ set nl "\[\r\n\]+"
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "local" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
untested local.exp
return -1
}
if [get_compiler_info "c++"] { if [get_compiler_info "c++"] {
return -1 return -1
} }
gdb_exit if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
gdb_start return -1
gdb_reinitialize_dir $srcdir/$subdir }
gdb_load ${binfile}
# #
# set it up at a breakpoint so we can play with the variable values # set it up at a breakpoint so we can play with the variable values

View File

@ -24,24 +24,15 @@ if { [skip_cplus_tests] } { continue }
# test running programs # test running programs
# #
set testfile "m-data" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
untested m-data.exp
return -1
}
if [get_compiler_info "c++"] { if [get_compiler_info "c++"] {
return -1 return -1
} }
gdb_exit if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
gdb_start return -1
gdb_reinitialize_dir $srcdir/$subdir }
gdb_load ${binfile}
if ![runto_main] then { if ![runto_main] then {
perror "couldn't run to breakpoint" perror "couldn't run to breakpoint"

View File

@ -25,36 +25,16 @@ if { [skip_cplus_tests] } { continue }
# test running programs # test running programs
# #
set testfile "m-static" standard_testfile .cc m-static1.cc
set srcfile "${testfile}.cc"
set srcfile1 "${testfile}1.cc"
set objfile "${testfile}.o"
set objfile1 "${testfile}1.o"
set binfile "${objdir}/${subdir}/${testfile}"
if { [gdb_compile "$srcdir/$subdir/$srcfile" "$objdir/$subdir/$objfile" object {debug c++}] != "" } {
untested m-static.exp
return -1
}
if { [gdb_compile "$srcdir/$subdir/$srcfile1" "$objdir/$subdir/$objfile1" object {debug c++}] != "" } {
untested m-static.exp
return -1
}
if { [gdb_compile "$objdir/$subdir/$objfile $objdir/$subdir/$objfile1" "${binfile}" executable {debug c++}] != "" } {
untested m-static.exp
return -1
}
if [get_compiler_info] { if [get_compiler_info] {
return -1 return -1
} }
gdb_exit if {[prepare_for_testing $testfile.exp $testfile \
gdb_start [list $srcfile $srcfile2] {debug c++}]} {
gdb_reinitialize_dir $srcdir/$subdir return -1
gdb_load ${binfile} }
if ![runto_main] then { if ![runto_main] then {
perror "couldn't run to breakpoint" perror "couldn't run to breakpoint"

View File

@ -19,24 +19,16 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "mb-ctor" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if [get_compiler_info "c++"] { if [get_compiler_info "c++"] {
return -1 return -1
} }
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
untested mb-ctor.exp return -1
return -1
} }
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
if ![runto_main] then { if ![runto_main] then {
perror "couldn't run to breakpoint" perror "couldn't run to breakpoint"
continue continue

View File

@ -20,38 +20,17 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
standard_testfile mb-inline1.cc mb-inline2.cc
set testfile "mb-inline"
set hdrfile "${testfile}.h" set hdrfile "${testfile}.h"
set srcfile1 "${testfile}1.cc"
set objfile1 "${testfile}1.o"
set srcfile2 "${testfile}2.cc"
set objfile2 "${testfile}2.o"
set binfile "${objdir}/${subdir}/${testfile}"
if { [gdb_compile "$srcdir/$subdir/$srcfile1" "$objdir/$subdir/$objfile1" object {debug c++}] != "" } {
untested mb-inline.exp
return -1
}
if { [gdb_compile "$srcdir/$subdir/$srcfile2" "$objdir/$subdir/$objfile2" object {debug c++}] != "" } {
untested mb-inline.exp
return -1
}
if { [gdb_compile "$objdir/$subdir/$objfile1 $objdir/$subdir/$objfile2" "${binfile}" executable {debug c++}] != "" } {
untested mb-inline.exp
return -1
}
if [get_compiler_info "c++"] { if [get_compiler_info "c++"] {
return -1 return -1
} }
gdb_exit if {[prepare_for_testing $testfile.exp $testfile \
gdb_start [list $srcfile $srcfile2] {debug c++}]} {
gdb_reinitialize_dir $srcdir/$subdir return -1
gdb_load ${binfile} }
set bp_location [gdb_get_line_number "set breakpoint here" $hdrfile] set bp_location [gdb_get_line_number "set breakpoint here" $hdrfile]

View File

@ -24,22 +24,16 @@ if { [istarget "spu*-*-*"] } {
} }
set testfile "mb-templates" standard_testfile .cc
set srcfile ${testfile}.cc
set executable ${testfile}
set binfile ${objdir}/${subdir}/${executable}
if [get_compiler_info "c++"] { if [get_compiler_info "c++"] {
return -1 return -1
} }
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
untested mb-templates.exp return -1
return -1
} }
clean_restart ${executable}
set bp_location [gdb_get_line_number "set breakpoint here"] set bp_location [gdb_get_line_number "set breakpoint here"]
# Set a breakpoint with multiple locations # Set a breakpoint with multiple locations

View File

@ -25,24 +25,16 @@ set vhn "\\$\[0-9\]+"
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "member-ptr" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if [get_compiler_info "c++"] { if [get_compiler_info "c++"] {
return -1 return -1
} }
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
untested member-ptr.exp return -1
return -1
} }
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
if ![runto_main] then { if ![runto_main] then {
perror "couldn't run to breakpoint" perror "couldn't run to breakpoint"
continue continue

View File

@ -33,8 +33,7 @@ proc add {var name params expected {kind {func}}} {
if {[skip_cplus_tests]} { continue } if {[skip_cplus_tests]} { continue }
# Tests for c++/12266 et al # Tests for c++/12266 et al
set testfile "meth-typedefs" standard_testfile .cc
set srcfile $testfile.cc
if {[prepare_for_testing $testfile $testfile $srcfile {c++ debug}]} { if {[prepare_for_testing $testfile $testfile $srcfile {c++ debug}]} {
return -1 return -1

View File

@ -35,24 +35,15 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "method" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
untested method.exp
return -1
}
if [get_compiler_info "c++"] { if [get_compiler_info "c++"] {
return -1 return -1
} }
gdb_exit if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
gdb_start return -1
gdb_reinitialize_dir $srcdir/$subdir }
gdb_load ${binfile}
# #
# set it up at a breakpoint so we can play with the variable values # set it up at a breakpoint so we can play with the variable values

View File

@ -20,9 +20,7 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "method2" standard_testfile .cc
set srcfile $testfile.cc
set binfile $objdir/$subdir/$testfile
if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
untested method2.exp untested method2.exp

View File

@ -17,15 +17,13 @@
# only a declaration there for the method. The method is then defined in # only a declaration there for the method. The method is then defined in
# a different file providing only ELF symbols. # a different file providing only ELF symbols.
set testfile minsym-fallback standard_testfile .cc minsym-fallback-main.cc
set srcfile ${testfile}.cc
set srcmainfile ${testfile}-main.cc
set executable $testfile set executable $testfile
set objfile $objdir/$subdir/${testfile}.o set objfile [standard_output_file ${testfile}.o]
set objmainfile $objdir/$subdir/${testfile}-main.o set objmainfile [standard_output_file ${testfile}-main.o]
set binfile $objdir/$subdir/$executable
if {[gdb_compile $srcdir/$subdir/$srcfile $objfile object {}] != "" if {[gdb_compile $srcdir/$subdir/$srcfile $objfile object {}] != ""
|| [gdb_compile $srcdir/$subdir/$srcmainfile $objmainfile object {debug}] != "" || [gdb_compile $srcdir/$subdir/$srcfile2 $objmainfile object {debug}] != ""
|| [gdb_compile "$objfile $objmainfile" $binfile executable {c++}] != ""} { || [gdb_compile "$objfile $objmainfile" $binfile executable {c++}] != ""} {
untested ${testfile}.exp untested ${testfile}.exp
return -1 return -1

View File

@ -18,12 +18,10 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "misc" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile} if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { return -1
untested misc.exp
return -1
} }
# #
@ -66,20 +64,6 @@ proc test_expr { args } {
} }
proc do_tests {} { proc do_tests {} {
global subdir
global objdir
global srcdir
global binfile
global gdb_prompt
# Start with a fresh gdb.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $binfile
deduce_language_of_main deduce_language_of_main
# Check for fixes for PRs 8916 and 8630 # Check for fixes for PRs 8916 and 8630
gdb_test "print s.a" ".* = 0" "print s.a for foo struct (known gcc 2.7.2 and earlier bug)" gdb_test "print s.a" ".* = 0" "print s.a for foo struct (known gcc 2.7.2 and earlier bug)"

View File

@ -13,30 +13,13 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set testfile namespace-enum standard_testfile .cc namespace-enum-main.cc
set srcfile0 ${testfile}.cc
set objfile0 ${testfile}.o
set srcfile1 ${testfile}-main.cc
set objfile1 ${testfile}-main.o
set executable ${testfile}
set binfile ${objdir}/${subdir}/${executable}
if { [gdb_compile "$srcdir/$subdir/$srcfile0" "$objdir/$subdir/$objfile0" object {debug c++}] != "" } { if {[prepare_for_testing $testfile.exp $testfile \
untested namespace-enum.exp [list $srcfile $srcfile2] {debug c++}]} {
return -1 return -1
} }
if { [gdb_compile "$srcdir/$subdir/$srcfile1" "$objdir/$subdir/$objfile1" object {debug c++}] != "" } {
untested namespace-enum.exp
return -1
}
if { [gdb_compile "$objdir/$subdir/$objfile0 $objdir/$subdir/$objfile1" "${binfile}" executable {debug c++}] != "" } {
untested namespace-enum.exp
return -1
}
clean_restart ${executable}
gdb_test "print foo::B::B_B" "`foo::B' is not defined as an aggregate type." gdb_test "print foo::B::B_B" "`foo::B' is not defined as an aggregate type."
gdb_test "print foo::B_B" "foo::B_B" gdb_test "print foo::B_B" "foo::B_B"
gdb_test "print A_A" "A_A" gdb_test "print A_A" "A_A"

View File

@ -14,21 +14,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set testfile namespace-nested-import standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile} if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
untested "Couldn't compile test program"
return -1 return -1
} }
# Get things started.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
############################################ ############################################
# Test printing of a variable from a nested # Test printing of a variable from a nested
# in a namespace inner to the one which has # in a namespace inner to the one which has

View File

@ -28,12 +28,7 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "namespace" standard_testfile .cc namespace1.cc
set srcfile ${testfile}.cc
set objfile ${objdir}/${subdir}/${testfile}.o
set srcfile1 ${testfile}1.cc
set objfile1 ${objdir}/${subdir}/${testfile}1.o
set binfile ${objdir}/${subdir}/${testfile}
if [get_compiler_info c++] { if [get_compiler_info c++] {
return -1; return -1;
@ -46,26 +41,11 @@ if {[test_compiler_info {gcc-[0-3]-*}]
set xfail_class_types 1 set xfail_class_types 1
} }
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug c++}] != "" } { if {[prepare_for_testing $testfile.exp $testfile \
untested namespace.exp [list $srcfile $srcfile2] {debug c++}]} {
return -1 return -1
} }
if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${objfile1}" object {debug c++}] != "" } {
untested namespace.exp
return -1
}
if { [gdb_compile "${objfile} ${objfile1}" "${binfile}" executable {debug c++}] != "" } {
untested namespace.exp
return -1
}
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
gdb_test "show lang" "auto; currently c\\+\\+.*" gdb_test "show lang" "auto; currently c\\+\\+.*"
# #
@ -142,7 +122,7 @@ gdb_test "break AAA::xyzq" \
# Break on a function in the global namespace. # Break on a function in the global namespace.
gdb_test "break ::ensureOtherRefs" \ gdb_test "break ::ensureOtherRefs" \
"Breakpoint.*at $hex: file.*$srcfile1, line $decimal\\." "Breakpoint.*at $hex: file.*$srcfile2, line $decimal\\."
# Call a function in a nested namespace # Call a function in a nested namespace

View File

@ -16,9 +16,7 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "nextoverthrow" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile $objdir/$subdir/$testfile
# Create and source the file that provides information about the compiler # Create and source the file that provides information about the compiler
# used to compile the test case. # used to compile the test case.

View File

@ -15,19 +15,16 @@
# Test loading symbols from unrelocated C++ object files. # Test loading symbols from unrelocated C++ object files.
set testfile no-dmgl-verbose standard_testfile .cc
set srcfile ${testfile}.cc
set executable ${testfile}.o
set binfile ${objdir}/${subdir}/${executable}
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {c++ debug}] != "" } { if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}.o" object {c++ debug}] != "" } {
untested ${testfile}.exp untested ${testfile}.exp
return -1 return -1
} }
clean_restart ${executable} clean_restart ${testfile}.o
gdb_test_no_output "set breakpoint pending off" gdb_test_no_output "set breakpoint pending off"

View File

@ -16,24 +16,15 @@
# Stress test the lookup of declarations # Stress test the lookup of declarations
set testfile nsdecl standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
untested "Couldn't compile test program"
return -1
}
if [get_compiler_info] { if [get_compiler_info] {
return -1; return -1;
} }
# Get things started. if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
return -1
gdb_exit }
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
if ![runto_main] then { if ![runto_main] then {
perror "couldn't run to breakpoint main" perror "couldn't run to breakpoint main"

View File

@ -17,21 +17,12 @@
# imported into the same scope. # imported into the same scope.
set testfile nsimport standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile} if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
untested "Couldn't compile test program"
return -1 return -1
} }
# Get things started.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
############################################ ############################################
# test printing of namespace imported within # test printing of namespace imported within
# the function. # the function.

View File

@ -13,9 +13,8 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set testfile nsnested standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug c++}] } { if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug c++}] } {
return -1 return -1
} }

View File

@ -13,8 +13,8 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set testfile nsnoimports standard_testfile .cc
set srcfile ${testfile}.cc
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug c++}] } { if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug c++}] } {
return -1 return -1
} }

View File

@ -14,26 +14,15 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set testfile nsrecurs standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" \
"${binfile}" executable {debug c++}] != "" } {
untested "Couldn't compile test program"
return -1
}
if [get_compiler_info] { if [get_compiler_info] {
return -1 return -1
} }
if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
# Get things started. return -1
}
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
if ![runto_main] then { if ![runto_main] then {
perror "couldn't run to breakpoint main" perror "couldn't run to breakpoint main"

View File

@ -16,24 +16,15 @@
# Stress test namespace lookup # Stress test namespace lookup
set testfile nsstress standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
untested "Couldn't compile test program"
return -1
}
if [get_compiler_info] { if [get_compiler_info] {
return -1 return -1
} }
# Get things started. if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
return -1
gdb_exit }
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
if ![runto_main] then { if ![runto_main] then {
perror "couldn't run to breakpoint main" perror "couldn't run to breakpoint main"

View File

@ -14,26 +14,15 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set testfile nsusing standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \
{debug c++}] != "" } {
untested "Couldn't compile test program"
return -1
}
if [get_compiler_info] { if [get_compiler_info] {
return -1 return -1
} }
if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
# Get things started. return -1
}
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
############################################ ############################################
# test printing of namespace imported within # test printing of namespace imported within

View File

@ -13,8 +13,8 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set testfile operator standard_testfile .cc
set srcfile ${testfile}.cc
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug c++}] } { if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug c++}] } {
return -1 return -1
} }

View File

@ -13,8 +13,8 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set testfile oranking standard_testfile .cc
set srcfile ${testfile}.cc
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug c++}] } { if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug c++}] } {
return -1 return -1
} }

View File

@ -17,8 +17,9 @@
if {[skip_cplus_tests]} { continue } if {[skip_cplus_tests]} { continue }
set testfile "overload-const" standard_testfile .cc
if [prepare_for_testing $testfile $testfile $testfile.cc {c++ debug}] {
if {[prepare_for_testing $testfile $testfile $testfile.cc {c++ debug}]} {
return -1 return -1
} }

View File

@ -26,20 +26,12 @@ set nl "\[\r\n\]+"
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "overload" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
untested overload.exp return -1
return -1
} }
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
# Set it up at a breakpoint so we can play with the variable values. # Set it up at a breakpoint so we can play with the variable values.
if ![runto 'marker1'] then { if ![runto 'marker1'] then {

View File

@ -31,12 +31,9 @@ set timeout 15
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "ovldbreak" standard_testfile .cc
set srcfile $testfile.cc
set binfile $objdir/$subdir/$testfile
if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
untested ovldbreak.exp
return -1 return -1
} }

View File

@ -55,15 +55,10 @@ proc test_class {class} {
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
# Test for c++/11734 # Test for c++/11734
set testfile "ovsrch" standard_testfile ovsrch1.cc ovsrch2.cc ovsrch3.cc ovsrch4.cc
set binfile [file join $objdir $subdir $testfile]
set srcfiles {} if {[prepare_for_testing $testfile $testfile \
for {set i 1} {$i < 5} {incr i} { [list $srcfile $srcfile2 $srcfile3 $srcfile4] {c++ debug}]} {
lappend srcfiles $testfile$i.cc
}
if {[prepare_for_testing $testfile $testfile $srcfiles {c++ debug}]} {
return -1 return -1
} }

View File

@ -13,7 +13,8 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set testfile paren-type standard_testfile .cc
if { [prepare_for_testing ${testfile}.exp ${testfile} ${testfile}.cc {c++ debug}] } { if { [prepare_for_testing ${testfile}.exp ${testfile} ${testfile}.cc {c++ debug}] } {
return -1 return -1
} }

View File

@ -18,20 +18,12 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "pass-by-ref" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile} if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
executable {debug c++}] != "" } {
untested pass-by-ref.exp
return -1 return -1
} }
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
if ![runto_main] then { if ![runto_main] then {
return -1 return -1
} }

View File

@ -24,23 +24,15 @@ if { [skip_cplus_tests] } { continue }
# test running programs # test running programs
# #
set testfile "pr-1023" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
untested pr-1023.exp
return -1
}
if [get_compiler_info "c++"] { if [get_compiler_info "c++"] {
return -1 return -1
} }
gdb_exit if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
gdb_start return -1
gdb_reinitialize_dir $srcdir/$subdir }
gdb_load ${binfile}
if ![runto_main] then { if ![runto_main] then {
perror "couldn't run to breakpoint" perror "couldn't run to breakpoint"

View File

@ -23,23 +23,15 @@ if { [skip_cplus_tests] } { continue }
# test running programs # test running programs
# #
set testfile "pr-1210" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
untested pr-1210.exp
return -1
}
if [get_compiler_info "c++"] { if [get_compiler_info "c++"] {
return -1 return -1
} }
gdb_exit if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
gdb_start return -1
gdb_reinitialize_dir $srcdir/$subdir }
gdb_load ${binfile}
if ![runto_main] then { if ![runto_main] then {
perror "couldn't run to breakpoint" perror "couldn't run to breakpoint"

View File

@ -26,24 +26,15 @@ if { [skip_cplus_tests] } { continue }
# test running programs # test running programs
# #
set testfile "pr-574" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
untested pr-574.exp
return -1
}
if [get_compiler_info "c++"] { if [get_compiler_info "c++"] {
return -1 return -1
} }
gdb_exit if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
gdb_start return -1
gdb_reinitialize_dir $srcdir/$subdir }
gdb_load ${binfile}
if ![runto_main] then { if ![runto_main] then {
perror "couldn't run to breakpoint" perror "couldn't run to breakpoint"

View File

@ -13,9 +13,9 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set testfile pr10687 standard_testfile .cc
set srcfile ${testfile}.cc
if [prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}] { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
return -1 return -1
} }

View File

@ -21,18 +21,16 @@ if { [skip_cplus_tests] } { continue }
load_lib "cp-support.exp" load_lib "cp-support.exp"
set testfile "pr10728" standard_testfile pr10728-x.cc pr10728-y.cc
set srcfile ${testfile}-x.cc set tfx [standard_output_file pr10728-x.o]
set tfx ${testfile}-x set tfy [standard_output_file pr10728-y.o]
set tfy ${testfile}-y
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${tfy}.cc" "${tfy}.o" object {c++}] != "" } { if { [gdb_compile "${srcdir}/${subdir}/$srcfile2" "${tfy}.o" object {c++}] != "" } {
untested pr10728.exp untested pr10728.exp
return -1 return -1
} }
if { [gdb_compile "${srcdir}/${subdir}/${tfx}.cc" "${tfx}.o" object {debug c++}] != "" } { if { [gdb_compile "${srcdir}/${subdir}/$srcfile" "${tfx}.o" object {debug c++}] != "" } {
untested pr10728.exp untested pr10728.exp
return -1 return -1
} }
@ -42,11 +40,7 @@ if { [gdb_compile "${tfx}.o ${tfy}.o" ${binfile} executable {debug c++}] != ""
return -1 return -1
} }
clean_restart $binfile
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
if ![runto_main] then { if ![runto_main] then {
perror "couldn't run to breakpoint" perror "couldn't run to breakpoint"

View File

@ -13,8 +13,8 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set testfile pr12028 standard_testfile .cc
set srcfile ${testfile}.cc
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug c++}] } { if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug c++}] } {
return -1 return -1
} }

View File

@ -19,20 +19,12 @@ if { [skip_cplus_tests] } { continue }
load_lib "cp-support.exp" load_lib "cp-support.exp"
set testfile "pr9067" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {c++ debug}] != "" } { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
untested pr9067.exp return -1
return -1
} }
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
if ![runto_main] then { if ![runto_main] then {
perror "couldn't run to breakpoint" perror "couldn't run to breakpoint"
continue continue

View File

@ -18,9 +18,9 @@ if { [istarget "spu*-*-*"] } {
return 0 return 0
} }
set testfile pr9167 standard_testfile .cc
set srcfile ${testfile}.cc
if [prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}] { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
return -1 return -1
} }

View File

@ -17,23 +17,15 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "pr9631" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
untested pr9631.exp
return -1
}
if [get_compiler_info "c++"] { if [get_compiler_info "c++"] {
return -1 return -1
} }
gdb_exit if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
gdb_start return -1
gdb_reinitialize_dir $srcdir/$subdir }
gdb_load ${binfile}
if ![runto_main] then { if ![runto_main] then {
perror "couldn't run to breakpoint" perror "couldn't run to breakpoint"

View File

@ -25,24 +25,15 @@ if { [skip_cplus_tests] } { continue }
# test running programs # test running programs
# #
set testfile "printmethod" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
untested printmethod.exp
return -1
}
if [get_compiler_info "c++"] { if [get_compiler_info "c++"] {
return -1 return -1
} }
gdb_exit if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
gdb_start return -1
gdb_reinitialize_dir $srcdir/$subdir }
gdb_load ${binfile}
if ![runto_main] then { if ![runto_main] then {
perror "couldn't run to breakpoint" perror "couldn't run to breakpoint"

View File

@ -178,42 +178,22 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "psmang" standard_testfile psmang1.cc psmang2.cc
set binfile ${objdir}/${subdir}/${testfile}
if [get_compiler_info "c++"] { if [get_compiler_info "c++"] {
return -1; return -1;
} }
if { [gdb_compile "${srcdir}/${subdir}/${testfile}1.cc" "${testfile}1.o" object {debug c++}] != "" } { if {[prepare_for_testing $testfile.exp $testfile \
untested psmang.exp [list $srcfile $srcfile2] {debug c++}]} {
return -1 return -1
} }
if { [gdb_compile "${srcdir}/${subdir}/${testfile}2.cc" "${testfile}2.o" object {debug c++}] != "" } {
untested psmang.exp
return -1
}
if { [gdb_compile "${testfile}1.o ${testfile}2.o" ${binfile} executable {debug c++}] != "" } {
untested psmang.exp
return -1
}
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
gdb_test "break s::method1" "Breakpoint .* at .*: file .*psmang1.cc.*" gdb_test "break s::method1" "Breakpoint .* at .*: file .*psmang1.cc.*"
# We have to exit and restart GDB here, to make sure that all the # We have to exit and restart GDB here, to make sure that all the
# compilation units are psymtabs again. # compilation units are psymtabs again.
gdb_exit clean_restart ${binfile}
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
gdb_test "break s::method2" "Breakpoint .* at .*: file .*psmang2.cc.*" gdb_test "break s::method2" "Breakpoint .* at .*: file .*psmang2.cc.*"

View File

@ -15,18 +15,14 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
standard_testfile .cc
set testfile psymtab-parameter if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}.x" object {debug c++}] != "" } {
set executable ${testfile}.x
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${executable}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {debug c++}] != "" } {
untested ${testfile}.exp untested ${testfile}.exp
return -1 return -1
} }
clean_restart $executable clean_restart $testfile.x
# As `main' is not present GDB fails to find the proper inferior language. # As `main' is not present GDB fails to find the proper inferior language.
gdb_test_no_output "set language c++" gdb_test_no_output "set language c++"

View File

@ -17,8 +17,7 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "ptype-cv-cp" standard_testfile .cc
set srcfile ${testfile}.cc
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug c++}] } { if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug c++}] } {
return -1 return -1

View File

@ -16,13 +16,9 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
if { [skip_shlib_tests] } { continue } if { [skip_shlib_tests] } { continue }
set testfile re-set-overloaded standard_testfile bool.cc .cc
set srcfile bool.cc
set executable $testfile
set binfile $objdir/$subdir/$executable
set libsrcfile ${testfile}.cc set sofile [standard_output_file ${testfile}.so]
set sofile $objdir/$subdir/${testfile}.so
# Create and source the file that provides information about the compiler # Create and source the file that provides information about the compiler
# used to compile the test case. # used to compile the test case.
@ -30,13 +26,13 @@ if [get_compiler_info "c++"] {
return -1 return -1
} }
if { [gdb_compile_shlib $srcdir/$subdir/$libsrcfile $sofile {debug c++}] != "" if { [gdb_compile_shlib $srcdir/$subdir/$srcfile2 $sofile {debug c++}] != ""
|| [gdb_compile $srcdir/$subdir/$srcfile $binfile executable [list debug "c++" shlib=${sofile}]] != ""} { || [gdb_compile $srcdir/$subdir/$srcfile $binfile executable [list debug "c++" shlib=${sofile}]] != ""} {
untested ${testfile}.exp untested ${testfile}.exp
return -1 return -1
} }
clean_restart $executable clean_restart $testfile
gdb_load_shlibs ${sofile} gdb_load_shlibs ${sofile}
gdb_test_no_output "set breakpoint pending yes" gdb_test_no_output "set breakpoint pending yes"

View File

@ -13,16 +13,15 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set testfile readnow-language standard_testfile .cc
set srcfile ${testfile}.cc
set executable ${testfile} if {[build_executable ${testfile}.exp $testfile ${testfile}.cc {c++ debug}] == -1} {
if {[build_executable ${testfile}.exp $executable ${testfile}.cc {c++ debug}] == -1} {
return -1 return -1
} }
set old_gdbflags $GDBFLAGS set old_gdbflags $GDBFLAGS
set GDBFLAGS "$GDBFLAGS -readnow" set GDBFLAGS "$GDBFLAGS -readnow"
clean_restart $executable clean_restart $testfile
set GDBFLAGS $old_gdbflags set GDBFLAGS $old_gdbflags
gdb_test "show language" {The current source language is "auto; currently c\+\+"\.} gdb_test "show language" {The current source language is "auto; currently c\+\+"\.}

View File

@ -22,27 +22,19 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "ref-params" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { if {[build_executable $testfile.exp $testfile $srcfile {debug c++}] == 1} {
untested ref-params.exp return -1
return -1
} }
gdb_exit gdb_exit
proc gdb_start_again { text } { proc gdb_start_again { text } {
global srcdir
global subdir
global binfile global binfile
global srcfile global srcfile
gdb_exit clean_restart $binfile
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
runto ${srcfile}:[gdb_get_line_number $text] runto ${srcfile}:[gdb_get_line_number $text]
} }

View File

@ -22,21 +22,12 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "ref-types" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
untested ref-types.exp return -1
return -1
} }
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
# #
# set it up at a breakpoint so we can play with the variable values # set it up at a breakpoint so we can play with the variable values
# #

View File

@ -32,37 +32,16 @@ if { [skip_cplus_tests] } { continue }
# test running programs # test running programs
# #
set testfile "rtti" standard_testfile rtti1.cc rtti2.cc
set srcfile1 "${testfile}1.cc"
set objfile1 "${testfile}1.o"
set srcfile2 "${testfile}2.cc"
set objfile2 "${testfile}2.o"
set binfile "${objdir}/${subdir}/${testfile}"
if { [gdb_compile "$srcdir/$subdir/$srcfile1" "$objdir/$subdir/$objfile1" object {debug c++}] != "" } {
untested rtti.exp
return -1
}
if { [gdb_compile "$srcdir/$subdir/$srcfile2" "$objdir/$subdir/$objfile2" object {debug c++}] != "" } {
untested rtti.exp
return -1
}
if { [gdb_compile "$objdir/$subdir/$objfile1 $objdir/$subdir/$objfile2" "${binfile}" executable {debug c++}] != "" } {
untested rtti.exp
return -1
}
if [get_compiler_info "c++"] { if [get_compiler_info "c++"] {
return -1 return -1
} }
gdb_exit if {[prepare_for_testing $testfile.exp $testfile \
gdb_start [list $srcfile $srcfile2] {debug c++}]} {
gdb_reinitialize_dir $srcdir/$subdir return -1
gdb_load ${binfile} }
if ![runto_main] then { if ![runto_main] then {
perror "couldn't run to breakpoint" perror "couldn't run to breakpoint"
@ -71,7 +50,7 @@ if ![runto_main] then {
# First, run to after we've constructed the object: # First, run to after we've constructed the object:
gdb_breakpoint [gdb_get_line_number "main-constructs-done" "$srcfile1"] gdb_breakpoint [gdb_get_line_number "main-constructs-done" "$srcfile"]
gdb_continue_to_breakpoint "end of constructors in main" gdb_continue_to_breakpoint "end of constructors in main"
gdb_test_multiple "print *e1" "print *e1" { gdb_test_multiple "print *e1" "print *e1" {
@ -127,12 +106,12 @@ gdb_test_multiple "print *e2" "print *e2" {
# Now we test the hack that's been implemented to get around some # Now we test the hack that's been implemented to get around some
# instances of PR gdb/1511. # instances of PR gdb/1511.
gdb_breakpoint [gdb_get_line_number "func-constructs-done" "$srcfile1"] gdb_breakpoint [gdb_get_line_number "func-constructs-done" "$srcfile"]
gdb_continue_to_breakpoint "end of constructors in func" gdb_continue_to_breakpoint "end of constructors in func"
gdb_test "print *obj" "\\$\[0-9\]* = {<n2::Base2> = .*}" gdb_test "print *obj" "\\$\[0-9\]* = {<n2::Base2> = .*}"
gdb_breakpoint [gdb_get_line_number "func3-constructs-done" "$srcfile1"] gdb_breakpoint [gdb_get_line_number "func3-constructs-done" "$srcfile"]
gdb_continue_to_breakpoint "end of constructors in func3" gdb_continue_to_breakpoint "end of constructors in func3"
gdb_test "print *obj3" "\\$\[0-9\]* = {<n2::C2> = .*}" gdb_test "print *obj3" "\\$\[0-9\]* = {<n2::C2> = .*}"

View File

@ -17,24 +17,15 @@
# name the one from the correct scope is printed. # name the one from the correct scope is printed.
set testfile shadow standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
untested "Couldn't compile test program"
return -1
}
if [get_compiler_info] { if [get_compiler_info] {
return -1 return -1
} }
# Get things started. if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
return -1
gdb_exit }
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
if ![runto_main] then { if ![runto_main] then {
perror "couldn't run to breakpoint main" perror "couldn't run to breakpoint main"

View File

@ -13,8 +13,8 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
set testfile smartp standard_testfile .cc
set srcfile ${testfile}.cc
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug c++}] } { if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug c++}] } {
return -1 return -1
} }

View File

@ -41,8 +41,7 @@ proc test_breakpoint {func result} {
if {[skip_cplus_tests]} { continue } if {[skip_cplus_tests]} { continue }
# Tests for c++/12750 # Tests for c++/12750
set testfile "static-method" standard_testfile .cc
set srcfile $testfile.cc
if {[prepare_for_testing $testfile $testfile $srcfile {c++ debug}]} { if {[prepare_for_testing $testfile $testfile $srcfile {c++ debug}]} {
return -1 return -1

View File

@ -15,17 +15,14 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile static-print-quit standard_testfile .cc
set srcfile ${testfile}.cc
set executable $testfile.o
set objfile ${objdir}/${subdir}/${executable}
if { [gdb_compile $srcdir/$subdir/$srcfile $objfile object {debug c++}] != ""} { if { [gdb_compile $srcdir/$subdir/$srcfile $binfile.o object {debug c++}] != ""} {
untested ${testfile}.exp untested ${testfile}.exp
return -1 return -1
} }
clean_restart $executable clean_restart $testfile.o
gdb_test_no_output "set width 80" gdb_test_no_output "set width 80"
gdb_test_no_output "set height 2" gdb_test_no_output "set height 2"

View File

@ -21,8 +21,7 @@ if {[skip_cplus_tests]} {
continue continue
} }
set testfile "temargs" standard_testfile .cc
set srcfile "${testfile}.cc"
if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
return -1 return -1

View File

@ -20,9 +20,7 @@ set ws "\[\r\n\t \]+"
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "templates" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
# Create and source the file that provides information about the compiler # Create and source the file that provides information about the compiler
# used to compile the test case. # used to compile the test case.
@ -30,9 +28,8 @@ if [get_compiler_info "c++"] {
return -1 return -1
} }
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
untested templates.exp return -1
return -1
} }
# #
@ -237,20 +234,6 @@ proc test_template_args {} {
} }
proc do_tests {} { proc do_tests {} {
global subdir
global objdir
global srcdir
global binfile
global gdb_prompt
# Start with a fresh gdb.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $binfile
# Change multiple-symbols to "ask" in order to get the multiple-choice # Change multiple-symbols to "ask" in order to get the multiple-choice
# menu when breaking on overloaded methods. # menu when breaking on overloaded methods.
gdb_test_no_output "set multiple-symbols ask" gdb_test_no_output "set multiple-symbols ask"

View File

@ -24,24 +24,15 @@ if { [skip_stl_tests] } { continue }
# test running programs # test running programs
# #
set testfile "try_catch" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
untested try_catch.exp
return -1
}
if [get_compiler_info "c++"] { if [get_compiler_info "c++"] {
return -1 return -1
} }
gdb_exit if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
gdb_start return -1
gdb_reinitialize_dir $srcdir/$subdir }
gdb_load ${binfile}
if ![runto_main] then { if ![runto_main] then {
perror "couldn't run to breakpoint" perror "couldn't run to breakpoint"

View File

@ -17,8 +17,9 @@
if {[skip_cplus_tests]} { continue } if {[skip_cplus_tests]} { continue }
set testfile "typedef-operator" standard_testfile .cc
if [prepare_for_testing $testfile $testfile $testfile.cc {c++ debug}] {
if {[prepare_for_testing $testfile $testfile $srcfile {c++ debug}]} {
return -1 return -1
} }

View File

@ -26,22 +26,12 @@ if { [istarget "spu*-*-*"] } {
return 0 return 0
} }
set testfile "userdef" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
untested userdef.exp return -1
return -1
} }
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
if ![runto_main] then { if ![runto_main] then {
perror "couldn't run to breakpoint" perror "couldn't run to breakpoint"
continue continue

View File

@ -17,20 +17,12 @@
if { [skip_cplus_tests] } { continue } if { [skip_cplus_tests] } { continue }
set testfile "virtbase" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
untested virtbase.exp return -1
return -1
} }
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
if {![runto_main]} then { if {![runto_main]} then {
perror "couldn't run to breakpoint" perror "couldn't run to breakpoint"
continue continue

View File

@ -23,13 +23,10 @@ if { [skip_cplus_tests] } { continue }
load_lib "cp-support.exp" load_lib "cp-support.exp"
set testfile "virtfunc" standard_testfile .cc
set srcfile ${testfile}.cc
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {c++ debug}] != "" } { if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
untested virtfunc.exp return -1
return -1
} }
proc test_ptype_of_classes {} { proc test_ptype_of_classes {} {
@ -275,15 +272,6 @@ proc test_info_vtbl {} {
} }
proc do_tests {} { proc do_tests {} {
global srcdir subdir binfile
global gdb_prompt
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $binfile
gdb_test_no_output "set language c++" "" gdb_test_no_output "set language c++" ""
gdb_test_no_output "set width 0" "" gdb_test_no_output "set width 0" ""

Some files were not shown because too many files have changed in this diff Show More