Updated copyright notices for most files.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.disasm / hppa.exp
1
2 # Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2007, 2008, 2009
3 # Free Software Foundation, Inc.
4
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 # This file was written by Jeff Law. (law@cs.utah.edu)
19
20 if $tracelevel then {
21 strace $tracelevel
22 }
23
24 if ![istarget "hppa*-*-*"] {
25 verbose "Tests ignored for all but hppa based targets."
26 return
27 }
28
29
30 set prms_id 0
31 set bug_id 0
32
33 set testfile "hppa"
34 set srcfile ${srcdir}/${subdir}/${testfile}.s
35 set binfile ${objdir}/${subdir}/${testfile}
36 set comp_output [gdb_compile "${srcfile}" "${binfile}" executable ""];
37 if { $comp_output != "" } {
38 if [ regexp "Opcode not defined - DIAG" $comp_output] {
39 warning "HP assembler in use--skipping disasm tests"
40 return
41 } else {
42 perror "Couldn't compile ${srcfile}"
43 return -1
44 }
45 }
46
47 proc all_integer_memory_tests { } {
48 global gdb_prompt
49 global hex
50 global decimal
51
52 send_gdb "x/8i integer_memory_tests\n"
53 gdb_expect {
54 -re "
55 .*ldw 0\\(sr0,r4\\),r26.*
56 .*ldh 0\\(sr0,r4\\),r26.*
57 .*ldb 0\\(sr0,r4\\),r26.*
58 .*stw r26,0\\(sr0,r4\\).*
59 .*sth r26,0\\(sr0,r4\\).*
60 .*stb r26,0\\(sr0,r4\\).*
61 .*ldwm 0\\(sr0,r4\\),r26.*
62 .*stwm r26,0\\(sr0,r4\\).*
63 .*$gdb_prompt $" { pass "integer_memory_tests" }
64 -re "$gdb_prompt $" { fail "integer_memory_tests" }
65 timeout { fail "(timeout) integer memory_tests" }
66 }
67
68 send_gdb "x/20i integer_indexing_load\n"
69 gdb_expect {
70 -re "
71 .*ldwx r5\\(sr0,r4\\),r26.*
72 .*ldwx,s r5\\(sr0,r4\\),r26.*
73 .*ldwx,m r5\\(sr0,r4\\),r26.*
74 .*ldwx,sm r5\\(sr0,r4\\),r26.*
75 .*ldhx r5\\(sr0,r4\\),r26.*
76 .*ldhx,s r5\\(sr0,r4\\),r26.*
77 .*ldhx,m r5\\(sr0,r4\\),r26.*
78 .*ldhx,sm r5\\(sr0,r4\\),r26.*
79 .*ldbx r5\\(sr0,r4\\),r26.*
80 .*ldbx,s r5\\(sr0,r4\\),r26.*
81 .*ldbx,m r5\\(sr0,r4\\),r26.*
82 .*ldbx,sm r5\\(sr0,r4\\),r26.*
83 .*ldwax r5\\(r4\\),r26.*
84 .*ldwax,s r5\\(r4\\),r26.*
85 .*ldwax,m r5\\(r4\\),r26.*
86 .*ldwax,sm r5\\(r4\\),r26.*
87 .*ldcwx r5\\(sr0,r4\\),r26.*
88 .*ldcwx,s r5\\(sr0,r4\\),r26.*
89 .*ldcwx,m r5\\(sr0,r4\\),r26.*
90 .*ldcwx,sm r5\\(sr0,r4\\),r26.*
91 .*$gdb_prompt $" { pass "integer_indexing_load" }
92 -re "$gdb_prompt $" { fail "integer_indexing_load" }
93 timeout { fail "(timeout) integer_indexing" }
94 }
95
96 send_gdb "x/15i integer_load_short_memory\n"
97 gdb_expect {
98 -re "
99 .*ldws 0\\(sr0,r4\\),r26.*
100 .*ldws,mb 0\\(sr0,r4\\),r26.*
101 .*ldws,ma 0\\(sr0,r4\\),r26.*
102 .*ldhs 0\\(sr0,r4\\),r26.*
103 .*ldhs,mb 0\\(sr0,r4\\),r26.*
104 .*ldhs,ma 0\\(sr0,r4\\),r26.*
105 .*ldbs 0\\(sr0,r4\\),r26.*
106 .*ldbs,mb 0\\(sr0,r4\\),r26.*
107 .*ldbs,ma 0\\(sr0,r4\\),r26.*
108 .*ldwas 0\\(r4\\),r26.*
109 .*ldwas,mb 0\\(r4\\),r26.*
110 .*ldwas,ma 0\\(r4\\),r26.*
111 .*ldcws 0\\(sr0,r4\\),r26.*
112 .*ldcws,mb 0\\(sr0,r4\\),r26.*
113 .*ldcws,ma 0\\(sr0,r4\\),r26.*
114 .*$gdb_prompt $" { pass "integer_load_short_memory" }
115 -re "$gdb_prompt $" { fail "integer_load_short_memory" }
116 timeout { fail "(timeout) integer_load_short_memory " }
117 }
118
119
120 send_gdb "x/17i integer_store_short_memory\n"
121 gdb_expect {
122 -re "
123 .*stws r26,0\\(sr0,r4\\).*
124 .*stws,mb r26,0\\(sr0,r4\\).*
125 .*stws,ma r26,0\\(sr0,r4\\).*
126 .*sths r26,0\\(sr0,r4\\).*
127 .*sths,mb r26,0\\(sr0,r4\\).*
128 .*sths,ma r26,0\\(sr0,r4\\).*
129 .*stbs r26,0\\(sr0,r4\\).*
130 .*stbs,mb r26,0\\(sr0,r4\\).*
131 .*stbs,ma r26,0\\(sr0,r4\\).*
132 .*stwas r26,0\\(r4\\).*
133 .*stwas,mb r26,0\\(r4\\).*
134 .*stwas,ma r26,0\\(r4\\).*
135 .*stbys r26,0\\(sr0,r4\\).*
136 .*stbys r26,0\\(sr0,r4\\).*
137 .*stbys,e r26,0\\(sr0,r4\\).*
138 .*stbys,b,m r26,0\\(sr0,r4\\).*
139 .*stbys,e,m r26,0\\(sr0,r4\\).*
140 .*$gdb_prompt $" { pass "integer_store_short_memory" }
141 -re "$gdb_prompt $" { fail "integer_store_short_memory" }
142 timeout { fail "(timeout) integer_short_memory " }
143 }
144 }
145
146 proc all_immediate_tests { } {
147 global gdb_prompt
148 global hex
149 global decimal
150
151 send_gdb "x/3i immediate_tests\n"
152 gdb_expect {
153 -re "
154 .*ldo 5\\(r26\\),r26.*
155 .*ldil -21524800,r26.*
156 .*addil -21524800,r5.*
157 .*$gdb_prompt $" { pass "immedate_tests" }
158 -re "$gdb_prompt $" { fail "immedate_tests" }
159 timeout { fail "(timeout) immedate_tests " }
160 }
161 }
162
163 proc all_branch_tests { } {
164 global gdb_prompt
165 global hex
166 global decimal
167
168 send_gdb "x/10i branch_tests_1\n"
169 gdb_expect {
170 -re "
171 .*bl.*,rp.*
172 .*bl,n.*,rp.*
173 .*b.*
174 .*b,n.*
175 .*gate.*,rp.*
176 .*gate,n.*,rp.*
177 .*blr r4,rp.*
178 .*blr,n r4,rp.*
179 .*blr r4,r0.*
180 .*blr,n r4,r0.*
181 .*$gdb_prompt $" { pass "branch_tests_1" }
182 -re "$gdb_prompt $" { fail "branch_tests_1" }
183 timeout { fail "(timeout) branch_tests_1" }
184 }
185
186 send_gdb "x/6i branch_tests_2\n"
187 gdb_expect {
188 -re "
189 .*bv r0\\(rp\\).*
190 .*bv,n r0\\(rp\\).*
191 .*be 1234\\(sr1,rp\\).*
192 .*be,n 1234\\(sr1,rp\\).*
193 .*ble 1234\\(sr1,rp\\).*
194 .*ble,n 1234\\(sr1,rp\\).*
195 .*$gdb_prompt $" { pass "branch_tests_2" }
196 -re "$gdb_prompt $" { fail "branch_tests_2" }
197 timeout { fail "(timeout) branch_tests_2" }
198 }
199
200
201 send_gdb "x/8i movb_tests\n"
202 gdb_expect {
203 -re "
204 .*movb r4,r26,.* <movb_tests>.*
205 .*movb,= r4,r26,.* <movb_tests>.*
206 .*movb,< r4,r26,.* <movb_tests>.*
207 .*movb,od r4,r26,.* <movb_tests>.*
208 .*movb,tr r4,r26,.* <movb_tests>.*
209 .*movb,<> r4,r26,.* <movb_tests>.*
210 .*movb,>= r4,r26,.* <movb_tests>.*
211 .*movb,ev r4,r26,.* <movb_tests>.*
212 .*$gdb_prompt $" { pass "movb_tests" }
213 -re "$gdb_prompt $" { fail "movb_tests" }
214 timeout { fail "(timeout) movb_tests " }
215 }
216
217 send_gdb "x/8i movb_nullified_tests\n"
218 gdb_expect {
219 -re "
220 .*movb,n.*r4,r26,.* <movb_tests>.*
221 .*movb,=,n.*r4,r26,.* <movb_tests>.*
222 .*movb,<,n.*r4,r26,.* <movb_tests>.*
223 .*movb,od,n.*r4,r26,.* <movb_tests>.*
224 .*movb,tr,n.*r4,r26,.* <movb_tests>.*
225 .*movb,<>,n.*r4,r26,.* <movb_tests>.*
226 .*movb,>=,n.*r4,r26,.* <movb_tests>.*
227 .*movb,ev,n.*r4,r26,.* <movb_tests>.*
228 .*$gdb_prompt $" { pass "movb_nullified_tests" }
229 -re "$gdb_prompt $" { fail "movb_nullified_tests" }
230 timeout { fail "(timeout) movb_nullified_tests " }
231 }
232
233 send_gdb "x/8i movib_tests\n"
234 gdb_expect {
235 -re "
236 .*movib 5,r26,.* <movib_tests>.*
237 .*movib,= 5,r26,.* <movib_tests>.*
238 .*movib,< 5,r26,.* <movib_tests>.*
239 .*movib,od 5,r26,.* <movib_tests>.*
240 .*movib,tr 5,r26,.* <movib_tests>.*
241 .*movib,<> 5,r26,.* <movib_tests>.*
242 .*movib,>= 5,r26,.* <movib_tests>.*
243 .*movib,ev 5,r26,.* <movib_tests>.*
244 .*$gdb_prompt $" { pass "movib_tests" }
245 -re "$gdb_prompt $" { fail "movib_tests" }
246 timeout { fail "(timeout) movib_tests " }
247 }
248
249 send_gdb "x/8i movib_nullified_tests\n"
250 gdb_expect {
251 -re "
252 .*movib,n.*5,r26,.* <movib_tests>.*
253 .*movib,=,n.*5,r26,.* <movib_tests>.*
254 .*movib,<,n.*5,r26,.* <movib_tests>.*
255 .*movib,od,n.*5,r26,.* <movib_tests>.*
256 .*movib,tr,n.*5,r26,.* <movib_tests>.*
257 .*movib,<>,n.*5,r26,.* <movib_tests>.*
258 .*movib,>=,n.*5,r26,.* <movib_tests>.*
259 .*movib,ev,n.*5,r26,.* <movib_tests>.*
260 .*$gdb_prompt $" { pass "movib_nullified_tests" }
261 -re "$gdb_prompt $" { fail "movib_nullified_tests" }
262 timeout { fail "(timeout) movib_nullified_tests " }
263 }
264
265 send_gdb "x/8i comb_tests_1\n"
266 gdb_expect {
267 -re "
268 .*comb r0,r4,.* <comb_tests_1>.*
269 .*comb,= r0,r4,.* <comb_tests_1>.*
270 .*comb,< r0,r4,.* <comb_tests_1>.*
271 .*comb,<= r0,r4,.* <comb_tests_1>.*
272 .*comb,<< r0,r4,.* <comb_tests_1>.*
273 .*comb,<<= r0,r4,.* <comb_tests_1>.*
274 .*comb,sv r0,r4,.* <comb_tests_1>.*
275 .*comb,od r0,r4,.* <comb_tests_1>.*
276 .*$gdb_prompt $" { pass "comb_tests_1" }
277 -re "$gdb_prompt $" { fail "comb_tests_1" }
278 timeout { fail "(timeout) comb_tests_1" }
279 }
280
281 send_gdb "x/8i comb_tests_2\n"
282 gdb_expect {
283 -re "
284 .*combf r0,r4,.* <comb_tests_2>.*
285 .*combf,= r0,r4,.* <comb_tests_2>.*
286 .*combf,< r0,r4,.* <comb_tests_2>.*
287 .*combf,<= r0,r4,.* <comb_tests_2>.*
288 .*combf,<< r0,r4,.* <comb_tests_2>.*
289 .*combf,<<= r0,r4,.* <comb_tests_2>.*
290 .*combf,sv r0,r4,.* <comb_tests_2>.*
291 .*combf,od r0,r4,.* <comb_tests_2>.*
292 .*$gdb_prompt $" { pass "comb_tests_2" }
293 -re "$gdb_prompt $" { fail "comb_tests_2" }
294 timeout { fail "(timeout) comb_tests_2" }
295 }
296
297 send_gdb "x/8i comb_nullified_tests_1\n"
298 gdb_expect {
299 -re "
300 .*comb,n r0,r4,.* <comb_tests_1>.*
301 .*comb,=,n r0,r4,.* <comb_tests_1>.*
302 .*comb,<,n r0,r4,.* <comb_tests_1>.*
303 .*comb,<=,n r0,r4,.* <comb_tests_1>.*
304 .*comb,<<,n r0,r4,.* <comb_tests_1>.*
305 .*comb,<<=,n r0,r4,.* <comb_tests_1>.*
306 .*comb,sv,n r0,r4,.* <comb_tests_1>.*
307 .*comb,od,n r0,r4,.* <comb_tests_1>.*
308 .*$gdb_prompt $" { pass "comb_nullified_tests_1" }
309 -re "$gdb_prompt $" { fail "comb_nullified_tests_1" }
310 timeout { fail "(timeout) comb_nullified_tests_1" }
311 }
312
313 send_gdb "x/8i comb_nullified_tests_2\n"
314 gdb_expect {
315 -re "
316 .*combf,n r0,r4,.* <comb_tests_2>.*
317 .*combf,=,n r0,r4,.* <comb_tests_2>.*
318 .*combf,<,n r0,r4,.* <comb_tests_2>.*
319 .*combf,<=,n r0,r4,.* <comb_tests_2>.*
320 .*combf,<<,n r0,r4,.* <comb_tests_2>.*
321 .*combf,<<=,n r0,r4,.* <comb_tests_2>.*
322 .*combf,sv,n r0,r4,.* <comb_tests_2>.*
323 .*combf,od,n r0,r4,.* <comb_tests_2>.*
324 .*$gdb_prompt $" { pass "comb_nullified_tests_2" }
325 -re "$gdb_prompt $" { fail "comb_nullified_tests_2" }
326 timeout { fail "(timeout) comb_nullified_tests_2" }
327 }
328
329 send_gdb "x/8i comib_tests_1\n"
330 gdb_expect {
331 -re "
332 .*comib 0,r4,.* <comib_tests_1>.*
333 .*comib,= 0,r4,.* <comib_tests_1>.*
334 .*comib,< 0,r4,.* <comib_tests_1>.*
335 .*comib,<= 0,r4,.* <comib_tests_1>.*
336 .*comib,<< 0,r4,.* <comib_tests_1>.*
337 .*comib,<<= 0,r4,.* <comib_tests_1>.*
338 .*comib,sv 0,r4,.* <comib_tests_1>.*
339 .*comib,od 0,r4,.* <comib_tests_1>.*
340 .*$gdb_prompt $" { pass "comib_tests_1" }
341 -re "$gdb_prompt $" { fail "comib_tests_1" }
342 timeout { fail "(timeout) comib_tests_1" }
343 }
344
345 send_gdb "x/8i comib_tests_2\n"
346 gdb_expect {
347 -re "
348 .*comibf 0,r4,.* <comib_tests_2>.*
349 .*comibf,= 0,r4,.* <comib_tests_2>.*
350 .*comibf,< 0,r4,.* <comib_tests_2>.*
351 .*comibf,<= 0,r4,.* <comib_tests_2>.*
352 .*comibf,<< 0,r4,.* <comib_tests_2>.*
353 .*comibf,<<= 0,r4,.* <comib_tests_2>.*
354 .*comibf,sv 0,r4,.* <comib_tests_2>.*
355 .*comibf,od 0,r4,.* <comib_tests_2>.*
356 .*$gdb_prompt $" { pass "comib_tests_2" }
357 -re "$gdb_prompt $" { fail "comib_tests_2" }
358 timeout { fail "(timeout) comib_tests_2" }
359 }
360
361 send_gdb "x/8i comib_nullified_tests_1\n"
362 gdb_expect {
363 -re "
364 .*comib,n 0,r4,.* <comib_tests_1>.*
365 .*comib,=,n 0,r4,.* <comib_tests_1>.*
366 .*comib,<,n 0,r4,.* <comib_tests_1>.*
367 .*comib,<=,n 0,r4,.* <comib_tests_1>.*
368 .*comib,<<,n 0,r4,.* <comib_tests_1>.*
369 .*comib,<<=,n 0,r4,.* <comib_tests_1>.*
370 .*comib,sv,n 0,r4,.* <comib_tests_1>.*
371 .*comib,od,n 0,r4,.* <comib_tests_1>.*
372 .*$gdb_prompt $" { pass "comib_nullified_tests_1" }
373 -re "$gdb_prompt $" { fail "comib_nullified_tests_1" }
374 timeout { fail "(timeout) comib_nullified_tests_1" }
375 }
376
377 send_gdb "x/8i comib_nullified_tests_2\n"
378 gdb_expect {
379 -re "
380 .*comibf,n 0,r4,.* <comib_tests_2>.*
381 .*comibf,=,n 0,r4,.* <comib_tests_2>.*
382 .*comibf,<,n 0,r4,.* <comib_tests_2>.*
383 .*comibf,<=,n 0,r4,.* <comib_tests_2>.*
384 .*comibf,<<,n 0,r4,.* <comib_tests_2>.*
385 .*comibf,<<=,n 0,r4,.* <comib_tests_2>.*
386 .*comibf,sv,n 0,r4,.* <comib_tests_2>.*
387 .*comibf,od,n 0,r4,.* <comib_tests_2>.*
388 .*$gdb_prompt $" { pass "comib_nullified_tests_2" }
389 -re "$gdb_prompt $" { fail "comib_nullified_tests_2" }
390 timeout { fail "(timeout) comib_nullified_tests_2" }
391 }
392
393 send_gdb "x/8i addb_tests_1\n"
394 gdb_expect {
395 -re "
396 .*addb r1,r4,.* <addb_tests_1>.*
397 .*addb,= r1,r4,.* <addb_tests_1>.*
398 .*addb,< r1,r4,.* <addb_tests_1>.*
399 .*addb,<= r1,r4,.* <addb_tests_1>.*
400 .*addb,nuv r1,r4,.* <addb_tests_1>.*
401 .*addb,znv r1,r4,.* <addb_tests_1>.*
402 .*addb,sv r1,r4,.* <addb_tests_1>.*
403 .*addb,od r1,r4,.* <addb_tests_1>.*
404 .*$gdb_prompt $" { pass "addb_tests_1" }
405 -re "$gdb_prompt $" { fail "addb_tests_1" }
406 timeout { fail "(timeout) addb_tests_1" }
407 }
408
409 send_gdb "x/8i addb_tests_2\n"
410 gdb_expect {
411 -re "
412 .*addbf r1,r4,.* <addb_tests_2>.*
413 .*addbf,= r1,r4,.* <addb_tests_2>.*
414 .*addbf,< r1,r4,.* <addb_tests_2>.*
415 .*addbf,<= r1,r4,.* <addb_tests_2>.*
416 .*addbf,nuv r1,r4,.* <addb_tests_2>.*
417 .*addbf,znv r1,r4,.* <addb_tests_2>.*
418 .*addbf,sv r1,r4,.* <addb_tests_2>.*
419 .*addbf,od r1,r4,.* <addb_tests_2>.*
420 .*$gdb_prompt $" { pass "addb_tests_2" }
421 -re "$gdb_prompt $" { fail "addb_tests_2" }
422 timeout { fail "(timeout) addb_tests_2" }
423 }
424
425 send_gdb "x/8i addb_nullified_tests_1\n"
426 gdb_expect {
427 -re "
428 .*addb,n r1,r4,.* <addb_tests_1>.*
429 .*addb,=,n r1,r4,.* <addb_tests_1>.*
430 .*addb,<,n r1,r4,.* <addb_tests_1>.*
431 .*addb,<=,n r1,r4,.* <addb_tests_1>.*
432 .*addb,nuv,n r1,r4,.* <addb_tests_1>.*
433 .*addb,znv,n r1,r4,.* <addb_tests_1>.*
434 .*addb,sv,n r1,r4,.* <addb_tests_1>.*
435 .*addb,od,n r1,r4,.* <addb_tests_1>.*
436 .*$gdb_prompt $" { pass "addb_nullified_tests_1" }
437 -re "$gdb_prompt $" { fail "addb_nullified_tests_1" }
438 timeout { fail "(timeout) addb_nullified_tests_1" }
439 }
440
441 send_gdb "x/8i addb_nullified_tests_2\n"
442 gdb_expect {
443 -re "
444 .*addbf,n r1,r4,.* <addb_tests_2>.*
445 .*addbf,=,n r1,r4,.* <addb_tests_2>.*
446 .*addbf,<,n r1,r4,.* <addb_tests_2>.*
447 .*addbf,<=,n r1,r4,.* <addb_tests_2>.*
448 .*addbf,nuv,n r1,r4,.* <addb_tests_2>.*
449 .*addbf,znv,n r1,r4,.* <addb_tests_2>.*
450 .*addbf,sv,n r1,r4,.* <addb_tests_2>.*
451 .*addbf,od,n r1,r4,.* <addb_tests_2>.*
452 .*$gdb_prompt $" { pass "addb_nullified_tests_2" }
453 -re "$gdb_prompt $" { fail "addb_nullified_tests_2" }
454 timeout { fail "(timeout) addb_nullified_tests_2" }
455 }
456
457 send_gdb "x/8i addib_tests_1\n"
458 gdb_expect {
459 -re "
460 .*addib -1,r4,.* <addib_tests_1>.*
461 .*addib,= -1,r4,.* <addib_tests_1>.*
462 .*addib,< -1,r4,.* <addib_tests_1>.*
463 .*addib,<= -1,r4,.* <addib_tests_1>.*
464 .*addib,nuv -1,r4,.* <addib_tests_1>.*
465 .*addib,znv -1,r4,.* <addib_tests_1>.*
466 .*addib,sv -1,r4,.* <addib_tests_1>.*
467 .*addib,od -1,r4,.* <addib_tests_1>.*
468 .*$gdb_prompt $" { pass "addib_tests_1" }
469 -re "$gdb_prompt $" { fail "addib_tests_1" }
470 timeout { fail "(timeout) addib_tests_1" }
471 }
472
473 send_gdb "x/8i addib_tests_2\n"
474 gdb_expect {
475 -re "
476 .*addibf -1,r4,.* <addib_tests_2>.*
477 .*addibf,= -1,r4,.* <addib_tests_2>.*
478 .*addibf,< -1,r4,.* <addib_tests_2>.*
479 .*addibf,<= -1,r4,.* <addib_tests_2>.*
480 .*addibf,nuv -1,r4,.* <addib_tests_2>.*
481 .*addibf,znv -1,r4,.* <addib_tests_2>.*
482 .*addibf,sv -1,r4,.* <addib_tests_2>.*
483 .*addibf,od -1,r4,.* <addib_tests_2>.*
484 .*$gdb_prompt $" { pass "addib_tests_2" }
485 -re "$gdb_prompt $" { fail "addib_tests_2" }
486 timeout { fail "(timeout) addib_tests_2" }
487 }
488
489 send_gdb "x/8i addib_nullified_tests_1\n"
490 gdb_expect {
491 -re "
492 .*addib,n -1,r4,.* <addib_tests_1>.*
493 .*addib,=,n -1,r4,.* <addib_tests_1>.*
494 .*addib,<,n -1,r4,.* <addib_tests_1>.*
495 .*addib,<=,n -1,r4,.* <addib_tests_1>.*
496 .*addib,nuv,n -1,r4,.* <addib_tests_1>.*
497 .*addib,znv,n -1,r4,.* <addib_tests_1>.*
498 .*addib,sv,n -1,r4,.* <addib_tests_1>.*
499 .*addib,od,n -1,r4,.* <addib_tests_1>.*
500 .*$gdb_prompt $" { pass "addb_nullified_tests_1" }
501 -re "$gdb_prompt $" { fail "addb_nullified_tests_1" }
502 timeout { fail "(timeout) addb_nullified_tests_1" }
503 }
504
505 send_gdb "x/8i addib_nullified_tests_2\n"
506 gdb_expect {
507 -re "
508 .*addibf,n -1,r4,.* <addib_tests_2>.*
509 .*addibf,=,n -1,r4,.* <addib_tests_2>.*
510 .*addibf,<,n -1,r4,.* <addib_tests_2>.*
511 .*addibf,<=,n -1,r4,.* <addib_tests_2>.*
512 .*addibf,nuv,n -1,r4,.* <addib_tests_2>.*
513 .*addibf,znv,n -1,r4,.* <addib_tests_2>.*
514 .*addibf,sv,n -1,r4,.* <addib_tests_2>.*
515 .*addibf,od,n -1,r4,.* <addib_tests_2>.*
516 .*$gdb_prompt $" { pass "addb_nullified_tests_2" }
517 -re "$gdb_prompt $" { fail "addb_nullified_tests_2" }
518 timeout { fail "(timeout) addb_nullified_tests_2" }
519 }
520
521 send_gdb "x/8i bb_tests\n"
522 gdb_expect {
523 -re "
524 .*bvb,< r4,.* <bb_tests>.*
525 .*bvb,>= r4,.* <bb_tests>.*
526 .*bvb,<,n r4,.* <bb_tests>.*
527 .*bvb,>=,n r4,.* <bb_tests>.*
528 .*bb,< r4,5,.* <bb_tests>.*
529 .*bb,>= r4,5,.* <bb_tests>.*
530 .*bb,<,n r4,5,.* <bb_tests>.*
531 .*bb,>=,n r4,5,.* <bb_tests>.*
532 .*$gdb_prompt $" { pass "bb_tests" }
533 -re "$gdb_prompt $" { fail "bb_tests" }
534 timeout { fail "(timeout) bb_tests " }
535 }
536 }
537
538 proc all_integer_computational_tests { } {
539 global gdb_prompt
540 global hex
541 global decimal
542
543 set add_insns [list {add} {addl} {addo} {addc} {addco} \
544 {sh1add} {sh1addl} {sh1addo} \
545 {sh2add} {sh2addl} {sh2addo} \
546 {sh3add} {sh3addl} {sh3addo} ]
547
548 foreach i $add_insns {
549 send_gdb "x/16i $i"; send_gdb "_tests\n"
550 gdb_expect {
551 -re "
552 .*$i r4,r5,r6.*
553 .*$i,= r4,r5,r6.*
554 .*$i,< r4,r5,r6.*
555 .*$i,<= r4,r5,r6.*
556 .*$i,nuv r4,r5,r6.*
557 .*$i,znv r4,r5,r6.*
558 .*$i,sv r4,r5,r6.*
559 .*$i,od r4,r5,r6.*
560 .*$i,tr r4,r5,r6.*
561 .*$i,<> r4,r5,r6.*
562 .*$i,>= r4,r5,r6.*
563 .*$i,> r4,r5,r6.*
564 .*$i,uv r4,r5,r6.*
565 .*$i,vnz r4,r5,r6.*
566 .*$i,nsv r4,r5,r6.*
567 .*$i,ev r4,r5,r6.*
568 .*$gdb_prompt $" { pass "$i tests" }
569 -re "$gdb_prompt $" { fail "$i tests" }
570 timeout { fail "(timeout) $i tests" }
571 }
572 }
573
574 set sub_insns [list {sub} {subo} {subb} {subbo} {subt} {subto} \
575 {ds} {comclr} ]
576
577 foreach i $sub_insns {
578 send_gdb "x/16i $i"; send_gdb "_tests\n"
579 gdb_expect {
580 -re "
581 .*$i r4,r5,r6.*
582 .*$i,= r4,r5,r6.*
583 .*$i,< r4,r5,r6.*
584 .*$i,<= r4,r5,r6.*
585 .*$i,<< r4,r5,r6.*
586 .*$i,<<= r4,r5,r6.*
587 .*$i,sv r4,r5,r6.*
588 .*$i,od r4,r5,r6.*
589 .*$i,tr r4,r5,r6.*
590 .*$i,<> r4,r5,r6.*
591 .*$i,>= r4,r5,r6.*
592 .*$i,> r4,r5,r6.*
593 .*$i,>>= r4,r5,r6.*
594 .*$i,>> r4,r5,r6.*
595 .*$i,nsv r4,r5,r6.*
596 .*$i,ev r4,r5,r6.*
597 .*$gdb_prompt $" { pass "$i tests" }
598 -re "$gdb_prompt $" { fail "$i tests" }
599 timeout { fail "(timeout) $i tests" }
600 }
601 }
602
603 set logical_insns [list {or} {xor} {and} {andcm} ]
604
605 foreach i $logical_insns {
606 send_gdb "x/10i $i"; send_gdb "_tests\n"
607 gdb_expect {
608 -re "
609 .*$i r4,r5,r6.*
610 .*$i,= r4,r5,r6.*
611 .*$i,< r4,r5,r6.*
612 .*$i,<= r4,r5,r6.*
613 .*$i,od r4,r5,r6.*
614 .*$i,tr r4,r5,r6.*
615 .*$i,<> r4,r5,r6.*
616 .*$i,>= r4,r5,r6.*
617 .*$i,> r4,r5,r6.*
618 .*$i,ev r4,r5,r6.*
619 .*$gdb_prompt $" { pass "$i tests" }
620 -re "$gdb_prompt $" { fail "$i tests" }
621 timeout { fail "(timeout) $i tests" }
622 }
623 }
624
625 set unit_insns1 [list {uxor} {uaddcm} {uaddcmt} ]
626
627 foreach i $unit_insns1 {
628 send_gdb "x/12i $i"; send_gdb "_tests\n"
629 gdb_expect {
630 -re "
631 .*$i r4,r5,r6.*
632 .*$i,sbz r4,r5,r6.*
633 .*$i,shz r4,r5,r6.*
634 .*$i,sdc r4,r5,r6.*
635 .*$i,sbc r4,r5,r6.*
636 .*$i,shc r4,r5,r6.*
637 .*$i,tr r4,r5,r6.*
638 .*$i,nbz r4,r5,r6.*
639 .*$i,nhz r4,r5,r6.*
640 .*$i,ndc r4,r5,r6.*
641 .*$i,nbc r4,r5,r6.*
642 .*$i,nhc r4,r5,r6.*
643 .*$gdb_prompt $" { pass "$i tests" }
644 -re "$gdb_prompt $" { fail "$i tests" }
645 timeout { fail "(timeout) $i tests" }
646 }
647 }
648
649 set unit_insns2 [list {dcor} {idcor} ]
650
651 foreach i $unit_insns2 {
652 send_gdb "x/12i $i"; send_gdb "_tests\n"
653 gdb_expect {
654 -re "
655 .*$i r4,r5.*
656 .*$i,sbz r4,r5.*
657 .*$i,shz r4,r5.*
658 .*$i,sdc r4,r5.*
659 .*$i,sbc r4,r5.*
660 .*$i,shc r4,r5.*
661 .*$i,tr r4,r5.*
662 .*$i,nbz r4,r5.*
663 .*$i,nhz r4,r5.*
664 .*$i,ndc r4,r5.*
665 .*$i,nbc r4,r5.*
666 .*$i,nhc r4,r5.*
667 .*$gdb_prompt $" { pass "$i tests" }
668 -re "$gdb_prompt $" { fail "$i tests" }
669 timeout { fail "(timeout) $i tests" }
670 }
671 }
672
673 set addi_insns [list {addi} {addio} {addit} {addito} ]
674
675 foreach i $addi_insns {
676 send_gdb "x/16i $i"; send_gdb "_tests\n"
677 gdb_expect {
678 -re "
679 .*$i 7b,r5,r6.*
680 .*$i,= 7b,r5,r6.*
681 .*$i,< 7b,r5,r6.*
682 .*$i,<= 7b,r5,r6.*
683 .*$i,nuv 7b,r5,r6.*
684 .*$i,znv 7b,r5,r6.*
685 .*$i,sv 7b,r5,r6.*
686 .*$i,od 7b,r5,r6.*
687 .*$i,tr 7b,r5,r6.*
688 .*$i,<> 7b,r5,r6.*
689 .*$i,>= 7b,r5,r6.*
690 .*$i,> 7b,r5,r6.*
691 .*$i,uv 7b,r5,r6.*
692 .*$i,vnz 7b,r5,r6.*
693 .*$i,nsv 7b,r5,r6.*
694 .*$i,ev 7b,r5,r6.*
695 .*$gdb_prompt $" { pass "$i tests" }
696 -re "$gdb_prompt $" { fail "$i tests" }
697 timeout { fail "(timeout) $i tests" }
698 }
699 }
700
701 set subi_insns [list {subi} {subio} {comiclr} ]
702
703 foreach i $subi_insns {
704 send_gdb "x/16i $i"; send_gdb "_tests\n"
705 gdb_expect {
706 -re "
707 .*$i 7b,r5,r6.*
708 .*$i,= 7b,r5,r6.*
709 .*$i,< 7b,r5,r6.*
710 .*$i,<= 7b,r5,r6.*
711 .*$i,<< 7b,r5,r6.*
712 .*$i,<<= 7b,r5,r6.*
713 .*$i,sv 7b,r5,r6.*
714 .*$i,od 7b,r5,r6.*
715 .*$i,tr 7b,r5,r6.*
716 .*$i,<> 7b,r5,r6.*
717 .*$i,>= 7b,r5,r6.*
718 .*$i,> 7b,r5,r6.*
719 .*$i,>>= 7b,r5,r6.*
720 .*$i,>> 7b,r5,r6.*
721 .*$i,nsv 7b,r5,r6.*
722 .*$i,ev 7b,r5,r6.*
723 .*$gdb_prompt $" { pass "$i tests" }
724 -re "$gdb_prompt $" { fail "$i tests" }
725 timeout { fail "(timeout) $i tests" }
726 }
727 }
728
729 send_gdb "x/8i vshd_tests\n"
730 gdb_expect {
731 -re "
732 .*vshd r4,r5,r6.*
733 .*vshd,= r4,r5,r6.*
734 .*vshd,< r4,r5,r6.*
735 .*vshd,od r4,r5,r6.*
736 .*vshd,tr r4,r5,r6.*
737 .*vshd,<> r4,r5,r6.*
738 .*vshd,>= r4,r5,r6.*
739 .*vshd,ev r4,r5,r6.*
740 .*$gdb_prompt $" { pass "vshd tests" }
741 -re "$gdb_prompt $" { fail "vshd tests" }
742 timeout { fail "(timeout) "vshd tests" }
743 }
744
745 send_gdb "x/8i shd_tests\n"
746 gdb_expect {
747 -re "
748 .*shd r4,r5,5,r6.*
749 .*shd,= r4,r5,5,r6.*
750 .*shd,< r4,r5,5,r6.*
751 .*shd,od r4,r5,5,r6.*
752 .*shd,tr r4,r5,5,r6.*
753 .*shd,<> r4,r5,5,r6.*
754 .*shd,>= r4,r5,5,r6.*
755 .*shd,ev r4,r5,5,r6.*
756 .*$gdb_prompt $" { pass "shd tests" }
757 -re "$gdb_prompt $" { fail "shd tests" }
758 timeout { fail "(timeout) "shd tests" }
759 }
760
761 set extract_insns1 [list {extru} {extrs} {zdep} {dep} ]
762
763 foreach i $extract_insns1 {
764 send_gdb "x/8i $i"; send_gdb "_tests\n"
765 gdb_expect {
766 -re "
767 .*$i r4,5,10,r6.*
768 .*$i,= r4,5,10,r6.*
769 .*$i,< r4,5,10,r6.*
770 .*$i,od r4,5,10,r6.*
771 .*$i,tr r4,5,10,r6.*
772 .*$i,<> r4,5,10,r6.*
773 .*$i,>= r4,5,10,r6.*
774 .*$i,ev r4,5,10,r6.*
775 .*$gdb_prompt $" { pass "$i tests" }
776 -re "$gdb_prompt $" { fail "$i tests" }
777 timeout { fail "(timeout) $i tests" }
778 }
779 }
780
781 set extract_insns2 [list {vextru} {vextrs} {zvdep} {vdep} ]
782
783 foreach i $extract_insns2 {
784 send_gdb "x/8i $i"; send_gdb "_tests\n"
785 gdb_expect {
786 -re "
787 .*$i r4,5,r6.*
788 .*$i,= r4,5,r6.*
789 .*$i,< r4,5,r6.*
790 .*$i,od r4,5,r6.*
791 .*$i,tr r4,5,r6.*
792 .*$i,<> r4,5,r6.*
793 .*$i,>= r4,5,r6.*
794 .*$i,ev r4,5,r6.*
795 .*$gdb_prompt $" { pass "$i tests" }
796 -re "$gdb_prompt $" { fail "$i tests" }
797 timeout { fail "(timeout) $i tests" }
798 }
799 }
800
801 set extract_insns3 [list {vdepi} {zvdepi} ]
802
803 foreach i $extract_insns3 {
804 send_gdb "x/8i $i"; send_gdb "_tests\n"
805 gdb_expect {
806 -re "
807 .*$i -1,5,r6.*
808 .*$i,= -1,5,r6.*
809 .*$i,< -1,5,r6.*
810 .*$i,od -1,5,r6.*
811 .*$i,tr -1,5,r6.*
812 .*$i,<> -1,5,r6.*
813 .*$i,>= -1,5,r6.*
814 .*$i,ev -1,5,r6.*
815 .*$gdb_prompt $" { pass "$i tests" }
816 -re "$gdb_prompt $" { fail "$i tests" }
817 timeout { fail "(timeout) $i tests" }
818 }
819 }
820
821 set extract_insns4 [list {depi} {zdepi} ]
822
823 foreach i $extract_insns4 {
824 send_gdb "x/8i $i"; send_gdb "_tests\n"
825 gdb_expect {
826 -re "
827 .*$i -1,4,10,r6.*
828 .*$i,= -1,4,10,r6.*
829 .*$i,< -1,4,10,r6.*
830 .*$i,od -1,4,10,r6.*
831 .*$i,tr -1,4,10,r6.*
832 .*$i,<> -1,4,10,r6.*
833 .*$i,>= -1,4,10,r6.*
834 .*$i,ev -1,4,10,r6.*
835 .*$gdb_prompt $" { pass "$i tests" }
836 -re "$gdb_prompt $" { fail "$i tests" }
837 timeout { fail "(timeout) $i tests" }
838 }
839 }
840 }
841
842 proc all_system_control_tests { } {
843 global gdb_prompt
844 global hex
845 global decimal
846
847 send_gdb "x/14i system_control_tests\n"
848 gdb_expect {
849 -re "
850 .*break 5,c.*
851 .*rfi.*
852 .*rfir.*
853 .*ssm 5,r4.*
854 .*rsm 5,r4.*
855 .*mtsm r4.*
856 .*ldsid \\(sr0,r5\\),r4.*
857 .*mtsp r4,sr0.*
858 .*mtctl r4,ccr.*
859 .*mfsp sr0,r4.*
860 .*mfctl ccr,r4.*
861 .*sync.*
862 .*syncdma.*
863 .*diag 4d2.*
864 .*$gdb_prompt $" { pass "system_constrol_tests" }
865 -re "$gdb_prompt $" { fail "system_control_tests" }
866 timeout { file "(timeout) system_control_tests" }
867 }
868
869 send_gdb "x/4i probe_tests\n"
870 gdb_expect {
871 -re "
872 .*prober \\(sr0,r5\\),r6,r7.*
873 .*proberi \\(sr0,r5\\),1,r7.*
874 .*probew \\(sr0,r5\\),r6,r7.*
875 .*probewi \\(sr0,r5\\),1,r7.*
876 .*$gdb_prompt $" { pass "probe_tests" }
877 -re "$gdb_prompt $" { fail "probe_tests" }
878 timeout { file "(timeout) probe_tests" }
879 }
880
881 # lci uses the same bit pattern as lha, so accept lha.
882 send_gdb "x/5i lpa_tests\n"
883 gdb_expect {
884 -re "
885 .*lpa r4\\(sr0,r5\\),r6.*
886 .*lpa,m r4\\(sr0,r5\\),r6.*
887 .*lha r4\\(sr0,r5\\),r6.*
888 .*lha,m r4\\(sr0,r5\\),r6.*
889 .*lha r4\\(sr0,r5\\),r6.*
890 .*$gdb_prompt $" { pass "lpa_tests" }
891 -re "$gdb_prompt $" { fail "lpa_tests" }
892 timeout { file "(timeout) lpa_tests" }
893 }
894
895 send_gdb "x/18i purge_tests\n"
896 gdb_expect {
897 -re "
898 .*pdtlb r4\\(sr0,r5\\).*
899 .*pdtlb,m r4\\(sr0,r5\\).*
900 .*pitlb r4\\(sr0,r5\\).*
901 .*pitlb,m r4\\(sr0,r5\\).*
902 .*pdtlbe r4\\(sr0,r5\\).*
903 .*pdtlbe,m r4\\(sr0,r5\\).*
904 .*pitlbe r4\\(sr0,r5\\).*
905 .*pitlbe,m r4\\(sr0,r5\\).*
906 .*pdc r4\\(sr0,r5\\).*
907 .*pdc,m r4\\(sr0,r5\\).*
908 .*fdc r4\\(sr0,r5\\).*
909 .*fdc,m r4\\(sr0,r5\\).*
910 .*fic r4\\(sr0,r5\\).*
911 .*fic,m r4\\(sr0,r5\\).*
912 .*fdce r4\\(sr0,r5\\).*
913 .*fdce,m r4\\(sr0,r5\\).*
914 .*fice r4\\(sr0,r5\\).*
915 .*fice,m r4\\(sr0,r5\\).*
916 .*$gdb_prompt $" { pass "purge_tests" }
917 -re "$gdb_prompt $" { fail "purge_tests" }
918 timeout { file "(timeout) purge_tests" }
919 }
920
921 send_gdb "x/4i insert_tests\n"
922 gdb_expect {
923 -re "
924 .*idtlba r4,\\(sr0,r5\\).*
925 .*iitlba r4,\\(sr0,r5\\).*
926 .*idtlbp r4,\\(sr0,r5\\).*
927 .*iitlbp r4,\\(sr0,r5\\).*
928 .*$gdb_prompt $" { pass "insert_tests" }
929 -re "$gdb_prompt $" { fail "insert_tests" }
930 timeout { file "(timeout) insert_tests" }
931 }
932
933 }
934
935 proc all_fpu_memory_tests { } {
936 global gdb_prompt
937 global hex
938 global decimal
939
940 send_gdb "x/20i fpu_memory_indexing_tests\n"
941 gdb_expect {
942 -re "
943 .*fldwx r4\\(sr0,r5\\),fr6.*
944 .*fldwx,s r4\\(sr0,r5\\),fr6.*
945 .*fldwx,m r4\\(sr0,r5\\),fr6.*
946 .*fldwx,sm r4\\(sr0,r5\\),fr6.*
947 .*flddx r4\\(sr0,r5\\),fr6.*
948 .*flddx,s r4\\(sr0,r5\\),fr6.*
949 .*flddx,m r4\\(sr0,r5\\),fr6.*
950 .*flddx,sm r4\\(sr0,r5\\),fr6.*
951 .*fstwx fr6,r4\\(sr0,r5\\).*
952 .*fstwx,s fr6,r4\\(sr0,r5\\).*
953 .*fstwx,m fr6,r4\\(sr0,r5\\).*
954 .*fstwx,sm fr6,r4\\(sr0,r5\\).*
955 .*fstdx fr6,r4\\(sr0,r5\\).*
956 .*fstdx,s fr6,r4\\(sr0,r5\\).*
957 .*fstdx,m fr6,r4\\(sr0,r5\\).*
958 .*fstdx,sm fr6,r4\\(sr0,r5\\).*
959 .*fstqx fr6,r4\\(sr0,r5\\).*
960 .*fstqx,s fr6,r4\\(sr0,r5\\).*
961 .*fstqx,m fr6,r4\\(sr0,r5\\).*
962 .*fstqx,sm fr6,r4\\(sr0,r5\\).*
963 .*$gdb_prompt $" { pass "fpu_memory_indexing_tests" }
964 -re "$gdb_prompt $" { fail "fpu_memory_indexing_tests" }
965 timeout { file "(timeout) fpu_memory_indexing_tests" }
966 }
967
968 send_gdb "x/15i fpu_short_memory_tests\n"
969 gdb_expect {
970 -re "
971 .*fldws 0\\(sr0,r5\\),fr6.*
972 .*fldws,mb 0\\(sr0,r5\\),fr6.*
973 .*fldws,ma 0\\(sr0,r5\\),fr6.*
974 .*fldds 0\\(sr0,r5\\),fr6.*
975 .*fldds,mb 0\\(sr0,r5\\),fr6.*
976 .*fldds,ma 0\\(sr0,r5\\),fr6.*
977 .*fstws fr6,0\\(sr0,r5\\).*
978 .*fstws,mb fr6,0\\(sr0,r5\\).*
979 .*fstws,ma fr6,0\\(sr0,r5\\).*
980 .*fstds fr6,0\\(sr0,r5\\).*
981 .*fstds,mb fr6,0\\(sr0,r5\\).*
982 .*fstds,ma fr6,0\\(sr0,r5\\).*
983 .*fstqs fr6,0\\(sr0,r5\\).*
984 .*fstqs,mb fr6,0\\(sr0,r5\\).*
985 .*fstqs,ma fr6,0\\(sr0,r5\\).*
986 .*$gdb_prompt $" { pass "fpu_short_memory_tests" }
987 -re "$gdb_prompt $" { fail "fpu_short_memory_tests" }
988 timeout { file "(timeout) fpu_short_memory_tests" }
989 }
990
991 }
992
993 proc all_fpu_computational_tests { } {
994 global gdb_prompt
995 global hex
996 global decimal
997
998 send_gdb "x/1i fpu_misc_tests\n"
999 gdb_expect {
1000 -re "
1001 .*ftest.*
1002 .*$gdb_prompt $" { pass "fpu_misc_tests" }
1003 -re "$gdb_prompt $" { fail "fpu_misc_tests" }
1004 timeout { file "(timeout) fpu_misc_tests" }
1005 }
1006
1007 set fpu_two_op_insns [list {fcpy} {fabs} {fsqrt} {frnd} ]
1008
1009 foreach i $fpu_two_op_insns {
1010 send_gdb "x/5i $i"; send_gdb "_tests\n"
1011 gdb_expect {
1012 -re "
1013 .*$i,sgl fr5,fr10.*
1014 .*$i,dbl fr5,fr10.*
1015 .*$i,quad fr5,fr10.*
1016 .*$i,sgl fr20,fr24.*
1017 .*$i,dbl fr20,fr24.*
1018 .*$gdb_prompt $" { pass "$i tests" }
1019 -re "$gdb_prompt $" { fail "$i tests" }
1020 timeout { fail "(timeout) $i tests" }
1021 }
1022 }
1023
1024 set fpu_conversions [list {fcnvff} {fcnvxf} {fcnvfx} {fcnvfxt} ]
1025
1026 foreach i $fpu_conversions {
1027 send_gdb "x/18i $i"; send_gdb "_tests\n"
1028 gdb_expect {
1029 -re "
1030 .*$i,sgl,sgl fr5,fr10.*
1031 .*$i,sgl,dbl fr5,fr10.*
1032 .*$i,sgl,quad fr5,fr10.*
1033 .*$i,dbl,sgl fr5,fr10.*
1034 .*$i,dbl,dbl fr5,fr10.*
1035 .*$i,dbl,quad fr5,fr10.*
1036 .*$i,quad,sgl fr5,fr10.*
1037 .*$i,quad,dbl fr5,fr10.*
1038 .*$i,quad,quad fr5,fr10.*
1039 .*$i,sgl,sgl fr20,fr24.*
1040 .*$i,sgl,dbl fr20,fr24.*
1041 .*$i,sgl,quad fr20,fr24.*
1042 .*$i,dbl,sgl fr20,fr24.*
1043 .*$i,dbl,dbl fr20,fr24.*
1044 .*$i,dbl,quad fr20,fr24.*
1045 .*$i,quad,sgl fr20,fr24.*
1046 .*$i,quad,dbl fr20,fr24.*
1047 .*$i,quad,quad fr20,fr24.*
1048 .*$gdb_prompt $" { pass "$i tests" }
1049 -re "$gdb_prompt $" { fail "$i tests" }
1050 timeout { fail "(timeout) $i tests" }
1051 }
1052 }
1053
1054 set fpu_three_op_insns [list {fadd} {fsub} {fmpy} {fdiv} {frem} ]
1055
1056 foreach i $fpu_three_op_insns {
1057 send_gdb "x/6i $i"; send_gdb "_tests\n"
1058 gdb_expect {
1059 -re "
1060 .*$i,sgl fr4,fr8,fr12.*
1061 .*$i,dbl fr4,fr8,fr12.*
1062 .*$i,quad fr4,fr8,fr12.*
1063 .*$i,sgl fr20,fr24,fr28.*
1064 .*$i,dbl fr20,fr24,fr28.*
1065 .*$i,quad fr20,fr24,fr28.*
1066 .*$gdb_prompt $" { pass "$i tests" }
1067 -re "$gdb_prompt $" { fail "$i tests" }
1068 timeout { fail "(timeout) $i tests" }
1069 }
1070 }
1071
1072 send_gdb "x/4i fmpy_addsub_tests\n"
1073 gdb_expect {
1074 -re "
1075 .*fmpyadd,sgl fr16,fr17,fr18,fr19,fr20.*
1076 .*fmpyadd,dbl fr16,fr17,fr18,fr19,fr20.*
1077 .*fmpysub,sgl fr16,fr17,fr18,fr19,fr20.*
1078 .*fmpysub,dbl fr16,fr17,fr18,fr19,fr20.*
1079 .*$gdb_prompt $" { pass "fmpy_addsub_tests" }
1080 -re "$gdb_prompt $" { fail "fmpy_addsub_tests" }
1081 timeout { fail "(timeout) fmpy_addsub_tests" }
1082 }
1083
1084 send_gdb "x/i xmpyu_tests\n"
1085 gdb_expect {
1086 -re "
1087 .*xmpyu fr4,fr5,fr6.*
1088 .*$gdb_prompt $" {pass "xmpyu_tests" }
1089 -re "$gdb_prompt $" {fail "xmpyu_tests" }
1090 timeout { fail "(timeout) xmpyu_tests" }
1091 }
1092
1093 }
1094
1095 proc all_fpu_comparison_tests { } {
1096 global gdb_prompt
1097 global hex
1098 global decimal
1099
1100 set fpu_comparison_formats [list {sgl} {dbl} {quad} ]
1101
1102 foreach i $fpu_comparison_formats {
1103 send_gdb "x/8i fcmp_$i"; send_gdb "_tests_1\n"
1104 gdb_expect {
1105 -re "
1106 .*fcmp,$i,false\\? fr4,fr5.*
1107 .*fcmp,$i,false fr4,fr5.*
1108 .*fcmp,$i,\\? fr4,fr5.*
1109 .*fcmp,$i,!<=> fr4,fr5.*
1110 .*fcmp,$i,= fr4,fr5.*
1111 .*fcmp,$i,=t fr4,fr5.*
1112 .*fcmp,$i,\\?= fr4,fr5.*
1113 .*fcmp,$i,!<> fr4,fr5.*
1114 .*$gdb_prompt $" { pass "$i tests (part1) " }
1115 -re "$gdb_prompt $" { fail "fcmp_$i tests (part1) " }
1116 timeout { fail "(timeout) fcmp_$i tests (part1) " }
1117 }
1118
1119 send_gdb "x/8i fcmp_$i"; send_gdb "_tests_2\n"
1120 gdb_expect {
1121 -re "
1122 .*fcmp,$i,!\\?>= fr4,fr5.*
1123 .*fcmp,$i,< fr4,fr5.*
1124 .*fcmp,$i,\\?< fr4,fr5.*
1125 .*fcmp,$i,!>= fr4,fr5.*
1126 .*fcmp,$i,!\\?> fr4,fr5.*
1127 .*fcmp,$i,<= fr4,fr5.*
1128 .*fcmp,$i,\\?<= fr4,fr5.*
1129 .*fcmp,$i,!> fr4,fr5.*
1130 .*$gdb_prompt $" { pass "$i tests (part2) " }
1131 -re "$gdb_prompt $" { fail "fcmp_$i tests (part2) " }
1132 timeout { fail "(timeout) fcmp_$i tests (part2) " }
1133 }
1134
1135 send_gdb "x/8i fcmp_$i"; send_gdb "_tests_3\n"
1136 gdb_expect {
1137 -re "
1138 .*fcmp,$i,!\\?<= fr4,fr5.*
1139 .*fcmp,$i,> fr4,fr5.*
1140 .*fcmp,$i,\\?> fr4,fr5.*
1141 .*fcmp,$i,!<= fr4,fr5.*
1142 .*fcmp,$i,!\\?< fr4,fr5.*
1143 .*fcmp,$i,>= fr4,fr5.*
1144 .*fcmp,$i,\\?>= fr4,fr5.*
1145 .*fcmp,$i,!< fr4,fr5.*
1146 .*$gdb_prompt $" { pass "$i tests (part3) " }
1147 -re "$gdb_prompt $" { fail "fcmp_$i tests (part3) " }
1148 timeout { fail "(timeout) fcmp_$i tests (part3) " }
1149 }
1150
1151 send_gdb "x/8i fcmp_$i"; send_gdb "_tests_4\n"
1152 gdb_expect {
1153 -re "
1154 .*fcmp,$i,!\\?= fr4,fr5.*
1155 .*fcmp,$i,<> fr4,fr5.*
1156 .*fcmp,$i,!= fr4,fr5.*
1157 .*fcmp,$i,!=t fr4,fr5.*
1158 .*fcmp,$i,!\\? fr4,fr5.*
1159 .*fcmp,$i,<=> fr4,fr5.*
1160 .*fcmp,$i,true\\? fr4,fr5.*
1161 .*fcmp,$i,true fr4,fr5.*
1162 .*$gdb_prompt $" { pass "$i tests (part4) " }
1163 -re "$gdb_prompt $" { fail "fcmp_$i tests (part4) " }
1164 timeout { fail "(timeout) fcmp_$i tests (part4) " }
1165 }
1166 }
1167 }
1168
1169 proc all_special_tests { } {
1170 global gdb_prompt
1171 global hex
1172 global decimal
1173
1174 send_gdb "x/4i special_tests\n"
1175 gdb_expect {
1176 -re "
1177 .*gfw r4\\(sr0,r5\\).*
1178 .*gfw,m r4\\(sr0,r5\\).*
1179 .*gfr r4\\(sr0,r5\\).*
1180 .*gfr,m r4\\(sr0,r5\\).*
1181 .*$gdb_prompt $" { pass "special tests" }
1182 -re "$gdb_prompt $" { fail "special tests" }
1183 timeout { fail "(timeout) special tests " }
1184 }
1185
1186 }
1187
1188 proc all_sfu_tests { } {
1189 global gdb_prompt
1190 global hex
1191 global decimal
1192
1193 send_gdb "x/16i sfu_tests\n"
1194 gdb_expect {
1195 -re "
1196 .*spop0,4,5.*
1197 .*spop0,4,73.*
1198 .*spop0,4,5,n.*
1199 .*spop0,4,73,n.*
1200 .*spop1,4,5 r5.*
1201 .*spop1,4,73 r5.*
1202 .*spop1,4,5,n r5.*
1203 .*spop1,4,73,n r5.*
1204 .*spop2,4,5 r5.*
1205 .*spop2,4,73 r5.*
1206 .*spop2,4,5,n r5.*
1207 .*spop2,4,73,n r5.*
1208 .*spop3,4,5 r5,r6.*
1209 .*spop3,4,73 r5,r6.*
1210 .*spop3,4,5,n r5,r6.*
1211 .*spop3,4,73,n r5,r6.*
1212 .*$gdb_prompt $" { pass "sfu tests" }
1213 -re "$gdb_prompt $" { fail "sfu tests" }
1214 timeout { fail "(timeout) sfu tests " }
1215 }
1216 }
1217
1218 proc all_copr_tests { } {
1219 global gdb_prompt
1220 global hex
1221 global decimal
1222
1223 send_gdb "x/4i copr_tests\n"
1224 gdb_expect {
1225 -re "
1226 .*copr,4,5.*
1227 .*copr,4,73.*
1228 .*copr,4,5,n.*
1229 .*copr,4,73,n.*
1230 .*$gdb_prompt $" { pass "copr tests" }
1231 -re "$gdb_prompt $" { fail "copr tests" }
1232 timeout { fail "(timeout) copr tests " }
1233 }
1234 }
1235
1236 proc all_copr_mem_tests { } {
1237 global gdb_prompt
1238 global hex
1239 global decimal
1240
1241 send_gdb "x/8i copr_indexing_load\n"
1242 gdb_expect {
1243 -re "
1244 .*cldwx,4 r5\\(sr0,r4\\),r26.*
1245 .*cldwx,4,s r5\\(sr0,r4\\),r26.*
1246 .*cldwx,4,m r5\\(sr0,r4\\),r26.*
1247 .*cldwx,4,sm r5\\(sr0,r4\\),r26.*
1248 .*clddx,4 r5\\(sr0,r4\\),r26.*
1249 .*clddx,4,s r5\\(sr0,r4\\),r26.*
1250 .*clddx,4,m r5\\(sr0,r4\\),r26.*
1251 .*clddx,4,sm r5\\(sr0,r4\\),r26.*
1252 .*$gdb_prompt $" { pass "copr indexed load tests" }
1253 -re "$gdb_prompt $" { fail "copr indexed load tests" }
1254 timeout { fail "(timeout) copr indexed load tests " }
1255 }
1256
1257 send_gdb "x/8i copr_indexing_store\n"
1258 gdb_expect {
1259 -re "
1260 .*cstwx,4 r26,r5\\(sr0,r4\\).*
1261 .*cstwx,4,s r26,r5\\(sr0,r4\\).*
1262 .*cstwx,4,m r26,r5\\(sr0,r4\\).*
1263 .*cstwx,4,sm r26,r5\\(sr0,r4\\).*
1264 .*cstdx,4 r26,r5\\(sr0,r4\\).*
1265 .*cstdx,4,s r26,r5\\(sr0,r4\\).*
1266 .*cstdx,4,m r26,r5\\(sr0,r4\\).*
1267 .*cstdx,4,sm r26,r5\\(sr0,r4\\).*
1268 .*$gdb_prompt $" { pass "copr indexed store tests" }
1269 -re "$gdb_prompt $" { fail "copr indexed store tests" }
1270 timeout { fail "(timeout) copr indexed load tests " }
1271 }
1272
1273 send_gdb "x/12i copr_short_memory\n"
1274 gdb_expect {
1275 -re "
1276 .*cldws,4 0\\(sr0,r4\\),r26.*
1277 .*cldws,4,mb 0\\(sr0,r4\\),r26.*
1278 .*cldws,4,ma 0\\(sr0,r4\\),r26.*
1279 .*cldds,4 0\\(sr0,r4\\),r26.*
1280 .*cldds,4,mb 0\\(sr0,r4\\),r26.*
1281 .*cldds,4,ma 0\\(sr0,r4\\),r26.*
1282 .*cstws,4 r26,0\\(sr0,r4\\).*
1283 .*cstws,4,mb r26,0\\(sr0,r4\\).*
1284 .*cstws,4,ma r26,0\\(sr0,r4\\).*
1285 .*cstds,4 r26,0\\(sr0,r4\\).*
1286 .*cstds,4,mb r26,0\\(sr0,r4\\).*
1287 .*cstds,4,ma r26,0\\(sr0,r4\\).*
1288 .*$gdb_prompt $" { pass "copr short memory tests" }
1289 -re "$gdb_prompt $" { fail "copr short memory tests" }
1290 timeout { fail "(timeout) copr short memory tests " }
1291 }
1292 }
1293
1294 proc fmemLRbug_tests { } {
1295 global gdb_prompt
1296 global hex
1297 global decimal
1298
1299 send_gdb "x/12i fmemLRbug_tests_1\n"
1300 gdb_expect {
1301 -re "
1302 .*fstws fr6R,0\\(sr0,r26\\).*
1303 .*fstws fr6,4\\(sr0,r26\\).*
1304 .*fstws fr6,8\\(sr0,r26\\).*
1305 .*fstds fr6,0\\(sr0,r26\\).*
1306 .*fstds fr6,4\\(sr0,r26\\).*
1307 .*fstds fr6,8\\(sr0,r26\\).*
1308 .*fldws 0\\(sr0,r26\\),fr6R.*
1309 .*fldws 4\\(sr0,r26\\),fr6.*
1310 .*fldws 8\\(sr0,r26\\),fr6.*
1311 .*fldds 0\\(sr0,r26\\),fr6.*
1312 .*fldds 4\\(sr0,r26\\),fr6.*
1313 .*fldds 8\\(sr0,r26\\),fr6.*
1314 .*$gdb_prompt $" { pass "fmem LR register selector tests (part1)" }
1315 -re "$gdb_prompt $" { fail "fmem LR register selector tests (part1)" }
1316 timeout { fail "(timeout) fmem LR register selector tests (part1)" }
1317 }
1318
1319 send_gdb "x/12i fmemLRbug_tests_2\n"
1320 gdb_expect {
1321 -re "
1322 .*fstws fr6R,0\\(sr0,r26\\).*
1323 .*fstws fr6,4\\(sr0,r26\\).*
1324 .*fstws fr6,8\\(sr0,r26\\).*
1325 .*fstds fr6,0\\(sr0,r26\\).*
1326 .*fstds fr6,4\\(sr0,r26\\).*
1327 .*fstds fr6,8\\(sr0,r26\\).*
1328 .*fldws 0\\(sr0,r26\\),fr6R.*
1329 .*fldws 4\\(sr0,r26\\),fr6.*
1330 .*fldws 8\\(sr0,r26\\),fr6.*
1331 .*fldds 0\\(sr0,r26\\),fr6.*
1332 .*fldds 4\\(sr0,r26\\),fr6.*
1333 .*fldds 8\\(sr0,r26\\),fr6.*
1334 .*$gdb_prompt $" { pass "fmem LR register selector tests (part2)" }
1335 -re "$gdb_prompt $" { fail "fmem LR register selector tests (part2)" }
1336 timeout { fail "(timeout) fmem LR register selector tests (part2)" }
1337 }
1338
1339 send_gdb "x/12i fmemLRbug_tests_3\n"
1340 gdb_expect {
1341 -re "
1342 .*fstwx fr6R,r25\\(sr0,r26\\).*
1343 .*fstwx fr6,r25\\(sr0,r26\\).*
1344 .*fstwx fr6,r25\\(sr0,r26\\).*
1345 .*fstdx fr6,r25\\(sr0,r26\\).*
1346 .*fstdx fr6,r25\\(sr0,r26\\).*
1347 .*fstdx fr6,r25\\(sr0,r26\\).*
1348 .*fldwx r25\\(sr0,r26\\),fr6R.*
1349 .*fldwx r25\\(sr0,r26\\),fr6.*
1350 .*fldwx r25\\(sr0,r26\\),fr6.*
1351 .*flddx r25\\(sr0,r26\\),fr6.*
1352 .*flddx r25\\(sr0,r26\\),fr6.*
1353 .*flddx r25\\(sr0,r26\\),fr6.*
1354 .*$gdb_prompt $" { pass "fmem LR register selector tests (part3)" }
1355 -re "$gdb_prompt $" { fail "fmem LR register selector tests (part3)" }
1356 timeout { fail "(timeout) fmem LR register selector tests (part3)" }
1357 }
1358
1359 send_gdb "x/12i fmemLRbug_tests_4\n"
1360 gdb_expect {
1361 -re "
1362 .*fstwx fr6R,r25\\(sr0,r26\\).*
1363 .*fstwx fr6,r25\\(sr0,r26\\).*
1364 .*fstwx fr6,r25\\(sr0,r26\\).*
1365 .*fstdx fr6,r25\\(sr0,r26\\).*
1366 .*fstdx fr6,r25\\(sr0,r26\\).*
1367 .*fstdx fr6,r25\\(sr0,r26\\).*
1368 .*fldwx r25\\(sr0,r26\\),fr6R.*
1369 .*fldwx r25\\(sr0,r26\\),fr6.*
1370 .*fldwx r25\\(sr0,r26\\),fr6.*
1371 .*flddx r25\\(sr0,r26\\),fr6.*
1372 .*flddx r25\\(sr0,r26\\),fr6.*
1373 .*flddx r25\\(sr0,r26\\),fr6.*
1374 .*$gdb_prompt $" { pass "fmem LR register selector tests (part4)" }
1375 -re "$gdb_prompt $" { fail "fmem LR register selector tests (part4)" }
1376 timeout { fail "(timeout) fmem LR register selector tests (part4)" }
1377 }
1378 }
1379
1380 # Start with a fresh gdb.
1381
1382 gdb_exit
1383 gdb_start
1384 gdb_reinitialize_dir $srcdir/$subdir
1385 gdb_load $binfile
1386
1387 all_integer_memory_tests
1388 all_immediate_tests
1389 all_branch_tests
1390 all_integer_computational_tests
1391 all_system_control_tests
1392 all_fpu_memory_tests
1393 all_fpu_computational_tests
1394 all_fpu_comparison_tests
1395 all_special_tests
1396 all_sfu_tests
1397 all_copr_tests
1398 all_copr_mem_tests
1399
1400 # Regression test for a bug Tege found.
1401 fmemLRbug_tests
This page took 0.05807 seconds and 5 git commands to generate.