Fix test names starting with uppercase output by basic functions
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.arch / spu-info.exp
CommitLineData
618f726f 1# Copyright 2007-2016 Free Software Foundation, Inc.
23d964e7
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
e22f8b7c 5# the Free Software Foundation; either version 3 of the License, or
23d964e7
UW
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
e22f8b7c 14# along with this program. If not, see <http://www.gnu.org/licenses/>.
23d964e7
UW
15#
16# This file is part of the gdb testsuite.
17#
18# Contributed by Markus Deuling <deuling@de.ibm.com>.
19# Tests for 'info spu' commands.
20
23d964e7
UW
21
22if { ![istarget "spu-*-elf"] } then {
23 verbose "Skipping SPU-only testcase"
24 return
25}
26
27set testfile "spu-info"
28set srcfile ${testfile}.c
29set binfile ${objdir}/${subdir}/${testfile}
30set sources ${srcdir}/${subdir}/${srcfile}
31
32if { [gdb_compile $sources ${binfile} executable { debug }] != "" } {
33 return -1
34}
35
36gdb_exit
37gdb_start
38gdb_reinitialize_dir $srcdir/$subdir
39gdb_load ${binfile}
40
41# Continue to MARKER
42proc c_to { marker } {
43 global srcfile
44 set line [gdb_get_line_number $marker]
45 gdb_test "break $line" \
46 "Breakpoint.*at.*file.*$srcfile.*line $line.*" \
47 "break $line"
48 gdb_test "continue" \
49 "Continuing.*Breakpoint.*at.*$srcfile.*$line.*" \
50 "continue to $line"
51}
52
53
54
55if ![runto_main] then {
bc6c7af4 56 fail "can't run to main"
23d964e7
UW
57 return 0
58}
59
60# Check the help.
61gdb_test "info spu" \
62 ".*info spu.* must be followed by the name of an SPU facility.*" \
63 "info spu"
64gdb_test "help info spu" \
65 "Various SPU specific commands.*List of info spu subcommands.*" \
66 "help info spu"
67
68gdb_test "help info spu dma" \
69 "Display MFC DMA status." \
70 "help info spu dma"
71gdb_test "help info spu event" \
72 "Display SPU event facility status." \
73 "help info spu event"
74gdb_test "help info spu mailbox" \
75 "Display SPU mailbox facility status." \
76 "help info spu mailbox"
77gdb_test "help info spu proxydma" \
78 "Display MFC Proxy-DMA status." \
79 "help info spu proxydma"
80gdb_test "help info spu signal" \
81 "Display SPU signal notification facility status." \
82 "help info spu signal"
83
84
85# architecture should be spu:256K.
86gdb_test "show architecture" \
87 "The target architecture is set automatically.*currently spu:256K.*" \
88 "architecture = spu256K"
89
90# 'info spu event'.
91gdb_test "info spu event" \
92 "Event Status.*Event Mask.*" \
93 "info spu event"
94
95# 'info spu signal'.
96gdb_test "info spu signal" \
97 "Signal 1 not pending.*\(Type.*\).*Signal 2 not pending.*\(Type.*\).*" \
98 "info spu signal"
99
100# 'info spu mailbox'.
101gdb_test "info spu mailbox" \
102 "SPU Outbound Mailbox.*SPU Outbound Interrupt Mailbox.*" \
103 "info spu mailbox"
104
105# 'info spu dma'.
106gdb_test "info spu dma" \
12ab8a60 107 "Tag-Group Status.*Tag-Group Mask.*Stall-and-Notify .*Atomic Cmd Status.*" \
23d964e7
UW
108 "info spu dma"
109
110# 'info spu proxydma'.
111gdb_test "info spu proxydma" \
12ab8a60 112 "Tag-Group Status.*Tag-Group Mask.*" \
23d964e7
UW
113 "info spu proxydma"
114
115# Event tests.
116c_to "Marker Event"
117gdb_test "info spu event" \
118 "Event Status 0x00000000.*Event Mask 0x00000000.*" \
119 "empty event status"
120
121# MFC_MULTI_SRC_SYNC_EVENT.
122gdb_test "next" "" "next"
123gdb_test "info spu event" \
124 "Event Status 0x00000000.*Event Mask 0x00001000.*" \
125 "event mask 0x1000"
126# MFC_PRIV_ATTN_EVENT.
127gdb_test "next" "" "next"
128gdb_test "info spu event" \
129 "Event Status 0x00000000.*Event Mask 0x00000800.*" \
130 "event mask 0x0800"
131# MFC_LLR_LOST_EVENT.
132gdb_test "next" "" "next"
133gdb_test "info spu event" \
134 "Event Status 0x00000000.*Event Mask 0x00000400.*" \
135 "event mask 0x0400"
136# MFC_SIGNAL_NOTIFY_1_EVENT.
137gdb_test "next" "" "next"
138gdb_test "info spu event" \
139 "Event Status 0x00000000.*Event Mask 0x00000200.*" \
140 "event mask 0x0200"
141# MFC_SIGNAL_NOTIFY_2_EVENT.
142gdb_test "next" "" "next"
143gdb_test "info spu event" \
144 "Event Status 0x00000000.*Event Mask 0x00000100.*" \
145 "event mask 0x0100"
146# MFC_OUT_MBOX_AVAILABLE_EVENT.
147gdb_test "next" "" "next"
148gdb_test "info spu event" \
149 "Event Status 0x00000000.*Event Mask 0x00000080.*" \
150 "event mask 0x0080"
151# MFC_OUT_INTR_MBOX_AVAILABLE_EVENT.
152gdb_test "next" "" "next"
153gdb_test "info spu event" \
154 "Event Status 0x00000000.*Event Mask 0x00000040.*" \
155 "event mask 0x0040"
156# MFC_DECREMENTER_EVENT.
157gdb_test "next" "" "next"
158gdb_test "info spu event" \
159 "Event Status 0x00000000.*Event Mask 0x00000020.*" \
160 "event mask 0x0020"
161# MFC_IN_MBOX_AVAILABLE_EVENT.
162gdb_test "next" "" "next"
163gdb_test "info spu event" \
164 "Event Status 0x00000000.*Event Mask 0x00000010.*" \
165 "event mask 0x0010"
166# MFC_COMMAND_QUEUE_AVAILABLE_EVENT.
167gdb_test "next" "" "next"
168gdb_test "info spu event" \
169 "Event Status 0x00000000.*Event Mask 0x00000008.*" \
170 "event mask 0x0008"
171# MFC_LIST_STALL_NOTIFY_EVENT.
172gdb_test "next" "" "next"
173gdb_test "info spu event" \
174 "Event Status 0x00000000.*Event Mask 0x00000002.*" \
175 "event mask 0x0002"
176# MFC_TAG_STATUS_UPDATE_EVENT.
177gdb_test "next" "" "next"
178gdb_test "info spu event" \
179 "Event Status 0x00000000.*Event Mask 0x00000001.*" \
180 "event mask 0x0001"
181
182
183# DMA tests.
184# 'info spu dma' should be empty.
185c_to "Marker DMA"
186gdb_test "info spu dma" \
12ab8a60 187 "Tag-Group Status.*0x00000000.*Tag-Group Mask.*0x00000000.*Stall-and-Notify.*0x00000000.*Atomic Cmd Status.*0x00000000\[\r\n\]+" \
23d964e7
UW
188 "info spu dma (empty)"
189
190# 'info spu dma' should be filled with some data.
191c_to "Marker DMAWait"
192gdb_test "next" "" "next"
193gdb_test "info spu dma" \
12ab8a60 194 "Tag-Group Status.*0x00000000.*Tag-Group Mask.*0x00000020.*Stall-and-Notify.*0x00000000.*Atomic Cmd Status.*0x00000000.*Opcode.*Tag.*TId.*RId.*EA.*LSA.*Size.*LstAddr.*LstSize.*E.*get.*5.*0.*0.*0x00080\[ \r\n\]+" \
23d964e7
UW
195 "info spu dma (non-empty)"
196gdb_test "finish" "" "finish"
197
198# Mailbox Test
199# 'info spu mailbox' should be empty.
200c_to "Marker Mbox"
c6140da2
MD
201set msg "info spu mailbox"
202gdb_test_multiple "info spu mailbox" $msg {
203 -re "SPU Outbound Mailbox.*0x00000000.*SPU Outbound Interrupt Mailbox.*0x00000000.*$gdb_prompt $" {
204 pass $msg
205 }
206 -re "SPU Outbound Mailbox.*0x.*SPU Outbound Interrupt Mailbox.*0x.*$gdb_prompt $" {
207 # Older kernels had a bug that caused them to return arbitrary values
208 # when attempting to read from an empty mailbox via spufs.
209 xfail $msg
210 }
211}
23d964e7
UW
212
213# 'info spu mailbox' should now contain data.
214c_to "Marker MboxEnd"
215gdb_test "info spu mailbox" \
216 "SPU Outbound Mailbox.*0x12345678.*SPU Outbound Interrupt Mailbox.*0x12345678.*" \
217 "info spu mailbox"
218
219# Signal Test
220# 'info spu signal'.
221c_to "Marker Signal"
222gdb_test "info spu signal" \
223 "Signal 1 not pending.*\(Type.*\).*Signal 2 not pending.*\(Type.*\).*" \
224 "info spu signal"
225
226# 'info spu signal' with signal1 pending.
227c_to "Marker Signal1"
228gdb_test "info spu signal" \
229 "Signal 1 control word 0x801c0800.*Signal 2 not pending.*\(Type.*\).*" \
230 "info spu signal"
231
232# 'info spu signal' with signal1 and signal2 pending.
233c_to "Marker Signal2"
234gdb_test "info spu signal" \
235 "Signal 1 control word 0x801c0800.*Signal 2 control word 0x801c0800.*" \
236 "info spu signal"
237
238# Read signal1. Only signal2 is pending.
239c_to "Marker SignalRead"
240gdb_test "info spu signal" \
241 "Signal 1 not pending.*Signal 2 control word 0x801c0800.*" \
242 "info spu signal"
243
244
245gdb_exit
246
247return 0
This page took 0.991026 seconds and 4 git commands to generate.