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