]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.cell/f-regs.exp
Fix test names starting with uppercase output by basic functions
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.cell / f-regs.exp
CommitLineData
618f726f 1# Copyright 2009-2016 Free Software Foundation, Inc.
1ea34204
UW
2#
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.
7#
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.
12#
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/>.
15#
16# Contributed by Markus Deuling <deuling@de.ibm.com>.
17#
18# Testsuite for Cell Broadband Engine combined debugger
19# This testcase tests access to SPU vector registers while language is fortran.
20
21load_lib cell.exp
22
23set ppu_file "break"
24set ppu_src ${srcdir}/${subdir}/${ppu_file}.c
25set ppu_bin ${objdir}/${subdir}/${ppu_file}
26set spu_file "break-spu"
27set spu_src ${srcdir}/${subdir}/${spu_file}.c
28set spu_bin ${objdir}/${subdir}/${spu_file}
29
30if {[skip_cell_tests]} {
31 return 0
32}
33
34# Compile SPU binary.
35if { [gdb_compile_cell_spu $spu_src $spu_bin executable {debug}] != "" } {
bc6c7af4 36 unsupported "compiling spu binary failed."
1ea34204
UW
37 return -1
38}
39# Compile PPU binary.
40if { [gdb_cell_embedspu $spu_bin $spu_bin-embed.o {debug}] != "" } {
bc6c7af4 41 unsupported "embedding spu binary failed."
1ea34204
UW
42 return -1
43}
44if { [gdb_compile_cell_ppu [list $ppu_src $spu_bin-embed.o] $ppu_bin executable {debug}] != "" } {
bc6c7af4 45 unsupported "compiling ppu binary failed."
1ea34204
UW
46 return -1
47}
48
4c93b1db 49if [get_compiler_info] {
1ea34204
UW
50 return -1
51}
52
53proc check_vector_regs {} {
54 for {set check_reg 0} {$check_reg < 128} {incr check_reg} {
55
56 gdb_test "p \$r$check_reg" \
57 "r$check_reg.*=.*\(.*\).*" \
58 "p \$r$check_reg"
59
60 gdb_test "ptype \$r$check_reg" \
61 "type = Type,.*C_Union :: __spu_builtin_type_vec128.*int128_t :: uint128.*int64_t :: v2_int64.*int32_t :: v4_int32\(.*\).*int16_t :: v8_int16\(.*\).*int8_t :: v16_int8\(.*\).*double :: v2_double\(.*\).*float :: v4_float\(.*\).*End Type __spu_builtin_type_vec128.*" \
62 "ptype \$r$check_reg"
63 }
64}
65
66gdb_exit
67gdb_start
68gdb_reinitialize_dir $srcdir/$subdir
69gdb_load ${ppu_bin}
70
71# No programm running, no registers should be available.
72gdb_test "info all-registers" \
73 "The program has no registers now." \
74 "info all-registers"
75
76if ![runto_main] then {
bc6c7af4 77 fail "can't run to main"
1ea34204
UW
78 return 0
79}
80
81cont_spu_main
82gdb_test "set language fortran" \
83 "Warning: the current language does not match this frame.*" \
84 "set language fortran"
85check_vector_regs
86
87gdb_exit
88
89return 0