1 # Copyright
1998, 1999, 2001, 2003, 2004 Free Software Foundation
, Inc.
3 # This
program is free software
; you can redistribute it and
/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation
; either version
2 of the License
, or
6 #
(at your option
) any later version.
8 # This
program is distributed in the hope that it will be useful
,
9 # but WITHOUT
ANY WARRANTY
; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License
for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this
program; if not
, write to the Free Software
15 # Foundation
, Inc.
, 59 Temple Place
- Suite
330, Boston
, MA
02111-1307, USA.
17 # This file is part of the gdb testsuite
18 # file written by Elena Zannoni
(ezannoni@cygnus.com
)
19 # rewritten by Michael Chastain
(mec.gnu@mindspring.com
)
21 # source files cttiadd.cc
, cttiadd1.cc
, cttiadd2.cc
, cttiadd3.cc
23 #
Call to template instantiations.
29 if { [skip_cplus_tests
] } { continue }
31 set testfile
"cttiadd"
32 set srcfile
"${testfile}.cc"
33 set srcfile1
"${testfile}1.cc"
34 set srcfile2
"${testfile}2.cc"
35 set srcfile3
"${testfile}3.cc"
36 set objfile
"${testfile}.o"
37 set objfile1
"${testfile}1.o"
38 set objfile2
"${testfile}2.o"
39 set objfile3
"${testfile}3.o"
40 set binfile
"${objdir}/${subdir}/${testfile}"
42 if { [gdb_compile
"$srcdir/$subdir/$srcfile" "$objdir/$subdir/$objfile" object {debug c++}] != "" } {
43 gdb_suppress_entire_file
"Testcase compile failed, so all tests in this file will automatically fail."
46 if { [gdb_compile
"$srcdir/$subdir/$srcfile1" "$objdir/$subdir/$objfile1" object {debug c++}] != "" } {
47 gdb_suppress_entire_file
"Testcase compile failed, so all tests in this file will automatically fail."
50 if { [gdb_compile
"$srcdir/$subdir/$srcfile2" "$objdir/$subdir/$objfile2" object {debug c++}] != "" } {
51 gdb_suppress_entire_file
"Testcase compile failed, so all tests in this file will automatically fail."
54 if { [gdb_compile
"$srcdir/$subdir/$srcfile3" "$objdir/$subdir/$objfile3" object {debug c++}] != "" } {
55 gdb_suppress_entire_file
"Testcase compile failed, so all tests in this file will automatically fail."
58 if { [gdb_compile
"$objdir/$subdir/$objfile $objdir/$subdir/$objfile1 $objdir/$subdir/$objfile2 $objdir/$subdir/$objfile3" "${binfile}" executable {debug c++}] != "" } {
59 gdb_suppress_entire_file
"Testcase compile failed, so all tests in this file will automatically fail."
62 if [get_compiler_info $
{binfile
} "c++"] {
68 gdb_reinitialize_dir $srcdir
/$subdir
71 if ![runto_main
] then {
72 perror
"couldn't run to breakpoint"
76 gdb_breakpoint
[gdb_get_line_number
"marker add1"]
77 gdb_continue_to_breakpoint
"marker add1"
79 gdb_test
"print c" "\\$\[0-9\]+ = 194 .*"
80 gdb_test
"print f" "\\$\[0-9\]+ = 9"
81 gdb_test
"print i" "\\$\[0-9\]+ = 4"
83 # TODO
: this needs more work before actually deploying it.
86 if { [ test_compiler_info gcc
-*] } then { continue }
88 gdb_test_multiple
"print add<int>(2,2)" "print add<int>(2,2)" {
89 -re
"\\$\[0-9\]+ = 4\r\n$gdb_prompt $" {
90 pass
"print add<int>(2,2)"
92 -re
"No symbol \"add<int>\" in current context.\r\n$gdb_prompt $" {
93 # TODO
: kfail or xfail this
94 fail
"print add<int>(2,2)"
98 # Note
: 2.25 and
4.5 are exactly representable in IEEE
-ish formats
99 gdb_test_multiple
"print add<float>(2.25,2.25)" "print add<float>(2.25,2.25)" {
100 -re
"\\$\[0-9\]+ = 4\\.5\r\n$gdb_prompt $" {
101 pass
"print add<float>(2.25,2.25)"
103 -re
"No symbol \"add<float>\" in current context.\r\n$gdb_prompt $" {
104 # TODO
: kfail or xfail this
105 fail
"print add<float>(2.25,2.25)"
109 gdb_test_multiple
"print add<unsigned char>('A','A')" "print add<unsigned char>('A','A')" {
110 -re
"\\$\[0-9\]+ = -126 .*\r\n$gdb_prompt $" {
111 pass
"print add<unsigned char>('A','A')"
113 -re
"No symbol \"add<unsigned char>\" in current context.\r\n$gdb_prompt $" {
114 # TODO
: kfail or xfail this
115 fail
"print add<unsigned char>('A','A')"
119 gdb_test_multiple
"print add2<int>(2,2)" "print add2<int>(2,2)" {
120 -re
"\\$\[0-9\]+ = 4\r\n$gdb_prompt $" {
121 pass
"print add2<int>(2,2)"
123 -re
"No symbol \"add2<int>\" in current context.\r\n$gdb_prompt $" {
124 # TODO
: kfail or xfail this
125 fail
"print add2<int>(2,2)"
129 gdb_test_multiple
"print add2<float>(2.25,2.25)" "print add2<float>(2.25,2.25)" {
130 -re
"\\$\[0-9\]+ = 4\\.5\r\n$gdb_prompt $" {
131 pass
"print add2<float>(2.25,2.25)"
133 -re
"No symbol \"add2<float>\" in current context.\r\n$gdb_prompt $" {
134 # TODO
: kfail or xfail this
135 fail
"print add2<float>(2.25,2.25)"
139 gdb_test_multiple
"print add2<unsigned char>('A','A')" "print add2<unsigned char>('A','A')" {
140 -re
"\\$\[0-9]+ = -126 .*$gdb_prompt $" {
141 pass
"print add2<unsigned char>('A','A')"
143 -re
"No symbol \"add2<unsigned char>\" in current context.\r\n$gdb_prompt $" {
144 # TODO
: kfail or xfail this
145 fail
"print add2<unsigned char>('A','A')"
149 gdb_test_multiple
"print add3<int>(2,2)" "print add3<int>(2,2)" {
150 -re
"\\$\[0-9\]+ = 4\r\n$gdb_prompt $" {
151 pass
"print add3<int>(2,2)"
153 -re
"No symbol \"add3<int>\" in current context.\r\n$gdb_prompt $" {
154 # TODO
: kfail or xfail this
155 fail
"print add3<int>(2,2)"
159 gdb_test_multiple
"print add3<float>(2.25,2.25)" "print add3<float>(2.25,2.25)" {
160 -re
"\\$\[0-9\]+ = 4\\.5\r\n$gdb_prompt $" {
161 pass
"print add3<float>(2.25,2.25)"
163 -re
"No symbol \"add3<float>\" in current context.\r\n$gdb_prompt $" {
164 # TODO
: kfail or xfail this
165 fail
"print add3<float>(2.25,2.25)"
169 gdb_test_multiple
"print add3<unsigned char>('A','A')" "print add3<unsigned char>('A','A')" {
170 -re
"\\$\[0-9]+ = -126 .*$gdb_prompt $" {
171 pass
"print add3<unsigned char>('A','A')"
173 -re
"No symbol \"add3<unsigned char>\" in current context.\r\n$gdb_prompt $" {
174 # TODO
: kfail or xfail this
175 fail
"print add3<unsigned char>('A','A')"
179 gdb_test_multiple
"print add4<int>(2,2)" "print add4<int>(2,2)" {
180 -re
"\\$\[0-9\]+ = 4\r\n$gdb_prompt $" {
181 pass
"print add4<int>(2,2)"
183 -re
"No symbol \"add4<int>\" in current context.\r\n$gdb_prompt $" {
184 # TODO
: kfail or xfail this
185 fail
"print add4<int>(2,2)"
189 gdb_test_multiple
"print add4<float>(2.25,2.25)" "print add4<float>(2.25,2.25)" {
190 -re
"\\$\[0-9\]+ = 4\\.5\r\n$gdb_prompt $" {
191 pass
"print add4<float>(2.25,2.25)"
193 -re
"No symbol \"add4<float>\" in current context.\r\n$gdb_prompt $" {
194 # TODO
: kfail or xfail this
195 fail
"print add4<float>(2.25,2.25)"
199 gdb_test_multiple
"print add4<unsigned char>('A','A')" "print add4<unsigned char>('A','A')" {
200 -re
"\\$\[0-9]+ = -126 .*$gdb_prompt $" {
201 pass
"print add4<unsigned char>('A','A')"
203 -re
"No symbol \"add4<unsigned char>\" in current context.\r\n$gdb_prompt $" {
204 # TODO
: kfail or xfail this
205 fail
"print add4<unsigned char>('A','A')"