-# Copyright 1998, 1999, 2001, 2003, 2004 Free Software Foundation, Inc.
+# Copyright 1998-2016 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
# This file is part of the gdb testsuite
# file written by Elena Zannoni (ezannoni@cygnus.com)
# Call to template instantiations.
-if $tracelevel then {
- strace $tracelevel
-}
-
if { [skip_cplus_tests] } { continue }
-set testfile "cttiadd"
-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++}] != "" } {
- gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
-}
-
-if { [gdb_compile "$srcdir/$subdir/$srcfile1" "$objdir/$subdir/$objfile1" object {debug c++}] != "" } {
- gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
-}
-
-if { [gdb_compile "$srcdir/$subdir/$srcfile2" "$objdir/$subdir/$objfile2" object {debug c++}] != "" } {
- gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
-}
+standard_testfile cttiadd.cc cttiadd1.cc cttiadd2.cc cttiadd3.cc
-if { [gdb_compile "$srcdir/$subdir/$srcfile3" "$objdir/$subdir/$objfile3" object {debug c++}] != "" } {
- gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+if [get_compiler_info "c++"] {
+ return -1
}
-if { [gdb_compile "$objdir/$subdir/$objfile $objdir/$subdir/$objfile1 $objdir/$subdir/$objfile2 $objdir/$subdir/$objfile3" "${binfile}" executable {debug c++}] != "" } {
- gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+if {[prepare_for_testing $testfile.exp $testfile \
+ [list $srcfile $srcfile2 $srcfile3 $srcfile4] {debug c++}]} {
+ return -1
}
-if [get_compiler_info ${binfile} "c++"] {
- return -1;
-}
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
if ![runto_main] then {
perror "couldn't run to breakpoint"
continue
}
gdb_test_multiple "print add<unsigned char>('A','A')" "print add<unsigned char>('A','A')" {
- -re "\\$\[0-9\]+ = -126 .*\r\n$gdb_prompt $" {
+ -re "\\$\[0-9\]+ = 130 .*\r\n$gdb_prompt $" {
pass "print add<unsigned char>('A','A')"
}
-re "No symbol \"add<unsigned char>\" in current context.\r\n$gdb_prompt $" {
}
gdb_test_multiple "print add2<unsigned char>('A','A')" "print add2<unsigned char>('A','A')" {
- -re "\\$\[0-9]+ = -126 .*$gdb_prompt $" {
+ -re "\\$\[0-9]+ = 130 .*$gdb_prompt $" {
pass "print add2<unsigned char>('A','A')"
}
-re "No symbol \"add2<unsigned char>\" in current context.\r\n$gdb_prompt $" {
}
gdb_test_multiple "print add3<unsigned char>('A','A')" "print add3<unsigned char>('A','A')" {
- -re "\\$\[0-9]+ = -126 .*$gdb_prompt $" {
+ -re "\\$\[0-9]+ = 130 .*$gdb_prompt $" {
pass "print add3<unsigned char>('A','A')"
}
-re "No symbol \"add3<unsigned char>\" in current context.\r\n$gdb_prompt $" {
}
gdb_test_multiple "print add4<unsigned char>('A','A')" "print add4<unsigned char>('A','A')" {
- -re "\\$\[0-9]+ = -126 .*$gdb_prompt $" {
+ -re "\\$\[0-9]+ = 130 .*$gdb_prompt $" {
pass "print add4<unsigned char>('A','A')"
}
-re "No symbol \"add4<unsigned char>\" in current context.\r\n$gdb_prompt $" {