Update copyright year range in all GDB files.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.cell / registers.exp
CommitLineData
42a4f53d 1# Copyright 2009-2019 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 registers on PPU and SPU.
20
21load_lib cell.exp
22
23set ppu_file "break"
24set ppu_src ${srcdir}/${subdir}/${ppu_file}.c
617cd4bc 25set ppu_bin [standard_output_file ${ppu_file}]
1ea34204
UW
26set spu_file "break-spu"
27set spu_src ${srcdir}/${subdir}/${spu_file}.c
617cd4bc 28set spu_bin [standard_output_file ${spu_file}]
1ea34204
UW
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
53gdb_exit
54gdb_start
55gdb_reinitialize_dir $srcdir/$subdir
56gdb_load ${ppu_bin}
57
58# No programm running, no registers should be available.
59gdb_test "info all-registers" \
60 "The program has no registers now." \
61 "info all-registers"
62
63if ![runto_main] then {
bc6c7af4 64 fail "can't run to main"
1ea34204
UW
65 return 0
66}
67
68# Check registers in PPU thread.
69gdb_test "info reg r0" "r0.*" "info register r0"
70gdb_test "info reg r31" "r31.*" "info register r31"
71gdb_test "info reg r32" "Invalid register.*r32.*" "(invalid) info register r32"
72gdb_test "info reg pc" "pc.*" "info register pc"
73gdb_test "info reg cr" "cr.*" "info register cr"
74gdb_test "info reg lr" "lr.*" "info register lr"
75gdb_test "info reg ctr" "ctr.*" "info register ctr"
76gdb_test "info reg xer" "xer.*" "info register xer"
77
78# Continue to SPU thread.
79cont_spu_main
80
81# In SPU thread, check SPU registers.
82for {set check_reg 0} {$check_reg < 128} {incr check_reg} {
83 gdb_test "info reg r$check_reg" \
84 "r$check_reg.*uint128.*=.*v2\_int64.*v4\_int32.*v8\_int16.*v16\_int8.*v2\_double.*v4\_float.*" \
85 "info register r$check_reg"
86}
87gdb_test "info reg r128" \
88 "Invalid register.*r128.*" \
89 "(invalid) info register r128"
90
91gdb_test "info reg pc" "pc.*main.*" "info register pc"
92gdb_test "info reg id" "id.*" "info register id"
93gdb_test "info reg sp" "sp.*" "info register sp"
94gdb_test "info reg fpscr" "fpscr.*" "info register fpscr"
95gdb_test "info reg srr0" "srr0.*" "info register srr0"
96gdb_test "info reg lslr" "lslr.*" "info register lslr"
97gdb_test "info reg decr" "decr.*" "info register decr"
98gdb_test "info reg decr_status" "decr_status.*" "info register decr-status"
99
100gdb_test "info reg cr" "Invalid register.*cr.*" "info register cr"
101gdb_test "info reg lr" "Invalid register.*lr.*" "info register lr"
102gdb_test "info reg ctr" "Invalid register.*ctr.*" "info register ctr"
103gdb_test "info reg xer" "Invalid register.*xer.*" "info register xer"
104
105gdb_exit
106return 0
This page took 1.328593 seconds and 4 git commands to generate.