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