2 # Copyright 1997-2024 Free Software Foundation, Inc.
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 3 of the License, or
7 # (at your option) any later version.
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.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # This file was written by Jeff Law. (law@cygnus.com)
19 require {istarget "mn10300*-*-*"}
23 set testfile "mn10300"
24 set srcfile ${srcdir}/${subdir}/${testfile}.s
25 set binfile ${objdir}/${subdir}/${testfile}
26 if { [gdb_compile "${srcfile}" "${binfile}" executable ""] != "" } {
27 untested "failed to compile"
36 send_gdb "x/14i add_tests\n"
53 .*$gdb_prompt $" { pass "add tests" }
54 -re "$gdb_prompt $" { fail "add tests" }
55 timeout { fail "(timeout) add tests" }
64 send_gdb "x/15i bCC_tests\n"
67 .*beq 0x\[0-9a-f]+ <bCC_tests>.*
68 .*bne 0x\[0-9a-f]+ <bCC_tests>.*
69 .*bgt 0x\[0-9a-f]+ <bCC_tests>.*
70 .*bge 0x\[0-9a-f]+ <bCC_tests>.*
71 .*ble 0x\[0-9a-f]+ <bCC_tests>.*
72 .*blt 0x\[0-9a-f]+ <bCC_tests>.*
73 .*bhi 0x\[0-9a-f]+ <bCC_tests>.*
74 .*bcc 0x\[0-9a-f]+ <bCC_tests>.*
75 .*bls 0x\[0-9a-f]+ <bCC_tests>.*
76 .*bcs 0x\[0-9a-f]+ <bCC_tests>.*
77 .*bvc 0x\[0-9a-f]+ <bCC_tests>.*
78 .*bvs 0x\[0-9a-f]+ <bCC_tests>.*
79 .*bnc 0x\[0-9a-f]+ <bCC_tests>.*
80 .*bns 0x\[0-9a-f]+ <bCC_tests>.*
81 .*bra 0x\[0-9a-f]+ <bCC_tests>.*
82 .*$gdb_prompt $" { pass "bCC tests" }
83 -re "$gdb_prompt $" { fail "bCC tests" }
84 timeout { fail "(timeout) bCC tests" }
93 send_gdb "x/11i bit_tests\n"
99 .*btst 64,\\(8,a1\\).*
100 .*btst 64,\\(0x1ffff\\).*
102 .*bset 64,\\(8,a1\\).*
103 .*bset 64,\\(0x1ffff\\).*
105 .*bclr 64,\\(8,a1\\).*
106 .*bclr 64,\\(0x1ffff\\).*
107 .*$gdb_prompt $" { pass "bit tests" }
108 -re "$gdb_prompt $" { fail "bit tests" }
109 timeout { fail "(timeout) bit tests" }
118 send_gdb "x/10i cmp_tests\n"
131 .*$gdb_prompt $" { pass "cmp tests" }
132 -re "$gdb_prompt $" { fail "cmp tests" }
133 timeout { fail "(timeout) cmp tests" }
137 proc extend_tests { } {
142 send_gdb "x/5i extend_tests\n"
150 .*$gdb_prompt $" { pass "extend tests" }
151 -re "$gdb_prompt $" { fail "extend tests" }
152 timeout { fail "(timeout) extend tests" }
156 proc extended_tests { } {
161 send_gdb "x/13i extended_tests\n"
177 .*$gdb_prompt $" { pass "extended tests" }
178 -re "$gdb_prompt $" { fail "extended tests" }
179 timeout { fail "(timeout) extended tests" }
183 proc logical_tests { } {
188 send_gdb "x/14i logical_tests\n"
205 .*$gdb_prompt $" { pass "logical tests" }
206 -re "$gdb_prompt $" { fail "logical tests" }
207 timeout { fail "(timeout) logical tests" }
211 proc loop_tests { } {
216 send_gdb "x/12i loop_tests\n"
231 .*$gdb_prompt $" { pass "loop tests" }
232 -re "$gdb_prompt $" { fail "loop tests" }
233 timeout { fail "(timeout) loop tests" }
237 proc mov_tests_1 { } {
242 send_gdb "x/16i mov_tests_1\n"
255 .*mov \\(8,a2\\),d1.*
256 .*mov \\(256,a2\\),d1.*
257 .*mov \\(131071,a2\\),d1.*
258 .*mov \\(8,sp\\),d1.*
259 .*mov \\(256,sp\\),d1.*
261 .*$gdb_prompt $" { pass "mov1 tests" }
262 -re "$gdb_prompt $" { fail "mov1 tests" }
263 timeout { fail "(timeout) mov1 tests" }
267 proc mov_tests_2 { } {
272 send_gdb "x/15i mov_tests_2\n"
275 .*mov \\(131071,sp\\),d1.*
276 .*mov \\(d1,a1\\),d2.*
277 .*mov \\(0x8000.*\\),d1.*
278 .*mov \\(0x1ffff.*\\),d1.*
280 .*mov \\(8,a2\\),a1.*
281 .*mov \\(256,a2\\),a1.*
282 .*mov \\(131071,a2\\),a1.*
283 .*mov \\(8,sp\\),a1.*
284 .*mov \\(256,sp\\),a1.*
285 .*mov \\(131071,sp\\),a1.*
286 .*mov \\(d1,a1\\),a2.*
287 .*mov \\(0x8000.*\\),a1.*
288 .*mov \\(0x1ffff.*\\),a1.*
289 .*mov \\(32,a1\\),sp.*
290 .*$gdb_prompt $" { pass "mov2 tests" }
291 -re "$gdb_prompt $" { fail "mov2 tests" }
292 timeout { fail "(timeout) mov2 tests" }
296 proc mov_tests_3 { } {
301 send_gdb "x/15i mov_tests_3\n"
305 .*mov d1,\\(32,a2\\).*
306 .*mov d1,\\(256,a2\\).*
307 .*mov d1,\\(131071,a2\\).*
308 .*mov d1,\\(32,sp\\).*
309 .*mov d1,\\(32768,sp\\).*
310 .*mov d1,\\(131071,sp\\).*
311 .*mov d1,\\(d2,a2\\).*
312 .*mov d1,\\(0x80.*\\).*
313 .*mov d1,\\(0x1ffff.*\\).*
315 .*mov a1,\\(32,a2\\).*
316 .*mov a1,\\(256,a2\\).*
317 .*mov a1,\\(131071,a2\\).*
318 .*mov a1,\\(32,sp\\).*
319 .*$gdb_prompt $" { pass "mov3 tests" }
320 -re "$gdb_prompt $" { fail "mov3 tests" }
321 timeout { fail "(timeout) mov3 tests" }
325 proc mov_tests_4 { } {
330 send_gdb "x/12i mov_tests_4\n"
333 .*mov a1,\\(32768,sp\\).*
334 .*mov a1,\\(131071,sp\\).*
335 .*mov a1,\\(d2,a2\\).*
336 .*mov a1,\\(0x80.*\\).*
337 .*mov a1,\\(0x1ffff.*\\).*
338 .*mov sp,\\(32,a1\\).*
345 .*$gdb_prompt $" { pass "mov4 tests" }
346 -re "$gdb_prompt $" { fail "mov4 tests" }
347 timeout { fail "(timeout) mov4 tests" }
351 proc movbu_tests { } {
356 send_gdb "x/20i movbu_tests\n"
359 .*movbu \\(a2\\),d1.*
360 .*movbu \\(8,a2\\),d1.*
361 .*movbu \\(256,a2\\),d1.*
362 .*movbu \\(131071,a2\\),d1.*
363 .*movbu \\(8,sp\\),d1.*
364 .*movbu \\(256,sp\\),d1.*
365 .*movbu \\(131071,sp\\),d1.*
366 .*movbu \\(d1,a1\\),d2.*
367 .*movbu \\(0x8000.*\\),d1.*
368 .*movbu \\(0x1ffff.*\\),d1.*
369 .*movbu d1,\\(a2\\).*
370 .*movbu d1,\\(32,a2\\).*
371 .*movbu d1,\\(256,a2\\).*
372 .*movbu d1,\\(131071,a2\\).*
373 .*movbu d1,\\(32,sp\\).*
374 .*movbu d1,\\(32768,sp\\).*
375 .*movbu d1,\\(131071,sp\\).*
376 .*movbu d1,\\(d2,a2\\).*
377 .*movbu d1,\\(0x80.*\\).*
378 .*movbu d1,\\(0x1ffff.*\\).*
379 .*$gdb_prompt $" { pass "movbu tests" }
380 -re "$gdb_prompt $" { fail "movbu tests" }
381 timeout { fail "(timeout) movbu tests" }
385 proc movhu_tests { } {
390 send_gdb "x/20i movhu_tests\n"
393 .*movhu \\(a2\\),d1.*
394 .*movhu \\(8,a2\\),d1.*
395 .*movhu \\(256,a2\\),d1.*
396 .*movhu \\(131071,a2\\),d1.*
397 .*movhu \\(8,sp\\),d1.*
398 .*movhu \\(256,sp\\),d1.*
399 .*movhu \\(131071,sp\\),d1.*
400 .*movhu \\(d1,a1\\),d2.*
401 .*movhu \\(0x8000.*\\),d1.*
402 .*movhu \\(0x1ffff.*\\),d1.*
403 .*movhu d1,\\(a2\\).*
404 .*movhu d1,\\(32,a2\\).*
405 .*movhu d1,\\(256,a2\\).*
406 .*movhu d1,\\(131071,a2\\).*
407 .*movhu d1,\\(32,sp\\).*
408 .*movhu d1,\\(32768,sp\\).*
409 .*movhu d1,\\(131071,sp\\).*
410 .*movhu d1,\\(d2,a2\\).*
411 .*movhu d1,\\(0x80.*\\).*
412 .*movhu d1,\\(0x1ffff.*\\).*
413 .*$gdb_prompt $" { pass "movhu tests" }
414 -re "$gdb_prompt $" { fail "movhu tests" }
415 timeout { fail "(timeout) movhu tests" }
419 proc movm_tests { } {
424 send_gdb "x/4i movm_tests\n"
427 .*movm \\(sp\\),.a2,a3..*
428 .*movm \\(sp\\),.d2,d3,a2,a3,other..*
429 .*movm .a2,a3.,\\(sp\\).*
430 .*movm .d2,d3,a2,a3,other.,\\(sp\\).*
431 .*$gdb_prompt $" { pass "movm tests" }
432 -re "$gdb_prompt $" { fail "movm tests" }
433 timeout { fail "(timeout) movm tests" }
437 proc muldiv_tests { } {
442 send_gdb "x/4i muldiv_tests\n"
449 .*$gdb_prompt $" { pass "muldiv tests" }
450 -re "$gdb_prompt $" { fail "muldiv tests" }
451 timeout { fail "(timeout) muldiv tests" }
455 proc other_tests { } {
460 send_gdb "x/19i other_tests\n"
468 .*jmp 0x\[0-9a-f]+ <main>.*
469 .*jmp 0x\[0-9a-f]+ <start>.*
470 .*call 0x\[0-9a-f]+ <main>,.a2,a3.,9.*
471 .*call 0x\[0-9a-f]+ <start>,.a2,a3.,32.*
473 .*calls 0x\[0-9a-f]+ <main>.*
474 .*calls 0x\[0-9a-f]+ <start>.*
482 .*$gdb_prompt $" { pass "other tests" }
483 -re "$gdb_prompt $" { fail "other tests" }
484 timeout { fail "(timeout) other tests" }
488 proc shift_tests { } {
493 send_gdb "x/9i shift_tests\n"
505 .*$gdb_prompt $" { pass "shift tests" }
506 -re "$gdb_prompt $" { fail "shift tests" }
507 timeout { fail "(timeout) shift tests" }
516 send_gdb "x/7i sub_tests\n"
526 .*$gdb_prompt $" { pass "sub tests" }
527 -re "$gdb_prompt $" { fail "sub tests" }
528 timeout { fail "(timeout) sub tests" }
532 clean_restart $binfile