]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.disasm/mn10200.exp
Initial creation of sourceware repository
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.disasm / mn10200.exp
1
2 # Copyright (C) 1997 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 "mn10200*-*-*"] {
28 verbose "Tests ignored for all but mn10200 based targets."
29 return
30 }
31
32 global exec_output
33 set prms_id 0
34 set bug_id 0
35
36 set testfile "mn10200"
37 set srcfile ${srcdir}/${subdir}/${testfile}.s
38 set binfile ${objdir}/${subdir}/${testfile}
39 if { [gdb_compile "${srcfile}" "${binfile}" executable ""] != "" } {
40 gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
41 }
42
43 proc add_tests { } {
44 global gdb_prompt
45 global hex
46 global decimal
47
48 send_gdb "x/12i add_tests\n"
49 gdb_expect {
50 -re "
51 .*add d1,d2.*
52 .*add d2,a3.*
53 .*add a2,d1.*
54 .*add a3,a2.*
55 .*add 16,d1.*
56 .*add 256,d2.*
57 .*add 131071,d3.*
58 .*add 16,a1.*
59 .*add 256,a2.*
60 .*add 131071,a3.*
61 .*addc d1,d2.*
62 .*addnf 16,a2.*
63 .*$gdb_prompt $" { pass "add tests" }
64 -re "$gdb_prompt $" { fail "add tests" }
65 timeout { fail "(timeout) add tests" }
66 }
67 }
68
69 proc bcc_tests { } {
70 global gdb_prompt
71 global hex
72 global decimal
73
74 send_gdb "x/15i bCC_tests\n"
75 gdb_expect {
76 -re "
77 .*beq 0x\[0-9a-f]+ <bCC_tests>.*
78 .*bne 0x\[0-9a-f]+ <bCC_tests>.*
79 .*bgt 0x\[0-9a-f]+ <bCC_tests>.*
80 .*bge 0x\[0-9a-f]+ <bCC_tests>.*
81 .*ble 0x\[0-9a-f]+ <bCC_tests>.*
82 .*blt 0x\[0-9a-f]+ <bCC_tests>.*
83 .*bhi 0x\[0-9a-f]+ <bCC_tests>.*
84 .*bcc 0x\[0-9a-f]+ <bCC_tests>.*
85 .*bls 0x\[0-9a-f]+ <bCC_tests>.*
86 .*bcs 0x\[0-9a-f]+ <bCC_tests>.*
87 .*bvc 0x\[0-9a-f]+ <bCC_tests>.*
88 .*bvs 0x\[0-9a-f]+ <bCC_tests>.*
89 .*bnc 0x\[0-9a-f]+ <bCC_tests>.*
90 .*bns 0x\[0-9a-f]+ <bCC_tests>.*
91 .*bra 0x\[0-9a-f]+ <bCC_tests>.*
92 .*$gdb_prompt $" { pass "bCC tests" }
93 -re "$gdb_prompt $" { fail "bCC tests" }
94 timeout { fail "(timeout) bCC tests" }
95 }
96 }
97
98 proc bccx_tests { } {
99 global gdb_prompt
100 global hex
101 global decimal
102
103 send_gdb "x/14i bCCx_tests\n"
104 gdb_expect {
105 -re "
106 .*beqx 0x\[0-9a-f]+ <bCCx_tests>.*
107 .*bnex 0x\[0-9a-f]+ <bCCx_tests>.*
108 .*bgtx 0x\[0-9a-f]+ <bCCx_tests>.*
109 .*bgex 0x\[0-9a-f]+ <bCCx_tests>.*
110 .*blex 0x\[0-9a-f]+ <bCCx_tests>.*
111 .*bltx 0x\[0-9a-f]+ <bCCx_tests>.*
112 .*bhix 0x\[0-9a-f]+ <bCCx_tests>.*
113 .*bccx 0x\[0-9a-f]+ <bCCx_tests>.*
114 .*blsx 0x\[0-9a-f]+ <bCCx_tests>.*
115 .*bcsx 0x\[0-9a-f]+ <bCCx_tests>.*
116 .*bvcx 0x\[0-9a-f]+ <bCCx_tests>.*
117 .*bvsx 0x\[0-9a-f]+ <bCCx_tests>.*
118 .*bncx 0x\[0-9a-f]+ <bCCx_tests>.*
119 .*bnsx 0x\[0-9a-f]+ <bCCx_tests>.*
120 .*$gdb_prompt $" { pass "bCCx tests" }
121 -re "$gdb_prompt $" { fail "bCCx tests" }
122 timeout { fail "(timeout) bCCx tests" }
123 }
124 }
125
126 proc bit_tests { } {
127 global gdb_prompt
128 global hex
129 global decimal
130
131 send_gdb "x/4 bit_tests\n"
132 gdb_expect {
133 -re "
134 .*btst 64,d1.*
135 .*btst 8192,d2.*
136 .*bset d1,\\(a2\\).*
137 .*bclr d1,\\(a2\\).*
138 .*$gdb_prompt $" { pass "bit tests" }
139 -re "$gdb_prompt $" { fail "bit tests" }
140 timeout { fail "(timeout) bit tests" }
141 }
142 }
143
144 proc cmp_tests { } {
145 global gdb_prompt
146 global hex
147 global decimal
148
149 send_gdb "x/9i cmp_tests\n"
150 gdb_expect {
151 -re "
152 .*cmp d1,d2.*
153 .*cmp d2,a3.*
154 .*cmp a3,d3.*
155 .*cmp a3,a2.*
156 .*cmp 16,d3.*
157 .*cmp 256,d2.*
158 .*cmp 131071,d1.*
159 .*cmp 256,a2.*
160 .*cmp 131071,a1.*
161 .*$gdb_prompt $" { pass "cmp tests" }
162 -re "$gdb_prompt $" { fail "cmp tests" }
163 timeout { fail "(timeout) cmp tests" }
164 }
165 }
166
167 proc extend_tests { } {
168 global gdb_prompt
169 global hex
170 global decimal
171
172 send_gdb "x/5i extend_tests\n"
173 gdb_expect {
174 -re "
175 .*ext d1.*
176 .*extx d2.*
177 .*extxu d3.*
178 .*extxb d2.*
179 .*extxbu d1.*
180 .*$gdb_prompt $" { pass "extend tests" }
181 -re "$gdb_prompt $" { fail "extend tests" }
182 timeout { fail "(timeout) extend tests" }
183 }
184 }
185
186 proc logical_tests { } {
187 global gdb_prompt
188 global hex
189 global decimal
190
191 send_gdb "x/11i logical_tests\n"
192 gdb_expect {
193 -re "
194 .*and d1,d2.*
195 .*and 127,d2.*
196 .*and 32767,d3.*
197 .*and 32767,psw.*
198 .*or d1,d2.*
199 .*or 127,d2.*
200 .*or 32767,d3.*
201 .*or 32767,psw.*
202 .*xor d1,d2.*
203 .*xor 32767,d3.*
204 .*not d3.*
205 .*$gdb_prompt $" { pass "logical tests" }
206 -re "$gdb_prompt $" { fail "logical tests" }
207 timeout { fail "(timeout) logical tests" }
208 }
209 }
210
211 proc mov_tests_1 { } {
212 global gdb_prompt
213 global hex
214 global decimal
215
216 send_gdb "x/12i mov_tests_1\n"
217 gdb_expect {
218 -re "
219 .*mov d1,a2.*
220 .*mov a2,d1.*
221 .*mov d1,d2.*
222 .*mov a2,a1.*
223 .*mov psw,d3.*
224 .*mov d2,psw.*
225 .*mov mdr,d1.*
226 .*mov d2,mdr.*
227 .*mov \\(a2\\),d1.*
228 .*mov \\(8,a2\\),d1.*
229 .*mov \\(256,a2\\),d1.*
230 .*mov \\(131071,a2\\),d1.*
231 .*$gdb_prompt $" { pass "mov1 tests" }
232 -re "$gdb_prompt $" { fail "mov1 tests" }
233 timeout { fail "(timeout) mov1 tests" }
234 }
235 }
236
237 proc mov_tests_2 { } {
238 global gdb_prompt
239 global hex
240 global decimal
241
242 send_gdb "x/9 mov_tests_2\n"
243 gdb_expect {
244 -re "
245 .*mov \\(d1,a1\\),d2.*
246 .*mov \\(0x8000.*\\),d1.*
247 .*mov \\(0x1ffff.*\\),d1.*
248 .*mov \\(8,a2\\),a1.*
249 .*mov \\(256,a2\\),a1.*
250 .*mov \\(131071,a2\\),a1.*
251 .*mov \\(d1,a1\\),a2.*
252 .*mov \\(0x8000.*\\),a1.*
253 .*mov \\(0x1ffff.*\\),a1.*
254 .*$gdb_prompt $" { pass "mov2 tests" }
255 -re "$gdb_prompt $" { fail "mov2 tests" }
256 timeout { fail "(timeout) mov2 tests" }
257 }
258 }
259
260 proc mov_tests_3 { } {
261 global gdb_prompt
262 global hex
263 global decimal
264
265 send_gdb "x/10 mov_tests_3\n"
266 gdb_expect {
267 -re "
268 .*mov d1,\\(a2\\).*
269 .*mov d1,\\(32,a2\\).*
270 .*mov d1,\\(256,a2\\).*
271 .*mov d1,\\(131071,a2\\).*
272 .*mov d1,\\(d2,a2\\).*
273 .*mov d1,\\(0x80.*\\).*
274 .*mov d1,\\(0x1ffff.*\\).*
275 .*mov a1,\\(32,a2\\).*
276 .*mov a1,\\(256,a2\\).*
277 .*mov a1,\\(131071,a2\\).*
278 .*$gdb_prompt $" { pass "mov3 tests" }
279 -re "$gdb_prompt $" { fail "mov3 tests" }
280 timeout { fail "(timeout) mov3 tests" }
281 }
282 }
283
284 proc mov_tests_4 { } {
285 global gdb_prompt
286 global hex
287 global decimal
288
289 send_gdb "x/8 mov_tests_4\n"
290 gdb_expect {
291 -re "
292 .*mov a1,\\(d2,a2\\).*
293 .*mov a1,\\(0x80.*\\).*
294 .*mov a1,\\(0x1ffff.*\\).*
295 .*mov 8,d1.*
296 .*mov 256,d1.*
297 .*mov 131071,d1.*
298 .*mov 256,a1.*
299 .*mov 131071,a1.*
300 .*$gdb_prompt $" { pass "mov4 tests" }
301 -re "$gdb_prompt $" { fail "mov4 tests" }
302 timeout { fail "(timeout) mov4 tests" }
303 }
304 }
305
306 proc movb_tests { } {
307 global gdb_prompt
308 global hex
309 global decimal
310
311 send_gdb "x/12 movb_tests\n"
312 gdb_expect {
313 -re "
314 .*movb \\(8,a2\\),d1.*
315 .*movb \\(256,a2\\),d1.*
316 .*movb \\(131071,a2\\),d1.*
317 .*movb \\(d2,a2\\),d3.*
318 .*movb \\(0x1ffff.*\\),d2.*
319 .*movb d1,\\(a2\\).*
320 .*movb d1,\\(8,a2\\).*
321 .*movb d1,\\(256,a2\\).*
322 .*movb d1,\\(131071,a2\\).*
323 .*movb d1,\\(d2,a2\\).*
324 .*movb d1,\\(0x100.*\\).*
325 .*movb d1,\\(0x1ffff.*\\).*
326 .*$gdb_prompt $" { pass "movb tests" }
327 -re "$gdb_prompt $" { fail "movb tests" }
328 timeout { fail "(timeout) movb tests" }
329 }
330 }
331
332 proc movbu_tests { } {
333 global gdb_prompt
334 global hex
335 global decimal
336
337 send_gdb "x/7 movbu_tests\n"
338 gdb_expect {
339 -re "
340 .*movbu \\(a2\\),d1.*
341 .*movbu \\(8,a2\\),d1.*
342 .*movbu \\(256,a2\\),d1.*
343 .*movbu \\(131071,a2\\),d1.*
344 .*movbu \\(d1,a1\\),d2.*
345 .*movbu \\(0x8000.*\\),d1.*
346 .*movbu \\(0x1ffff.*\\),d1.*
347 .*$gdb_prompt $" { pass "movbu tests" }
348 -re "$gdb_prompt $" { fail "movbu tests" }
349 timeout { fail "(timeout) movbu tests" }
350 }
351 }
352
353 proc movx_tests { } {
354 global gdb_prompt
355 global hex
356 global decimal
357
358 send_gdb "x/6 movx_tests\n"
359 gdb_expect {
360 -re "
361 .*movx \\(8,a2\\),d1.*
362 .*movx \\(256,a2\\),d1.*
363 .*movx \\(131071,a2\\),d1.*
364 .*movx d1,\\(8,a2\\).*
365 .*movx d1,\\(256,a2\\).*
366 .*movx d1,\\(131071,a2\\).*
367 .*$gdb_prompt $" { pass "movx tests" }
368 -re "$gdb_prompt $" { fail "movx tests" }
369 timeout { fail "(timeout) movx tests" }
370 }
371 }
372
373 proc muldiv_tests { } {
374 global gdb_prompt
375 global hex
376 global decimal
377
378 send_gdb "x/3 muldiv_tests\n"
379 gdb_expect {
380 -re "
381 .*mul d1,d2.*
382 .*mulu d2,d3.*
383 .*divu d3,d2.*
384 .*$gdb_prompt $" { pass "muldiv tests" }
385 -re "$gdb_prompt $" { fail "muldiv tests" }
386 timeout { fail "(timeout) muldiv tests" }
387 }
388 }
389
390 proc misc_tests { } {
391 global gdb_prompt
392 global hex
393 global decimal
394
395 send_gdb "x/9 misc_tests\n"
396 gdb_expect {
397 -re "
398 .*jmp 0x\[0-9a-f]+ <main>.*
399 .*jmp 0x\[0-9a-f]+ <start>.*
400 .*jmp \\(a2\\).*
401 .*jsr 0x\[0-9a-f]+ <main>.*
402 .*jsr 0x\[0-9a-f]+ <start>.*
403 .*jsr \\(a2\\).*
404 .*rts.*
405 .*rti.*
406 .*nop.*
407 .*$gdb_prompt $" { pass "misc tests" }
408 -re "$gdb_prompt $" { fail "misc tests" }
409 timeout { fail "(timeout) misc tests" }
410 }
411 }
412
413 proc shift_tests { } {
414 global gdb_prompt
415 global hex
416 global decimal
417
418 send_gdb "x/4i shift_tests\n"
419 gdb_expect {
420 -re "
421 .*asr d2.*
422 .*lsr d3.*
423 .*ror d1.*
424 .*rol d2.*
425 .*$gdb_prompt $" { pass "shift tests" }
426 -re "$gdb_prompt $" { fail "shift tests" }
427 timeout { fail "(timeout) shift tests" }
428 }
429 }
430
431 proc sub_tests { } {
432 global gdb_prompt
433 global hex
434 global decimal
435
436 send_gdb "x/9i sub_tests\n"
437 gdb_expect {
438 -re "
439 .*sub d1,d2.*
440 .*sub d2,a3.*
441 .*sub a3,d3.*
442 .*sub a3,a2.*
443 .*sub 32767,d2.*
444 .*sub 131071,d2.*
445 .*sub 32767,a2.*
446 .*sub 131071,a2.*
447 .*subc d1,d2.*
448 .*$gdb_prompt $" { pass "sub tests" }
449 -re "$gdb_prompt $" { fail "sub tests" }
450 timeout { fail "(timeout) sub tests" }
451 }
452 }
453
454 # Start with a fresh gdb.
455
456 gdb_exit
457 gdb_start
458 gdb_reinitialize_dir $srcdir/$subdir
459 gdb_load $binfile
460
461 add_tests
462 bcc_tests
463 bccx_tests
464 bit_tests
465 cmp_tests
466 extend_tests
467 logical_tests
468 mov_tests_1
469 mov_tests_2
470 mov_tests_3
471 mov_tests_4
472 movb_tests
473 movbu_tests
474 movx_tests
475 muldiv_tests
476 misc_tests
477 shift_tests
478 sub_tests