-# Copyright 1992, 1997, 1999, 2001-2004, 2007-2012 Free Software
-# Foundation, Inc.
+# Copyright 1992-2020 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
if { [skip_cplus_tests] } { continue }
-set testfile "cplusfuncs"
-set srcfile ${testfile}.cc
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .cc
if { [get_compiler_info "c++"] } {
return -1
}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
- untested cplusfuncs.exp
- return -1
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
+ return -1
}
#
regsub {\\\(void\\\)} $demangled {\(\)} demangled
gdb_test "info function $name" \
- "File .*:\r\n(class|)${demangled}.*" \
+ "File .*:\t(class|)${demangled}.*" \
"info function for \"$name\""
}
proc test_paddr_operator_functions {} {
global hex
- global hp_aCC_compiler
global dm_operator_comma
global dm_type_char_star
global dm_type_foo_ref
" = .* $hex <foo::operator new\\(.*\\)(| static)>"
gdb_test "print &foo::operator new\[\]" \
" = .* $hex <foo::operator new\\\[\\\]\\(.*\\)(| static)>"
- if { !$hp_aCC_compiler } {
- print_addr "foo::operator delete($dm_type_void_star)"
- print_addr "foo::operator delete[]($dm_type_void_star)"
- } else {
- gdb_test "print &'foo::operator delete($dm_type_void_star) static'" \
- " = .*(0x\[0-9a-f\]+|) <foo::operator delete.*>"
- }
+
+ print_addr "foo::operator delete($dm_type_void_star)"
+ print_addr "foo::operator delete[]($dm_type_void_star)"
print_addr "foo::operator int($dm_type_void)"
print_addr "foo::operator $dm_operator_char_star\($dm_type_void)"
}
proc do_tests {} {
- global subdir
- global objdir
- global srcdir
global binfile
- global gdb_prompt
global dm_type_int_star
-
- # Start with a fresh gdb.
-
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_load $binfile
+ clean_restart $binfile
gdb_test_no_output "set width 0"