6e19e2bf78
Partial fix for PR gdb/1543. * gdb.cp/ambiguous.exp, gdb.cp/annota2.exp, gdb.cp/annota3.exp, gdb.cp/anon-union.exp, gdb.cp/casts.exp, gdb.cp/classes.exp, gdb.cp/cplusfuncs.exp, gdb.cp/ctti.exp, gdb.exp/demangle.exp, gdb.cp/derivation.exp, gdb.cp/exception.exp, gdb.cp/hang.exp, gdb.cp/inherit.exp, gdb.cp/local.exp, gdb.cp/maint.exp, gdb.cp/member-ptr.exp, gdb.cp/method.exp, gdb.cp/misc.exp, gdb.cp/namespace.exp, gdb.cp/overload.exp, gdb.cp/ovldbreak.exp, gdb.cp/psmang.exp, gdb.cp/ref-types.exp, gdb.cp/templates.exp, gdb.cp/userdef.exp, gdb.cp/virtfunc.exp: Remove reference to bug-gdb@prep.ai.mit.edu . * gdb.cp/bs15503.cc, gdb.cp/class2.cc, gdb.cp/cttiadd.cc, gdb.cp/cttiadd1.cc, gdb.cp/cttiadd2.cc, gdb.cp/cttiadd3.cc, gdb.cp/exception.cc, gdb.cp/member-ptr.cc, gdb.cp/namespace1.cc: Likewise.
207 lines
6.7 KiB
Text
207 lines
6.7 KiB
Text
# Copyright 1998, 1999, 2001, 2003, 2004 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
|
|
# (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.
|
|
|
|
# This file is part of the gdb testsuite
|
|
# file written by Elena Zannoni (ezannoni@cygnus.com)
|
|
# rewritten by Michael Chastain (mec.gnu@mindspring.com)
|
|
#
|
|
# source files cttiadd.cc, cttiadd1.cc, cttiadd2.cc, cttiadd3.cc
|
|
|
|
# Call to template instantiations.
|
|
|
|
if $tracelevel then {
|
|
strace $tracelevel
|
|
}
|
|
|
|
if { [skip_cplus_tests] } { continue }
|
|
|
|
set testfile "cttiadd"
|
|
set srcfile "${srcdir}/${subdir}/${testfile}.cc"
|
|
set srcfile1 "${srcdir}/${subdir}/${testfile}1.cc"
|
|
set srcfile2 "${srcdir}/${subdir}/${testfile}2.cc"
|
|
set srcfile3 "${srcdir}/${subdir}/${testfile}3.cc"
|
|
set objfile "${objdir}/${subdir}/${testfile}.o"
|
|
set objfile1 "${objdir}/${subdir}/${testfile}1.o"
|
|
set objfile2 "${objdir}/${subdir}/${testfile}2.o"
|
|
set objfile3 "${objdir}/${subdir}/${testfile}3.o"
|
|
set binfile "${objdir}/${subdir}/${testfile}"
|
|
|
|
if { [gdb_compile "${srcfile}" "${objfile}" object {debug c++}] != "" } {
|
|
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
|
}
|
|
|
|
if { [gdb_compile "${srcfile1}" "${objfile1}" object {debug c++}] != "" } {
|
|
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
|
}
|
|
|
|
if { [gdb_compile "${srcfile2}" "${objfile2}" object {debug c++}] != "" } {
|
|
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
|
}
|
|
|
|
if { [gdb_compile "${srcfile3}" "${objfile3}" object {debug c++}] != "" } {
|
|
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
|
}
|
|
|
|
if { [gdb_compile "${objfile} ${objfile1} ${objfile2} ${objfile3}" "${binfile}" executable {debug c++}] != "" } {
|
|
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
|
}
|
|
|
|
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_breakpoint [gdb_get_line_number "marker add1"]
|
|
gdb_continue_to_breakpoint "marker add1"
|
|
|
|
gdb_test "print c" "\\$\[0-9\]+ = -62 .*"
|
|
gdb_test "print f" "\\$\[0-9\]+ = 9"
|
|
gdb_test "print i" "\\$\[0-9\]+ = 4"
|
|
|
|
# TODO: this needs more work before actually deploying it.
|
|
# So bail out here.
|
|
|
|
if { [ test_compiler_info gcc-*] } then { continue }
|
|
|
|
gdb_test_multiple "print add<int>(2,2)" "print add<int>(2,2)" {
|
|
-re "\\$\[0-9\]+ = 4\r\n$gdb_prompt $" {
|
|
pass "print add<int>(2,2)"
|
|
}
|
|
-re "No symbol \"add<int>\" in current context.\r\n$gdb_prompt $" {
|
|
# TODO: kfail or xfail this
|
|
fail "print add<int>(2,2)"
|
|
}
|
|
}
|
|
|
|
# Note: 2.25 and 4.5 are exactly representable in IEEE-ish formats
|
|
gdb_test_multiple "print add<float>(2.25,2.25)" "print add<float>(2.25,2.25)" {
|
|
-re "\\$\[0-9\]+ = 4\\.5\r\n$gdb_prompt $" {
|
|
pass "print add<float>(2.25,2.25)"
|
|
}
|
|
-re "No symbol \"add<float>\" in current context.\r\n$gdb_prompt $" {
|
|
# TODO: kfail or xfail this
|
|
fail "print add<float>(2.25,2.25)"
|
|
}
|
|
}
|
|
|
|
gdb_test_multiple "print add<char>('A','A')" "print add<char>('A','A')" {
|
|
-re "\\$\[0-9\]+ = -126 .*\r\n$gdb_prompt $" {
|
|
pass "print add<char>('A','A')"
|
|
}
|
|
-re "No symbol \"add<char>\" in current context.\r\n$gdb_prompt $" {
|
|
# TODO: kfail or xfail this
|
|
fail "print add<char>('A','A')"
|
|
}
|
|
}
|
|
|
|
gdb_test_multiple "print add2<int>(2,2)" "print add2<int>(2,2)" {
|
|
-re "\\$\[0-9\]+ = 4\r\n$gdb_prompt $" {
|
|
pass "print add2<int>(2,2)"
|
|
}
|
|
-re "No symbol \"add2<int>\" in current context.\r\n$gdb_prompt $" {
|
|
# TODO: kfail or xfail this
|
|
fail "print add2<int>(2,2)"
|
|
}
|
|
}
|
|
|
|
gdb_test_multiple "print add2<float>(2.25,2.25)" "print add2<float>(2.25,2.25)" {
|
|
-re "\\$\[0-9\]+ = 4\\.5\r\n$gdb_prompt $" {
|
|
pass "print add2<float>(2.25,2.25)"
|
|
}
|
|
-re "No symbol \"add2<float>\" in current context.\r\n$gdb_prompt $" {
|
|
# TODO: kfail or xfail this
|
|
fail "print add2<float>(2.25,2.25)"
|
|
}
|
|
}
|
|
|
|
gdb_test_multiple "print add2<char>('A','A')" "print add2<char>('A','A')" {
|
|
-re "\\$\[0-9]+ = -126 .*$gdb_prompt $" {
|
|
pass "print add2<char>('A','A')"
|
|
}
|
|
-re "No symbol \"add2<char>\" in current context.\r\n$gdb_prompt $" {
|
|
# TODO: kfail or xfail this
|
|
fail "print add2<char>('A','A')"
|
|
}
|
|
}
|
|
|
|
gdb_test_multiple "print add3<int>(2,2)" "print add3<int>(2,2)" {
|
|
-re "\\$\[0-9\]+ = 4\r\n$gdb_prompt $" {
|
|
pass "print add3<int>(2,2)"
|
|
}
|
|
-re "No symbol \"add3<int>\" in current context.\r\n$gdb_prompt $" {
|
|
# TODO: kfail or xfail this
|
|
fail "print add3<int>(2,2)"
|
|
}
|
|
}
|
|
|
|
gdb_test_multiple "print add3<float>(2.25,2.25)" "print add3<float>(2.25,2.25)" {
|
|
-re "\\$\[0-9\]+ = 4\\.5\r\n$gdb_prompt $" {
|
|
pass "print add3<float>(2.25,2.25)"
|
|
}
|
|
-re "No symbol \"add3<float>\" in current context.\r\n$gdb_prompt $" {
|
|
# TODO: kfail or xfail this
|
|
fail "print add3<float>(2.25,2.25)"
|
|
}
|
|
}
|
|
|
|
gdb_test_multiple "print add3<char>('A','A')" "print add3<char>('A','A')" {
|
|
-re "\\$\[0-9]+ = -126 .*$gdb_prompt $" {
|
|
pass "print add3<char>('A','A')"
|
|
}
|
|
-re "No symbol \"add3<char>\" in current context.\r\n$gdb_prompt $" {
|
|
# TODO: kfail or xfail this
|
|
fail "print add3<char>('A','A')"
|
|
}
|
|
}
|
|
|
|
gdb_test_multiple "print add4<int>(2,2)" "print add4<int>(2,2)" {
|
|
-re "\\$\[0-9\]+ = 4\r\n$gdb_prompt $" {
|
|
pass "print add4<int>(2,2)"
|
|
}
|
|
-re "No symbol \"add4<int>\" in current context.\r\n$gdb_prompt $" {
|
|
# TODO: kfail or xfail this
|
|
fail "print add4<int>(2,2)"
|
|
}
|
|
}
|
|
|
|
gdb_test_multiple "print add4<float>(2.25,2.25)" "print add4<float>(2.25,2.25)" {
|
|
-re "\\$\[0-9\]+ = 4\\.5\r\n$gdb_prompt $" {
|
|
pass "print add4<float>(2.25,2.25)"
|
|
}
|
|
-re "No symbol \"add4<float>\" in current context.\r\n$gdb_prompt $" {
|
|
# TODO: kfail or xfail this
|
|
fail "print add4<float>(2.25,2.25)"
|
|
}
|
|
}
|
|
|
|
gdb_test_multiple "print add4<char>('A','A')" "print add4<char>('A','A')" {
|
|
-re "\\$\[0-9]+ = -126 .*$gdb_prompt $" {
|
|
pass "print add4<char>('A','A')"
|
|
}
|
|
-re "No symbol \"add4<char>\" in current context.\r\n$gdb_prompt $" {
|
|
# TODO: kfail or xfail this
|
|
fail "print add4<char>('A','A')"
|
|
}
|
|
}
|