]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.disasm/am33.exp
Copyright updates for 2007.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.disasm / am33.exp
1
2 # Copyright 1997, 1998, 2007 Free Software Foundation, Inc.
3
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
18 # Please email any bugs, comments, and/or additions to this file to:
19 # bug-gdb@prep.ai.mit.edu
20
21 # This file was written by Jeff Law. (law@cygnus.com)
22
23 if $tracelevel then {
24 strace $tracelevel
25 }
26
27 if ![istarget "mn10300*-*-*"] {
28 verbose "Tests ignored for all but mn10300 based targets."
29 return
30 }
31
32 global exec_output
33 set prms_id 0
34 set bug_id 0
35
36 set testfile "am33"
37 set srcfile ${srcdir}/${subdir}/${testfile}.s
38 set binfile ${objdir}/${subdir}/${testfile}
39 if { [gdb_compile "${srcfile}" "${binfile}" object ""] != "" } {
40 untested am33.exp
41 return -1
42 }
43
44 proc call_tests { } {
45 global gdb_prompt
46 global hex
47 global decimal
48
49 send_gdb "x/8i call_tests\n"
50 gdb_expect {
51 -re "
52 .*call .*,.a2,a3,exreg0.,9.*
53 .*call .*,.a2,a3,exreg1.,9.*
54 .*call .*,.a2,a3,exother.,9.*
55 .*call .*,.d2,d3,a2,a3,other,exreg0,exreg1,exother.,9.*
56 .*call .*,.a2,a3,exreg0.,9.*
57 .*call .*,.a2,a3,exreg1.,9.*
58 .*call .*,.a2,a3,exother.,9.*
59 .*call .*,.d2,d3,a2,a3,other,exreg0,exreg1,exother.,9.*
60 .*$gdb_prompt $" { pass "call tests" }
61 -re "$gdb_prompt $" { fail "call tests" }
62 timeout { fail "(timeout) call tests" }
63 }
64 }
65
66 proc movm_tests { } {
67 global gdb_prompt
68 global hex
69 global decimal
70
71 send_gdb "x/16i movm_tests\n"
72 gdb_expect {
73 -re "
74 .*movm \\(sp\\),.a2,a3,exreg0.*
75 .*movm \\(sp\\),.a2,a3,exreg1.*
76 .*movm \\(sp\\),.a2,a3,exother.*
77 .*movm \\(sp\\),.d2,d3,a2,a3,other,exreg0,exreg1,exother.*
78 .*movm .a2,a3,exreg0.,\\(sp\\).*
79 .*movm .a2,a3,exreg1.,\\(sp\\).*
80 .*movm .a2,a3,exother.,\\(sp\\).*
81 .*movm .d2,d3,a2,a3,other,exreg0,exreg1,exother.,\\(sp\\).*
82 .*movm \\(usp\\),.a2,a3,exreg0.*
83 .*movm \\(usp\\),.a2,a3,exreg1.*
84 .*movm \\(usp\\),.a2,a3,exother.*
85 .*movm \\(usp\\),.d2,d3,a2,a3,other,exreg0,exreg1,exother.*
86 .*movm .a2,a3,exreg0.,\\(usp\\).*
87 .*movm .a2,a3,exreg1.,\\(usp\\).*
88 .*movm .a2,a3,exother.,\\(usp\\).*
89 .*movm .d2,d3,a2,a3,other,exreg0,exreg1,exother.,\\(usp\\).*
90 .*$gdb_prompt $" { pass "movm tests" }
91 -re "$gdb_prompt $" { fail "movm tests" }
92 timeout { fail "(timeout) movm tests" }
93 }
94 }
95
96 proc misc_tests { } {
97 global gdb_prompt
98 global hex
99 global decimal
100
101 send_gdb "x/11i misc_tests\n"
102 gdb_expect {
103 -re "
104 .*syscall 4.*
105 .*mcst9 d0.*
106 .*mcst48 d1.*
107 .*getchx d0.*
108 .*getclx d1.*
109 .*clr a1.*
110 .*sat16 a1,a0.*
111 .*mcste r7,r6.*
112 .*swap r5,r4.*
113 .*swaph r3,r2.*
114 .*swhw r1,r0.*
115 .*$gdb_prompt $" { pass "misc tests" }
116 -re "$gdb_prompt $" { fail "misc tests" }
117 timeout { fail "(timeout) misc tests" }
118 }
119 }
120
121 proc mov_tests { } {
122 global gdb_prompt
123 global hex
124 global decimal
125
126 send_gdb "x/45i mov_tests\n"
127 gdb_expect {
128 -re "
129 .*mov r0,r1.*
130 .*mov sp,r1.*
131 .*mov r1,xr2.*
132 .*mov \\(r1\\),r2.*
133 .*mov r3,\\(r4\\).*
134 .*mov \\(sp\\),r5.*
135 .*mov r6,\\(sp\\).*
136 .*mov 16,r1.*
137 .*mov 16,xr1.*
138 .*mov \\(16,r1\\),r2.*
139 .*mov r2,\\(16,r1\\).*
140 .*mov \\(16,sp\\),r2.*
141 .*mov r2,\\(16,sp\\).*
142 .*mov 2096895,r2.*
143 .*mov 2096895,xr2.*
144 .*mov \\(2096895,r1\\),r2.*
145 .*mov r2,\\(2096895,r1\\).*
146 .*mov \\(2096895,sp\\),r2.*
147 .*mov r2,\\(2096895,sp\\).*
148 .*mov \\(0x1ffeff\\),r2.*
149 .*mov r2,\\(0x1ffeff\\).*
150 .*mov 2147417596,r2.*
151 .*mov 2147417596,xr2.*
152 .*mov \\(2147417596,r1\\),r2.*
153 .*mov r2,\\(2147417596,r1\\).*
154 .*mov \\(2147417596,sp\\),r2.*
155 .*mov r2,\\(2147417596,sp\\).*
156 .*mov \\(0x7ffefdfc\\),r2.*
157 .*mov r2,\\(0x7ffefdfc\\).*
158 .*movu 16,r1.*
159 .*movu 2096895,r2.*
160 .*movu 2147417596,r2.*
161 .*mov usp,a0.*
162 .*mov ssp,a1.*
163 .*mov msp,a2.*
164 .*mov pc,a3.*
165 .*mov a0,usp.*
166 .*mov a1,ssp.*
167 .*mov a2,msp.*
168 .*mov epsw,d0.*
169 .*mov d1,epsw.*
170 .*mov a0,r1.*
171 .*mov d2,r3.*
172 .*mov r5,a1.*
173 .*mov r7,d3.*
174 .*$gdb_prompt $" { pass "mov tests" }
175 -re "$gdb_prompt $" { fail "mov tests" }
176 timeout { fail "(timeout) mov tests" }
177 }
178 }
179
180 proc ext_tests { } {
181 global gdb_prompt
182 global hex
183 global decimal
184
185 send_gdb "x/5i ext_tests\n"
186 gdb_expect {
187 -re "
188 .*ext r2.*
189 .*extb r3,r4.*
190 .*extbu r4,r5.*
191 .*exth r6,r7.*
192 .*exthu r7,a0.*
193 .*$gdb_prompt $" { pass "ext tests" }
194 -re "$gdb_prompt $" { fail "ext tests" }
195 timeout { fail "(timeout) ext tests" }
196 }
197 }
198
199 proc add_tests { } {
200 global gdb_prompt
201 global hex
202 global decimal
203
204 send_gdb "x/11i add_tests\n"
205 gdb_expect {
206 -re "
207 .*add a2,a3.*
208 .*add 16,r1.*
209 .*add 2096895,r2.*
210 .*add 2147417596,r2.*
211 .*add r1,r2,r3.*
212 .*addc d0,d1.*
213 .*addc 16,r1.*
214 .*addc 2096895,r2.*
215 .*addc 2147417596,r2.*
216 .*inc d1.*
217 .*inc4 d0.*
218 .*$gdb_prompt $" { pass "add tests" }
219 -re "$gdb_prompt $" { fail "add tests" }
220 timeout { fail "(timeout) add tests" }
221 }
222 }
223
224 proc sub_tests { } {
225 global gdb_prompt
226 global hex
227 global decimal
228
229 send_gdb "x/8i sub_tests\n"
230 gdb_expect {
231 -re "
232 .*sub d2,d3.*
233 .*sub 16,r1.*
234 .*sub 2096895,r2.*
235 .*sub 2147417596,r2.*
236 .*subc d3,d2.*
237 .*subc 16,r1.*
238 .*subc 2096895,r2.*
239 .*subc 2147417596,r2.*
240 .*$gdb_prompt $" { pass "sub tests" }
241 -re "$gdb_prompt $" { fail "sub tests" }
242 timeout { fail "(timeout) sub tests" }
243 }
244 }
245
246 proc cmp_tests { } {
247 global gdb_prompt
248 global hex
249 global decimal
250
251 send_gdb "x/4i cmp_tests\n"
252 gdb_expect {
253 -re "
254 .*cmp a3,a2.*
255 .*cmp 16,r1.*
256 .*cmp 2096895,r2.*
257 .*cmp 2147417596,r2.*
258 .*$gdb_prompt $" { pass "cmp tests" }
259 -re "$gdb_prompt $" { fail "cmp tests" }
260 timeout { fail "(timeout) cmp tests" }
261 }
262 }
263
264 proc logical_tests { } {
265 global gdb_prompt
266 global hex
267 global decimal
268
269 send_gdb "x/15i logical_tests\n"
270 gdb_expect {
271 -re "
272 .*and r0,r1.*
273 .*or r2,r3.*
274 .*xor r4,r5.*
275 .*not r6.*
276 .*and 16,r1.*
277 .*or 16,r1.*
278 .*xor 16,r1.*
279 .*and 2096895,r2.*
280 .*or 2096895,r2.*
281 .*xor 2096895,r2.*
282 .*and 2147417596,r2.*
283 .*or 2147417596,r2.*
284 .*xor 2147417596,r2.*
285 .*and 131072,epsw.*
286 .*or 65535,epsw.*
287 .*$gdb_prompt $" { pass "logical tests" }
288 -re "$gdb_prompt $" { fail "logical tests" }
289 timeout { fail "(timeout) logical tests" }
290 }
291 }
292
293 proc shift_tests { } {
294 global gdb_prompt
295 global hex
296 global decimal
297
298 send_gdb "x/15i shift_tests\n"
299 gdb_expect {
300 -re "
301 .*asr r7,a0.*
302 .*lsr a1,a2.*
303 .*asl a3,d0.*
304 .*asl2 d1.*
305 .*ror d2.*
306 .*rol d3.*
307 .*asr 16,r1.*
308 .*lsr 16,r1.*
309 .*asl 16,r1.*
310 .*asr 2096895,r2.*
311 .*lsr 2096895,r2.*
312 .*asl 2096895,r2.*
313 .*asr 2147417596,r2.*
314 .*lsr 2147417596,r2.*
315 .*asl 2147417596,r2.*
316 .*$gdb_prompt $" { pass "shift tests" }
317 -re "$gdb_prompt $" { fail "shift tests" }
318 timeout { fail "(timeout) shift tests" }
319 }
320 }
321
322 proc muldiv_tests { } {
323 global gdb_prompt
324 global hex
325 global decimal
326
327 send_gdb "x/16i muldiv_tests\n"
328 gdb_expect {
329 -re "
330 .*mul r1,r2.*
331 .*mulu r3,r4.*
332 .*mul 16,r1.*
333 .*mulu 16,r1.*
334 .*mul 2096895,r2.*
335 .*mulu 2096895,r2.*
336 .*mul 2147417596,r2.*
337 .*mulu 2147417596,r2.*
338 .*div r5,r6.*
339 .*divu r7,a0.*
340 .*dmulh d1,d0.*
341 .*dmulhu a3,a2.*
342 .*dmulh 2147417596,r2.*
343 .*dmulhu 2147417596,r2.*
344 .*mul r1,r2,r3,r4.*
345 .*mulu r1,r2,r3,r4.*
346 .*$gdb_prompt $" { pass "muldiv tests" }
347 -re "$gdb_prompt $" { fail "muldiv tests" }
348 timeout { fail "(timeout) muldiv tests" }
349 }
350 }
351
352 proc movbu_tests { } {
353 global gdb_prompt
354 global hex
355 global decimal
356
357 send_gdb "x/20i movbu_tests\n"
358 gdb_expect {
359 -re "
360 .*movbu \\(r5\\),r6.*
361 .*movbu r7,\\(a0\\).*
362 .*movbu \\(sp\\),r7.*
363 .*movbu a0,\\(sp\\).*
364 .*movbu \\(16,r1\\),r2.*
365 .*movbu r2,\\(16,r1\\).*
366 .*movbu \\(16,sp\\),r2.*
367 .*movbu r2,\\(16,sp\\).*
368 .*movbu \\(2096895,r1\\),r2.*
369 .*movbu r2,\\(2096895,r1\\).*
370 .*movbu \\(2096895,sp\\),r2.*
371 .*movbu r2,\\(2096895,sp\\).*
372 .*movbu \\(0x1ffeff\\),r2.*
373 .*movbu r2,\\(0x1ffeff\\).*
374 .*movbu \\(2147417596,r1\\),r2.*
375 .*movbu r2,\\(2147417596,r1\\).*
376 .*movbu \\(2147417596,sp\\),r2.*
377 .*movbu r2,\\(2147417596,sp\\).*
378 .*movbu \\(0x7ffefdfc\\),r2.*
379 .*movbu r2,\\(0x7ffefdfc\\).*
380 .*$gdb_prompt $" { pass "movbu tests" }
381 -re "$gdb_prompt $" { fail "movbu tests" }
382 timeout { fail "(timeout) movbu tests" }
383 }
384 }
385
386 proc movhu_tests { } {
387 global gdb_prompt
388 global hex
389 global decimal
390
391 send_gdb "x/20i movhu_tests\n"
392 gdb_expect {
393 -re "
394 .*movhu \\(a1\\),a2.*
395 .*movhu a3,\\(d0\\).*
396 .*movhu \\(sp\\),a1.*
397 .*movhu a2,\\(sp\\).*
398 .*movhu \\(16,r1\\),r2.*
399 .*movhu r2,\\(16,r1\\).*
400 .*movhu \\(16,sp\\),r2.*
401 .*movhu r2,\\(16,sp\\).*
402 .*movhu \\(2096895,r1\\),r2.*
403 .*movhu r2,\\(2096895,r1\\).*
404 .*movhu \\(2096895,sp\\),r2.*
405 .*movhu r2,\\(2096895,sp\\).*
406 .*movhu \\(0x1ffeff\\),r2.*
407 .*movhu r2,\\(0x1ffeff\\).*
408 .*movhu \\(2147417596,r1\\),r2.*
409 .*movhu r2,\\(2147417596,r1\\).*
410 .*movhu \\(2147417596,sp\\),r2.*
411 .*movhu r2,\\(2147417596,sp\\).*
412 .*movhu \\(0x7ffefdfc\\),r2.*
413 .*movhu r2,\\(0x7ffefdfc\\).*
414 .*$gdb_prompt $" { pass "movhu tests" }
415 -re "$gdb_prompt $" { fail "movhu tests" }
416 timeout { fail "(timeout) movhu tests" }
417 }
418 }
419
420 proc mac_tests { } {
421 global gdb_prompt
422 global hex
423 global decimal
424
425 send_gdb "x/28i mac_tests\n"
426 gdb_expect {
427 -re "
428 .*mac r1,r2.*
429 .*macu r3,r4.*
430 .*macb r5,r6.*
431 .*macbu r7,a0.*
432 .*mach a1,a2.*
433 .*machu a3,d0.*
434 .*dmach d1,d2.*
435 .*dmachu d3,d2.*
436 .*mac 16,r1.*
437 .*macu 16,r1.*
438 .*macb 16,r1.*
439 .*macbu 16,r1.*
440 .*mach 16,r1.*
441 .*machu 16,r1.*
442 .*mac 2096895,r2.*
443 .*macu 2096895,r2.*
444 .*macb 2096895,r2.*
445 .*macbu 2096895,r2.*
446 .*mach 2096895,r2.*
447 .*machu 2096895,r2.*
448 .*mac 2147417596,r2.*
449 .*macu 2147417596,r2.*
450 .*macb 2147417596,r2.*
451 .*macbu 2147417596,r2.*
452 .*mach 2147417596,r2.*
453 .*machu 2147417596,r2.*
454 .*dmach 2147417596,r2.*
455 .*dmachu 2147417596,r2.*
456 .*$gdb_prompt $" { pass "mac tests" }
457 -re "$gdb_prompt $" { fail "mac tests" }
458 timeout { fail "(timeout) mac tests" }
459 }
460 }
461
462 proc bit_tests { } {
463 global gdb_prompt
464 global hex
465 global decimal
466
467 send_gdb "x/4i bit_tests\n"
468 gdb_expect {
469 -re "
470 .*bsch r1,r2.*
471 .*btst 16,r1.*
472 .*btst 2096895,r2.*
473 .*btst 2147417596,r2.*
474 .*$gdb_prompt $" { pass "bit tests" }
475 -re "$gdb_prompt $" { fail "bit tests" }
476 timeout { fail "(timeout) bit tests" }
477 }
478 }
479
480 proc dsp_add_tests { } {
481 global gdb_prompt
482 global hex
483 global decimal
484
485 send_gdb "x/28i dsp_add_tests\n"
486 gdb_expect {
487 -re "
488 .*add_add r4,r1,r2,r3.*
489 .*add_add r4,r1,2,r3.*
490 .*add_sub r4,r1,r2,r3.*
491 .*add_sub r4,r1,2,r3.*
492 .*add_cmp r4,r1,r2,r3.*
493 .*add_cmp r4,r1,2,r3.*
494 .*add_mov r4,r1,r2,r3.*
495 .*add_mov r4,r1,2,r3.*
496 .*add_asr r4,r1,r2,r3.*
497 .*add_asr r4,r1,2,r3.*
498 .*add_lsr r4,r1,r2,r3.*
499 .*add_lsr r4,r1,2,r3.*
500 .*add_asl r4,r1,r2,r3.*
501 .*add_asl r4,r1,2,r3.*
502 .*add_add 4,r1,r2,r3.*
503 .*add_add 4,r1,2,r3.*
504 .*add_sub 4,r1,r2,r3.*
505 .*add_sub 4,r1,2,r3.*
506 .*add_cmp 4,r1,r2,r3.*
507 .*add_cmp 4,r1,2,r3.*
508 .*add_mov 4,r1,r2,r3.*
509 .*add_mov 4,r1,2,r3.*
510 .*add_asr 4,r1,r2,r3.*
511 .*add_asr 4,r1,2,r3.*
512 .*add_lsr 4,r1,r2,r3.*
513 .*add_lsr 4,r1,2,r3.*
514 .*add_asl 4,r1,r2,r3.*
515 .*add_asl 4,r1,2,r3.*
516 .*$gdb_prompt $" { pass "dsp_add tests" }
517 -re "$gdb_prompt $" { fail "dsp_add tests" }
518 timeout { fail "(timeout) dsp_add tests" }
519 }
520 }
521
522 proc dsp_cmp_tests { } {
523 global gdb_prompt
524 global hex
525 global decimal
526
527 send_gdb "x/24i dsp_cmp_tests\n"
528 gdb_expect {
529 -re "
530 .*cmp_add r4,r1,r2,r3.*
531 .*cmp_add r4,r1,2,r3.*
532 .*cmp_sub r4,r1,r2,r3.*
533 .*cmp_sub r4,r1,2,r3.*
534 .*cmp_mov r4,r1,r2,r3.*
535 .*cmp_mov r4,r1,2,r3.*
536 .*cmp_asr r4,r1,r2,r3.*
537 .*cmp_asr r4,r1,2,r3.*
538 .*cmp_lsr r4,r1,r2,r3.*
539 .*cmp_lsr r4,r1,2,r3.*
540 .*cmp_asl r4,r1,r2,r3.*
541 .*cmp_asl r4,r1,2,r3.*
542 .*cmp_add 4,r1,r2,r3.*
543 .*cmp_add 4,r1,2,r3.*
544 .*cmp_sub 4,r1,r2,r3.*
545 .*cmp_sub 4,r1,2,r3.*
546 .*cmp_mov 4,r1,r2,r3.*
547 .*cmp_mov 4,r1,2,r3.*
548 .*cmp_asr 4,r1,r2,r3.*
549 .*cmp_asr 4,r1,2,r3.*
550 .*cmp_lsr 4,r1,r2,r3.*
551 .*cmp_lsr 4,r1,2,r3.*
552 .*cmp_asl 4,r1,r2,r3.*
553 .*cmp_asl 4,r1,2,r3.*
554 .*$gdb_prompt $" { pass "dsp_cmp tests" }
555 -re "$gdb_prompt $" { fail "dsp_cmp tests" }
556 timeout { fail "(timeout) dsp_cmp tests" }
557 }
558 }
559
560 proc dsp_sub_tests { } {
561 global gdb_prompt
562 global hex
563 global decimal
564
565 send_gdb "x/28i dsp_sub_tests\n"
566 gdb_expect {
567 -re "
568 .*sub_add r4,r1,r2,r3.*
569 .*sub_add r4,r1,2,r3.*
570 .*sub_sub r4,r1,r2,r3.*
571 .*sub_sub r4,r1,2,r3.*
572 .*sub_cmp r4,r1,r2,r3.*
573 .*sub_cmp r4,r1,2,r3.*
574 .*sub_mov r4,r1,r2,r3.*
575 .*sub_mov r4,r1,2,r3.*
576 .*sub_asr r4,r1,r2,r3.*
577 .*sub_asr r4,r1,2,r3.*
578 .*sub_lsr r4,r1,r2,r3.*
579 .*sub_lsr r4,r1,2,r3.*
580 .*sub_asl r4,r1,r2,r3.*
581 .*sub_asl r4,r1,2,r3.*
582 .*sub_add 4,r1,r2,r3.*
583 .*sub_add 4,r1,2,r3.*
584 .*sub_sub 4,r1,r2,r3.*
585 .*sub_sub 4,r1,2,r3.*
586 .*sub_cmp 4,r1,r2,r3.*
587 .*sub_cmp 4,r1,2,r3.*
588 .*sub_mov 4,r1,r2,r3.*
589 .*sub_mov 4,r1,2,r3.*
590 .*sub_asr 4,r1,r2,r3.*
591 .*sub_asr 4,r1,2,r3.*
592 .*sub_lsr 4,r1,r2,r3.*
593 .*sub_lsr 4,r1,2,r3.*
594 .*sub_asl 4,r1,r2,r3.*
595 .*sub_asl 4,r1,2,r3.*
596 .*$gdb_prompt $" { pass "dsp_sub tests" }
597 -re "$gdb_prompt $" { fail "dsp_sub tests" }
598 timeout { fail "(timeout) dsp_sub tests" }
599 }
600 }
601
602 proc dsp_mov_tests { } {
603 global gdb_prompt
604 global hex
605 global decimal
606
607 send_gdb "x/28i dsp_mov_tests\n"
608 gdb_expect {
609 -re "
610 .*mov_add r4,r1,r2,r3.*
611 .*mov_add r4,r1,2,r3.*
612 .*mov_sub r4,r1,r2,r3.*
613 .*mov_sub r4,r1,2,r3.*
614 .*mov_cmp r4,r1,r2,r3.*
615 .*mov_cmp r4,r1,2,r3.*
616 .*mov_mov r4,r1,r2,r3.*
617 .*mov_mov r4,r1,2,r3.*
618 .*mov_asr r4,r1,r2,r3.*
619 .*mov_asr r4,r1,2,r3.*
620 .*mov_lsr r4,r1,r2,r3.*
621 .*mov_lsr r4,r1,2,r3.*
622 .*mov_asl r4,r1,r2,r3.*
623 .*mov_asl r4,r1,2,r3.*
624 .*mov_add 4,r1,r2,r3.*
625 .*mov_add 4,r1,2,r3.*
626 .*mov_sub 4,r1,r2,r3.*
627 .*mov_sub 4,r1,2,r3.*
628 .*mov_cmp 4,r1,r2,r3.*
629 .*mov_cmp 4,r1,2,r3.*
630 .*mov_mov 4,r1,r2,r3.*
631 .*mov_mov 4,r1,2,r3.*
632 .*mov_asr 4,r1,r2,r3.*
633 .*mov_asr 4,r1,2,r3.*
634 .*mov_lsr 4,r1,r2,r3.*
635 .*mov_lsr 4,r1,2,r3.*
636 .*mov_asl 4,r1,r2,r3.*
637 .*mov_asl 4,r1,2,r3.*
638 .*$gdb_prompt $" { pass "dsp_mov tests" }
639 -re "$gdb_prompt $" { fail "dsp_mov tests" }
640 timeout { fail "(timeout) dsp_mov tests" }
641 }
642 }
643
644 proc dsp_logical_tests { } {
645 global gdb_prompt
646 global hex
647 global decimal
648
649 send_gdb "x/42i dsp_logical_tests\n"
650 gdb_expect {
651 -re "
652 .*and_add r4,r1,r2,r3.*
653 .*and_add r4,r1,2,r3.*
654 .*and_sub r4,r1,r2,r3.*
655 .*and_sub r4,r1,2,r3.*
656 .*and_cmp r4,r1,r2,r3.*
657 .*and_cmp r4,r1,2,r3.*
658 .*and_mov r4,r1,r2,r3.*
659 .*and_mov r4,r1,2,r3.*
660 .*and_asr r4,r1,r2,r3.*
661 .*and_asr r4,r1,2,r3.*
662 .*and_lsr r4,r1,r2,r3.*
663 .*and_lsr r4,r1,2,r3.*
664 .*and_asl r4,r1,r2,r3.*
665 .*and_asl r4,r1,2,r3.*
666 .*xor_add r4,r1,r2,r3.*
667 .*xor_add r4,r1,2,r3.*
668 .*xor_sub r4,r1,r2,r3.*
669 .*xor_sub r4,r1,2,r3.*
670 .*xor_cmp r4,r1,r2,r3.*
671 .*xor_cmp r4,r1,2,r3.*
672 .*xor_mov r4,r1,r2,r3.*
673 .*xor_mov r4,r1,2,r3.*
674 .*xor_asr r4,r1,r2,r3.*
675 .*xor_asr r4,r1,2,r3.*
676 .*xor_lsr r4,r1,r2,r3.*
677 .*xor_lsr r4,r1,2,r3.*
678 .*xor_asl r4,r1,r2,r3.*
679 .*xor_asl r4,r1,2,r3.*
680 .*or_add r4,r1,r2,r3.*
681 .*or_add r4,r1,2,r3.*
682 .*or_sub r4,r1,r2,r3.*
683 .*or_sub r4,r1,2,r3.*
684 .*or_cmp r4,r1,r2,r3.*
685 .*or_cmp r4,r1,2,r3.*
686 .*or_mov r4,r1,r2,r3.*
687 .*or_mov r4,r1,2,r3.*
688 .*or_asr r4,r1,r2,r3.*
689 .*or_asr r4,r1,2,r3.*
690 .*or_lsr r4,r1,r2,r3.*
691 .*or_lsr r4,r1,2,r3.*
692 .*or_asl r4,r1,r2,r3.*
693 .*or_asl r4,r1,2,r3.*
694 .*$gdb_prompt $" { pass "dsp_logical tests" }
695 -re "$gdb_prompt $" { fail "dsp_logical tests" }
696 timeout { fail "(timeout) dsp_logical tests" }
697 }
698 }
699
700 proc dsp_misc_tests { } {
701 global gdb_prompt
702 global hex
703 global decimal
704
705 send_gdb "x/42i dsp_misc_tests\n"
706 gdb_expect {
707 -re "
708 .*dmach_add r4,r1,r2,r3.*
709 .*dmach_add r4,r1,2,r3.*
710 .*dmach_sub r4,r1,r2,r3.*
711 .*dmach_sub r4,r1,2,r3.*
712 .*dmach_cmp r4,r1,r2,r3.*
713 .*dmach_cmp r4,r1,2,r3.*
714 .*dmach_mov r4,r1,r2,r3.*
715 .*dmach_mov r4,r1,2,r3.*
716 .*dmach_asr r4,r1,r2,r3.*
717 .*dmach_asr r4,r1,2,r3.*
718 .*dmach_lsr r4,r1,r2,r3.*
719 .*dmach_lsr r4,r1,2,r3.*
720 .*dmach_asl r4,r1,r2,r3.*
721 .*dmach_asl r4,r1,2,r3.*
722 .*swhw_add r4,r1,r2,r3.*
723 .*swhw_add r4,r1,2,r3.*
724 .*swhw_sub r4,r1,r2,r3.*
725 .*swhw_sub r4,r1,2,r3.*
726 .*swhw_cmp r4,r1,r2,r3.*
727 .*swhw_cmp r4,r1,2,r3.*
728 .*swhw_mov r4,r1,r2,r3.*
729 .*swhw_mov r4,r1,2,r3.*
730 .*swhw_asr r4,r1,r2,r3.*
731 .*swhw_asr r4,r1,2,r3.*
732 .*swhw_lsr r4,r1,r2,r3.*
733 .*swhw_lsr r4,r1,2,r3.*
734 .*swhw_asl r4,r1,r2,r3.*
735 .*swhw_asl r4,r1,2,r3.*
736 .*sat16_add r4,r1,r2,r3.*
737 .*sat16_add r4,r1,2,r3.*
738 .*sat16_sub r4,r1,r2,r3.*
739 .*sat16_sub r4,r1,2,r3.*
740 .*sat16_cmp r4,r1,r2,r3.*
741 .*sat16_cmp r4,r1,2,r3.*
742 .*sat16_mov r4,r1,r2,r3.*
743 .*sat16_mov r4,r1,2,r3.*
744 .*sat16_asr r4,r1,r2,r3.*
745 .*sat16_asr r4,r1,2,r3.*
746 .*sat16_lsr r4,r1,r2,r3.*
747 .*sat16_lsr r4,r1,2,r3.*
748 .*sat16_asl r4,r1,r2,r3.*
749 .*sat16_asl r4,r1,2,r3.*
750 .*$gdb_prompt $" { pass "dsp_misc tests" }
751 -re "$gdb_prompt $" { fail "dsp_misc tests" }
752 timeout { fail "(timeout) dsp_misc tests" }
753 }
754 }
755
756 proc autoincrement_tests { } {
757 global gdb_prompt
758 global hex
759 global decimal
760
761 send_gdb "x/16i autoincrement_tests\n"
762 gdb_expect {
763 -re "
764 .*mov \\(r1\\+\\),r2.*
765 .*mov r3,\\(r4\\+\\).*
766 .*movhu \\(r6\\+\\),r7.*
767 .*movhu a0,\\(a1\\+\\).*
768 .*mov \\(r1\\+,64\\),r2.*
769 .*mov r1,\\(r2\\+,64\\).*
770 .*movhu \\(r1\\+,64\\),r2.*
771 .*movhu r1,\\(r2\\+,64\\).*
772 .*mov \\(r1\\+,131055\\),r2.*
773 .*mov r1,\\(r2\\+,131055\\).*
774 .*movhu \\(r1\\+,131055\\),r2.*
775 .*movhu r1,\\(r2\\+,131055\\).*
776 .*mov \\(r1\\+,2147417596\\),r2.*
777 .*mov r1,\\(r2\\+,2147417596\\).*
778 .*movhu \\(r1\\+,2147417596\\),r2.*
779 .*movhu r1,\\(r2\\+,2147417596\\).*
780 .*$gdb_prompt $" { pass "autoincrement tests" }
781 -re "$gdb_prompt $" { fail "autoincrement tests" }
782 timeout { fail "(timeout) autoincrement tests" }
783 }
784 }
785
786 proc dsp_autoincrement_tests { } {
787 global gdb_prompt
788 global hex
789 global decimal
790
791 send_gdb "x/11i dsp_autoincrement_tests\n"
792 gdb_expect {
793 -re "
794 .*mov_llt \\(r1\\+,4\\),r2.*
795 .*mov_lgt \\(r1\\+,4\\),r2.*
796 .*mov_lge \\(r1\\+,4\\),r2.*
797 .*mov_lle \\(r1\\+,4\\),r2.*
798 .*mov_lcs \\(r1\\+,4\\),r2.*
799 .*mov_lhi \\(r1\\+,4\\),r2.*
800 .*mov_lcc \\(r1\\+,4\\),r2.*
801 .*mov_lls \\(r1\\+,4\\),r2.*
802 .*mov_leq \\(r1\\+,4\\),r2.*
803 .*mov_lne \\(r1\\+,4\\),r2.*
804 .*mov_lra \\(r1\\+,4\\),r2.*
805 .*$gdb_prompt $" { pass "autoincrement tests" }
806 -re "$gdb_prompt $" { fail "autoincrement tests" }
807 timeout { fail "(timeout) autoincrement tests" }
808 }
809 }
810
811 # Start with a fresh gdb.
812
813 gdb_exit
814 gdb_start
815 gdb_reinitialize_dir $srcdir/$subdir
816 gdb_load $binfile
817
818 call_tests
819 movm_tests
820 misc_tests
821 mov_tests
822 ext_tests
823 add_tests
824 sub_tests
825 cmp_tests
826 logical_tests
827 shift_tests
828 muldiv_tests
829 movbu_tests
830 movhu_tests
831 mac_tests
832 bit_tests
833 dsp_add_tests
834 dsp_cmp_tests
835 dsp_sub_tests
836 dsp_mov_tests
837 dsp_logical_tests
838 autoincrement_tests
839 dsp_autoincrement_tests