1 # Copyright 2009 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 3 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, see <http://www.gnu.org/licenses/>.
16 # Contributed by Markus Deuling <deuling@de.ibm.com>.
18 # Testsuite for Cell Broadband Engine combined debugger
19 # This testcases tries to read variables of each kind both on PPU and SPU.
25 set ppu_src ${srcdir}/${subdir}/${ppu_file}.c
26 set ppu_bin ${objdir}/${subdir}/${ppu_file}
27 set spu_file "data-spu"
28 set spu_src ${srcdir}/${subdir}/${spu_file}.c
29 set spu_bin ${objdir}/${subdir}/${spu_file}
31 if {[skip_cell_tests]} {
36 if { [gdb_compile_cell_spu $spu_src $spu_bin executable {debug}] != "" } {
37 unsupported "Compiling spu binary failed."
41 if { [gdb_cell_embedspu $spu_bin $spu_bin-embed.o {debug}] != "" } {
42 unsupported "Embedding spu binary failed."
45 if { [gdb_compile_cell_ppu [list $ppu_src $spu_bin-embed.o] $ppu_bin executable {debug}] != "" } {
46 unsupported "Compiling ppu binary failed."
50 if [get_compiler_info ${ppu_bin}] {
54 proc check_var { name value } {
55 gdb_test "print $name" \
57 "check_var $name = $value"
60 proc set_var { name value } {
61 gdb_test "set var $name = $value" \
63 "set var $name = $value"
66 proc dotest { name value } {
68 check_var $name $value
73 gdb_reinitialize_dir $srcdir/$subdir
76 if ![runto_main] then {
77 fail "Can't run to main"
85 dotest var_long 523442
86 dotest var_longlong 235354533
87 xfail "dotest var_float 33.2113"
88 xfail "dotest var_double 2.3456"
89 xfail "dotest var_longdouble 3.456789"
92 "Breakpoint.*at.*file.*$testfile.c, line 55.*" \
95 "Breakpoint.*at.*$testfile.c.*55.*" \
96 "continue to bp at line 55"
99 check_var var_char 'c'
100 check_var var_short 7
101 check_var var_int 1337
102 check_var var_long 123456
103 check_var var_longlong 123456789
104 xfail "check_var var_float 1.23"
105 xfail "check_var var_double 2.3456"
106 xfail "check_var var_longdouble 3.456789"
109 c_to "Marker SPU End" $spu_file.c
111 # In SPU Thread, arch should now be spu:256K.
115 check_var var_char 'c'
116 check_var var_short 7
117 check_var var_int 1337
118 check_var var_long 123456
119 check_var var_longlong 123456789
120 xfail "check_var var_float 1.23"
121 xfail "check_var var_double 2.3456"
122 xfail "check_var var_longdouble 3.456789"