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