]>
Commit | Line | Data |
---|---|---|
9b254dd1 | 1 | # Copyright (C) 2000, 2007, 2008 Free Software Foundation, Inc. |
8afc772b AC |
2 | |
3 | # This program is free software; you can redistribute it and/or modify | |
4 | # it under the terms of the GNU General Public License as published by | |
e22f8b7c | 5 | # the Free Software Foundation; either version 3 of the License, or |
8afc772b | 6 | # (at your option) any later version. |
e22f8b7c | 7 | # |
8afc772b AC |
8 | # This program is distributed in the hope that it will be useful, |
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | # GNU General Public License for more details. | |
e22f8b7c | 12 | # |
8afc772b | 13 | # You should have received a copy of the GNU General Public License |
e22f8b7c | 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
8afc772b | 15 | |
8afc772b AC |
16 | # This file was written by Kazu Hirata. (kazu@hxi.com) |
17 | ||
18 | if $tracelevel then { | |
19 | strace $tracelevel | |
20 | } | |
21 | ||
22 | if ![istarget "h8300*-*-*"] { | |
23 | verbose "Tests ignored for all but h8300s based targets." | |
24 | return | |
25 | } | |
26 | ||
27 | set prms_id 0 | |
28 | set bug_id 0 | |
29 | ||
30 | set testfile "h8300s" | |
31 | set srcfile ${srcdir}/${subdir}/${testfile}.s | |
32 | set binfile ${objdir}/${subdir}/${testfile} | |
33 | if { [gdb_compile "${srcfile}" "${binfile}" executable {debug additional_flags=-ms}] != "" } { | |
b60f0898 JB |
34 | untested h8300s.exp |
35 | return -1 | |
8afc772b AC |
36 | } |
37 | ||
38 | proc all_set_machine_h8300s { } { | |
39 | global gdb_prompt | |
40 | global hex | |
41 | global decimal | |
42 | ||
43 | send_gdb "set machine h8300s\n" | |
44 | gdb_expect { | |
45 | -re "$gdb_prompt $" {} | |
46 | } | |
47 | } | |
48 | ||
49 | proc all_movb_tests { } { | |
50 | global gdb_prompt | |
51 | global hex | |
52 | global decimal | |
53 | ||
54 | send_gdb "x/9i movb_tests\n" | |
55 | gdb_expect { | |
56 | -re " | |
57 | .*mov.b\tr0l,r0h.* | |
58 | .*mov.b\t#0x12,r1l.* | |
59 | .*mov.b\t@er0,r1h.* | |
60 | .*mov.b\t@\\(0x1234:16,er0\\),r2l.* | |
61 | .*mov.b\t@\\(0x12345678:32,er0\\),r2h.* | |
62 | .*mov.b\t@er0\\+,r3l.* | |
63 | .*mov.b\t@0x12:8,r3h.* | |
64 | .*mov.b\t@0x1234:16,r4l.* | |
65 | .*mov.b\t@0x12345678:32,r4h.* | |
66 | .*$gdb_prompt $" { pass "movb_tests" } | |
67 | -re "$gdb_prompt $" { fail "movb_tests" } | |
68 | timeout { fail "(timeout) movb_tests" } | |
69 | } | |
70 | } | |
71 | ||
72 | proc all_movw_tests { } { | |
73 | global gdb_prompt | |
74 | global hex | |
75 | global decimal | |
76 | ||
77 | send_gdb "x/8i movw_tests\n" | |
78 | gdb_expect { | |
79 | -re " | |
80 | .*mov.w\te0,r0.* | |
81 | .*mov.w\t#0x1234,r1.* | |
82 | .*mov.w\t@er0,r2.* | |
83 | .*mov.w\t@\\(0x1234:16,er0\\),r3.* | |
84 | .*mov.w\t@\\(0x12345678:32,er0\\),r4.* | |
85 | .*mov.w\t@er0\\+,r5.* | |
86 | .*mov.w\t@0x1234:16,r6.* | |
87 | .*mov.w\t@0x12345678:32,r7.* | |
88 | .*$gdb_prompt $" { pass "movw_tests" } | |
89 | -re "$gdb_prompt $" { fail "movw_tests" } | |
90 | timeout { fail "(timeout) movw_tests" } | |
91 | } | |
92 | } | |
93 | ||
94 | proc all_movl_tests { } { | |
95 | global gdb_prompt | |
96 | global hex | |
97 | global decimal | |
98 | ||
99 | send_gdb "x/8i movl_tests\n" | |
100 | gdb_expect { | |
101 | -re " | |
102 | .*mov.l\ter0,er1.* | |
103 | .*mov.l\t#0x12345678,er1.* | |
104 | .*mov.l\t@er0,er2.* | |
105 | .*mov.l\t@\\(0x1234:16,er0\\),er3.* | |
106 | .*mov.l\t@\\(0x12345678:32,er0\\),er4.* | |
107 | .*mov.l\t@er0\\+,er5.* | |
108 | .*mov.l\t@0x1234:16,er6.* | |
109 | .*mov.l\t@0x12345678:32,er7.* | |
110 | .*$gdb_prompt $" { pass "movl_tests" } | |
111 | -re "$gdb_prompt $" { fail "movl_tests" } | |
112 | timeout { fail "(timeout) movl_tests" } | |
113 | } | |
114 | } | |
115 | ||
116 | proc all_ldm_stm_tests { } { | |
117 | global gdb_prompt | |
118 | global hex | |
119 | global decimal | |
120 | ||
121 | send_gdb "x/6i ldm_stm_tests\n" | |
122 | gdb_expect { | |
123 | -re " | |
124 | .*ldm.l\t@sp\\+,er0-er1.* | |
125 | .*ldm.l\t@sp\\+,er0-er2.* | |
126 | .*ldm.l\t@sp\\+,er0-er3.* | |
127 | .*stm.l\ter0\\-er1,@-sp.* | |
128 | .*stm.l\ter0\\-er2,@-sp.* | |
129 | .*stm.l\ter0\\-er3,@-sp.* | |
130 | .*$gdb_prompt $" { pass "ldm_stm_tests" } | |
131 | -re "$gdb_prompt $" { fail "ldm_stm_tests" } | |
132 | timeout { fail "(timeout) ldm_stm_tests" } | |
133 | } | |
134 | } | |
135 | ||
136 | proc all_movfpe_movtpe_tests { } { | |
137 | global gdb_prompt | |
138 | global hex | |
139 | global decimal | |
140 | ||
141 | send_gdb "x/2i movfpe_movtpe_tests\n" | |
142 | gdb_expect { | |
143 | -re " | |
144 | .*movfpe\t@0x1234:16,r2l.* | |
145 | .*movtpe\tr2l,@0x1234:16.* | |
146 | .*$gdb_prompt $" { pass "movfpe_movtpe_tests" } | |
147 | -re "$gdb_prompt $" { fail "movfpe_movtpe_tests" } | |
148 | timeout { fail "(timeout) movfpe_movtpe_tests" } | |
149 | } | |
150 | } | |
151 | ||
152 | proc all_add_sub_addx_subx_tests { } { | |
153 | global gdb_prompt | |
154 | global hex | |
155 | global decimal | |
156 | ||
157 | send_gdb "x/15i add_sub_addx_subx_tests\n" | |
158 | gdb_expect { | |
159 | -re " | |
160 | .*add.b\t#0x12,r0l.* | |
161 | .*add.b\tr1l,r1h.* | |
162 | .*add.w\t#0x1234,r2.* | |
163 | .*add.w\tr3,r4.* | |
164 | .*add.l\t#0x12345678,er5.* | |
165 | .*add.l\ter6,er7.* | |
166 | .*sub.b\tr1l,r1h.* | |
167 | .*sub.w\t#0x1234,r2.* | |
168 | .*sub.w\tr3,r4.* | |
169 | .*sub.l\t#0x12345678,er5.* | |
170 | .*sub.l\ter6,er7.* | |
171 | .*addx\t#0x12,r0l.* | |
172 | .*addx\tr1l,r1h.* | |
173 | .*subx\t#0x12,r0l.* | |
174 | .*subx\tr1l,r1h.* | |
175 | .*$gdb_prompt $" { pass "add_sub_addx_subx_tests" } | |
176 | -re "$gdb_prompt $" { fail "add_sub_addx_subx_tests" } | |
177 | timeout { fail "(timeout) add_sub_addx_subx_tests" } | |
178 | } | |
179 | } | |
180 | ||
181 | proc all_inc_dec_adds_subs_tests { } { | |
182 | global gdb_prompt | |
183 | global hex | |
184 | global decimal | |
185 | ||
186 | send_gdb "x/16i inc_dec_adds_subs_tests\n" | |
187 | gdb_expect { | |
188 | -re " | |
3d67be83 MS |
189 | .*inc(.b|)\tr0l.* |
190 | .*inc.w\t#(0x|)1,r4.* | |
191 | .*inc.w\t#(0x|)2,r3.* | |
192 | .*inc.l\t#(0x|)1,er2.* | |
193 | .*inc.l\t#(0x|)2,er1.* | |
8afc772b | 194 | .*dec.b\tr0l.* |
3d67be83 MS |
195 | .*dec.w\t#(0x|)1,r4.* |
196 | .*dec.w\t#(0x|)2,r3.* | |
197 | .*dec.l\t#(0x|)1,er2.* | |
198 | .*dec.l\t#(0x|)2,er1.* | |
199 | .*adds\t#(0x|)1,er7.* | |
200 | .*adds\t#(0x|)2,er6.* | |
201 | .*adds\t#(0x|)4,er5.* | |
202 | .*subs\t#(0x|)1,er7.* | |
203 | .*subs\t#(0x|)2,er6.* | |
204 | .*subs\t#(0x|)4,er5.* | |
8afc772b AC |
205 | .*$gdb_prompt $" { pass "inc_dec_adds_subs_tests" } |
206 | -re "$gdb_prompt $" { fail "inc_dec_adds_subs_tests" } | |
207 | timeout { fail "(timeout) inc_dec_adds_subs_tests" } | |
208 | } | |
209 | } | |
210 | ||
211 | proc all_daa_das_tests { } { | |
212 | global gdb_prompt | |
213 | global hex | |
214 | global decimal | |
215 | ||
216 | send_gdb "x/2i daa_das_tests\n" | |
217 | gdb_expect { | |
218 | -re " | |
219 | .*daa\tr0l.* | |
220 | .*das\tr0h.* | |
221 | .*$gdb_prompt $" { pass "daa_das_tests" } | |
222 | -re "$gdb_prompt $" { fail "daa_das_tests" } | |
223 | timeout { fail "(timeout) daa_das_tests" } | |
224 | } | |
225 | } | |
226 | ||
227 | proc all_mul_div_tests { } { | |
228 | global gdb_prompt | |
229 | global hex | |
230 | global decimal | |
231 | ||
232 | send_gdb "x/8i mul_div_tests\n" | |
233 | gdb_expect { | |
234 | -re " | |
235 | .*mulxs.b\tr0l,r1.* | |
236 | .*mulxs.w\tr2,er3.* | |
237 | .*mulxu.b\tr0l,e1.* | |
238 | .*mulxu.w\te2,er3.* | |
239 | .*divxs.b\tr0l,r1.* | |
240 | .*divxs.w\tr2,er3.* | |
241 | .*divxu.b\tr0l,e1.* | |
242 | .*divxu.w\te2,er3.* | |
243 | .*$gdb_prompt $" { pass "mul_div_tests" } | |
244 | -re "$gdb_prompt $" { fail "mul_div_tests" } | |
245 | timeout { fail "(timeout) mul_div_tests" } | |
246 | } | |
247 | } | |
248 | ||
249 | proc all_cmp_tests { } { | |
250 | global gdb_prompt | |
251 | global hex | |
252 | global decimal | |
253 | ||
254 | send_gdb "x/8i cmp_tests\n" | |
255 | gdb_expect { | |
256 | -re " | |
257 | .*cmp.b\t#0x12,r0l.* | |
258 | .*cmp.b\tr1l,r1h.* | |
259 | .*cmp.w\t#0x1234,r2.* | |
260 | .*cmp.w\tr3,e3.* | |
261 | .*cmp.l\t#0x12345678,er4.* | |
262 | .*cmp.l\ter5,er6.* | |
263 | .*$gdb_prompt $" { pass "cmp_tests" } | |
264 | -re "$gdb_prompt $" { fail "cmp_tests" } | |
265 | timeout { fail "(timeout) cmp_tests" } | |
266 | } | |
267 | } | |
268 | ||
269 | proc all_neg_tests { } { | |
270 | global gdb_prompt | |
271 | global hex | |
272 | global decimal | |
273 | ||
274 | send_gdb "x/3i neg_tests\n" | |
275 | gdb_expect { | |
276 | -re " | |
277 | .*neg.b\tr0l.* | |
278 | .*neg.w\tr2.* | |
279 | .*neg.l\ter3.* | |
280 | .*$gdb_prompt $" { pass "neg_tests" } | |
281 | -re "$gdb_prompt $" { fail "neg_tests" } | |
282 | timeout { fail "(timeout) neg_tests" } | |
283 | } | |
284 | } | |
285 | ||
286 | proc all_ext_tests { } { | |
287 | global gdb_prompt | |
288 | global hex | |
289 | global decimal | |
290 | ||
291 | send_gdb "x/4i ext_tests\n" | |
292 | gdb_expect { | |
293 | -re " | |
294 | .*exts.w\tr0.* | |
295 | .*exts.l\ter1.* | |
296 | .*extu.w\tr2.* | |
297 | .*extu.l\ter3.* | |
298 | .*$gdb_prompt $" { pass "ext_tests" } | |
299 | -re "$gdb_prompt $" { fail "ext_tests" } | |
300 | timeout { fail "(timeout) ext_tests" } | |
301 | } | |
302 | } | |
303 | ||
304 | proc all_tas_mac_tests { } { | |
305 | global gdb_prompt | |
306 | global hex | |
307 | global decimal | |
308 | ||
309 | send_gdb "x/7i tas_mac_tests\n" | |
310 | gdb_expect { | |
311 | -re " | |
312 | .*tas\t@er0.* | |
3d67be83 | 313 | .*mac\t@er1\\+,@er2\\+.* |
8afc772b AC |
314 | .*clrmac.* |
315 | .*ldmac\ter4,mach.* | |
316 | .*ldmac\ter5,macl.* | |
317 | .*stmac\tmach,er6.* | |
318 | .*stmac\tmacl,er7.* | |
319 | .*$gdb_prompt $" { pass "tas_mac_tests" } | |
320 | -re "$gdb_prompt $" { fail "tas_mac_tests" } | |
321 | timeout { fail "(timeout) tas_mac_tests" } | |
322 | } | |
323 | } | |
324 | ||
325 | proc all_logic_operations_tests { } { | |
326 | global gdb_prompt | |
327 | global hex | |
328 | global decimal | |
329 | ||
330 | send_gdb "x/21i logic_operations_tests\n" | |
331 | gdb_expect { | |
332 | -re " | |
333 | .*and.b\t#0x12,r0l.* | |
334 | .*and.b\tr1l,r2h.* | |
335 | .*and.w\t#0x1234,r0.* | |
336 | .*and.w\tr1,r2.* | |
337 | .*and.l\t#0x12345678,er0.* | |
338 | .*and.l\ter1,er2.* | |
339 | .*or.b\t#0x12,r0l.* | |
340 | .*or.b\tr1l,r2h.* | |
341 | .*or.w\t#0x1234,r0.* | |
342 | .*or.w\tr1,r2.* | |
343 | .*or.l\t#0x12345678,er0.* | |
344 | .*or.l\ter1,er2.* | |
3d67be83 MS |
345 | .*xor(.b|)\t#0x12,r0l.* |
346 | .*xor(.b|)\tr1l,r2h.* | |
8afc772b AC |
347 | .*xor.w\t#0x1234,r0.* |
348 | .*xor.w\tr1,r2.* | |
349 | .*xor.l\t#0x12345678,er0.* | |
350 | .*xor.l\ter1,er2.* | |
351 | .*not.b\tr0l.* | |
352 | .*not.w\tr1.* | |
353 | .*not.l\ter2.* | |
354 | .*$gdb_prompt $" { pass "logic_operations_tests" } | |
355 | -re "$gdb_prompt $" { fail "logic_operations_tests" } | |
356 | timeout { fail "(timeout) logic_operations_tests" } | |
357 | } | |
358 | } | |
359 | ||
360 | proc all_sha_shl_tests { } { | |
361 | global gdb_prompt | |
362 | global hex | |
363 | global decimal | |
364 | ||
365 | send_gdb "x/12i sha_shl_tests\n" | |
366 | gdb_expect { | |
367 | -re " | |
3d67be83 MS |
368 | .*shal(.b|)\tr0l.* |
369 | .*shal(.w|)\tr1.* | |
370 | .*shal(.l|)\ter2.* | |
371 | .*shar(.b|)\tr3l.* | |
372 | .*shar(.w|)\tr4.* | |
373 | .*shar(.l|)\ter5.* | |
374 | .*shll(.b|)\tr0l.* | |
375 | .*shll(.w|)\tr1.* | |
376 | .*shll(.l|)\ter2.* | |
377 | .*shlr(.b|)\tr3l.* | |
378 | .*shlr(.w|)\tr4.* | |
379 | .*shlr(.l|)\ter5.* | |
8afc772b AC |
380 | .*$gdb_prompt $" { pass "sha_shl_tests" } |
381 | -re "$gdb_prompt $" { fail "sha_shl_tests" } | |
382 | timeout { fail "(timeout) sha_shl_tests" } | |
383 | } | |
384 | } | |
385 | ||
386 | proc all_rot_rotx_tests { } { | |
387 | global gdb_prompt | |
388 | global hex | |
389 | global decimal | |
390 | ||
391 | send_gdb "x/12i rot_rotx_tests\n" | |
392 | gdb_expect { | |
393 | -re " | |
3d67be83 MS |
394 | .*rotl(.b|)\tr0l.* |
395 | .*rotl(.w|)\tr1.* | |
396 | .*rotl(.l|)\ter2.* | |
397 | .*rotr(.b|)\tr3l.* | |
398 | .*rotr(.w|)\tr4.* | |
399 | .*rotr(.l|)\ter5.* | |
400 | .*rotxl(.b|)\tr0l.* | |
401 | .*rotxl(.w|)\tr1.* | |
402 | .*rotxl(.l|)\ter2.* | |
403 | .*rotxr(.b|)\tr3l.* | |
404 | .*rotxr(.w|)\tr4.* | |
405 | .*rotxr(.l|)\ter5.* | |
8afc772b AC |
406 | .*$gdb_prompt $" { pass "rot_rotx_tests" } |
407 | -re "$gdb_prompt $" { fail "rot_rotx_tests" } | |
408 | timeout { fail "(timeout) rot_rotx_tests" } | |
409 | } | |
410 | } | |
411 | ||
412 | proc all_bset_bclr_tests { } { | |
413 | global gdb_prompt | |
414 | global hex | |
415 | global decimal | |
416 | ||
417 | send_gdb "x/20i bset_bclr_tests\n" | |
418 | gdb_expect { | |
419 | -re " | |
420 | .*bset\t#0x7,r0l.* | |
421 | .*bset\t#0x6,@er1.* | |
422 | .*bset\t#0x5,@0x12:8.* | |
423 | .*bset\t#0x4,@0x1234:16.* | |
424 | .*bset\t#0x3,@0x12345678:32.* | |
425 | .*bset\tr7l,r0h.* | |
426 | .*bset\tr6l,@er1.* | |
427 | .*bset\tr5l,@0x12:8.* | |
428 | .*bset\tr4l,@0x1234:16.* | |
429 | .*bset\tr3l,@0x12345678:32.* | |
430 | .*bclr\t#0x7,r0l.* | |
431 | .*bclr\t#0x6,@er1.* | |
432 | .*bclr\t#0x5,@0x12:8.* | |
433 | .*bclr\t#0x4,@0x1234:16.* | |
434 | .*bclr\t#0x3,@0x12345678:32.* | |
435 | .*bclr\tr7h,r0h.* | |
436 | .*bclr\tr6h,@er1.* | |
437 | .*bclr\tr5h,@0x12:8.* | |
438 | .*bclr\tr4h,@0x1234:16.* | |
439 | .*bclr\tr3h,@0x12345678:32.* | |
440 | .*$gdb_prompt $" { pass "bset_bclr_tests" } | |
441 | -re "$gdb_prompt $" { fail "bset_bclr_tests" } | |
442 | timeout { fail "(timeout) bset_bclr_tests" } | |
443 | } | |
444 | } | |
445 | ||
446 | proc all_bnot_btst_tests { } { | |
447 | global gdb_prompt | |
448 | global hex | |
449 | global decimal | |
450 | ||
451 | send_gdb "x/20i bnot_btst_tests\n" | |
452 | gdb_expect { | |
453 | -re " | |
454 | .*bnot\t#0x7,r0l.* | |
455 | .*bnot\t#0x6,@er1.* | |
456 | .*bnot\t#0x5,@0x12:8.* | |
457 | .*bnot\t#0x4,@0x1234:16.* | |
458 | .*bnot\t#0x3,@0x12345678:32.* | |
459 | .*bnot\tr7l,r0h.* | |
460 | .*bnot\tr6l,@er1.* | |
461 | .*bnot\tr5l,@0x12:8.* | |
462 | .*bnot\tr4l,@0x1234:16.* | |
463 | .*bnot\tr3l,@0x12345678:32.* | |
464 | .*btst\t#0x7,r0l.* | |
465 | .*btst\t#0x6,@er1.* | |
466 | .*btst\t#0x5,@0x12:8.* | |
467 | .*btst\t#0x4,@0x1234:16.* | |
468 | .*btst\t#0x3,@0x12345678:32.* | |
469 | .*btst\tr7h,r0h.* | |
470 | .*btst\tr6h,@er1.* | |
471 | .*btst\tr5h,@0x12:8.* | |
472 | .*btst\tr4h,@0x1234:16.* | |
473 | .*btst\tr3h,@0x12345678:32.* | |
474 | .*$gdb_prompt $" { pass "bnot_btst_tests" } | |
475 | -re "$gdb_prompt $" { fail "bnot_btst_tests" } | |
476 | timeout { fail "(timeout) bnot_btst_tests" } | |
477 | } | |
478 | } | |
479 | ||
480 | proc all_band_bor_bxor_tests { } { | |
481 | global gdb_prompt | |
482 | global hex | |
483 | global decimal | |
484 | ||
485 | send_gdb "x/15i band_bor_bxor_tests\n" | |
486 | gdb_expect { | |
487 | -re " | |
488 | .*band\t#0x7,r0l.* | |
489 | .*band\t#0x6,@er1.* | |
490 | .*band\t#0x5,@0x12:8.* | |
491 | .*band\t#0x4,@0x1234:16.* | |
492 | .*band\t#0x3,@0x12345678:32.* | |
493 | .*bor\t#0x7,r0l.* | |
494 | .*bor\t#0x6,@er1.* | |
495 | .*bor\t#0x5,@0x12:8.* | |
496 | .*bor\t#0x4,@0x1234:16.* | |
497 | .*bor\t#0x3,@0x12345678:32.* | |
498 | .*bxor\t#0x7,r0l.* | |
499 | .*bxor\t#0x6,@er1.* | |
500 | .*bxor\t#0x5,@0x12:8.* | |
501 | .*bxor\t#0x4,@0x1234:16.* | |
502 | .*bxor\t#0x3,@0x12345678:32.* | |
503 | .*$gdb_prompt $" { pass "band_bor_bxor_tests" } | |
504 | -re "$gdb_prompt $" { fail "band_bor_bxor_tests" } | |
505 | timeout { fail "(timeout) band_bor_bxor_tests" } | |
506 | } | |
507 | } | |
508 | ||
509 | proc all_bld_bst_tests { } { | |
510 | global gdb_prompt | |
511 | global hex | |
512 | global decimal | |
513 | ||
514 | send_gdb "x/20i bld_bst_tests\n" | |
515 | gdb_expect { | |
516 | -re " | |
517 | .*bld\t#0x7,r0l.* | |
518 | .*bld\t#0x6,@er1.* | |
519 | .*bld\t#0x5,@0x12:8.* | |
520 | .*bld\t#0x4,@0x1234:16.* | |
521 | .*bld\t#0x3,@0x12345678:32.* | |
522 | .*bild\t#0x7,r0l.* | |
523 | .*bild\t#0x6,@er1.* | |
524 | .*bild\t#0x5,@0x12:8.* | |
525 | .*bild\t#0x4,@0x1234:16.* | |
526 | .*bild\t#0x3,@0x12345678:32.* | |
527 | .*bst\t#0x7,r0l.* | |
528 | .*bst\t#0x6,@er1.* | |
529 | .*bst\t#0x5,@0x12:8.* | |
530 | .*bst\t#0x4,@0x1234:16.* | |
531 | .*bst\t#0x3,@0x12345678:32.* | |
532 | .*bist\t#0x7,r0l.* | |
533 | .*bist\t#0x6,@er1.* | |
534 | .*bist\t#0x5,@0x12:8.* | |
535 | .*bist\t#0x4,@0x1234:16.* | |
536 | .*bist\t#0x3,@0x12345678:32.* | |
537 | .*$gdb_prompt $" { pass "bld_bst_tests" } | |
538 | -re "$gdb_prompt $" { fail "bld_bst_tests" } | |
539 | timeout { fail "(timeout) bld_bst_tests" } | |
540 | } | |
541 | } | |
542 | ||
543 | proc all_branch_tests { } { | |
544 | global gdb_prompt | |
545 | global hex | |
546 | global decimal | |
547 | ||
548 | send_gdb "x/25i branch_tests\n" | |
549 | gdb_expect { | |
550 | -re " | |
3d67be83 MS |
551 | .*bra\t(branch_tests|.-2 ).* |
552 | .*brn\t(branch_tests|.-4 ).* | |
553 | .*bhi\t(branch_tests|.-6 ).* | |
554 | .*bls\t(branch_tests|.-8 ).* | |
555 | .*bcc\t(branch_tests|.-10 ).* | |
556 | .*bcs\t(branch_tests|.-12 ).* | |
557 | .*bne\t(branch_tests|.-14 ).* | |
558 | .*beq\t(branch_tests|.-16 ).* | |
559 | .*bvc\t(branch_tests|.-18 ).* | |
560 | .*bvs\t(branch_tests|.-20 ).* | |
561 | .*bpl\t(branch_tests|.-22 ).* | |
562 | .*bmi\t(branch_tests|.-24 ).* | |
563 | .*bge\t(branch_tests|.-26 ).* | |
564 | .*blt\t(branch_tests|.-28 ).* | |
565 | .*bgt\t(branch_tests|.-30 ).* | |
566 | .*ble\t(branch_tests|.-32 ).* | |
8afc772b | 567 | .*jmp\t@er0.* |
3d67be83 MS |
568 | .*jmp\t@(branch_tests|0x).* |
569 | .*jmp\t@@0 \\((0x|)0\\).* | |
570 | .*bsr\t(branch_tests|.-42 ).* | |
571 | .*bsr\t(branch_tests|.-46 ).* | |
8afc772b | 572 | .*jsr\t@er0.* |
3d67be83 MS |
573 | .*jsr\t@(branch_tests|0x).* |
574 | .*jsr\t@@0 \\((0x|)0\\).* | |
8afc772b AC |
575 | .*rts.* |
576 | .*$gdb_prompt $" { pass "branch_tests" } | |
577 | -re "$gdb_prompt $" { fail "branch_tests" } | |
578 | timeout { fail "(timeout) branch_tests" } | |
579 | } | |
580 | } | |
581 | ||
582 | proc all_system_control_tests { } { | |
583 | global gdb_prompt | |
584 | global hex | |
585 | global decimal | |
586 | ||
587 | send_gdb "x/40i system_control_tests\n" | |
588 | gdb_expect { | |
589 | -re " | |
590 | .*trapa\t#0x2.* | |
591 | .*rte.* | |
592 | .*sleep.* | |
593 | .*ldc\t#0x12,ccr*. | |
594 | .*ldc\tr3l,ccr.* | |
595 | .*ldc\t@er0,ccr.* | |
596 | .*ldc\t@\\(0x1234:16,er0\\),ccr.* | |
597 | .*ldc\t@\\(0x12345678:32,er0\\),ccr.* | |
598 | .*ldc\t@er1\\+,ccr.* | |
599 | .*ldc\t@0x1234:16,ccr.* | |
600 | .*ldc\t@0x12345678:32,ccr.* | |
601 | .*stc\tccr,r3l.* | |
602 | .*stc\tccr,@er0.* | |
603 | .*stc\tccr,@\\(0x1234:16,er0\\).* | |
604 | .*stc\tccr,@\\(0x12345678:32,er0\\).* | |
605 | .*stc\tccr,@\\-er1.* | |
606 | .*stc\tccr,@0x1234:16.* | |
607 | .*stc\tccr,@0x12345678:32.* | |
608 | .*andc\t#0x12,ccr.* | |
609 | .*orc\t#0x34,ccr.* | |
610 | .*xorc\t#0x56,ccr.* | |
611 | .*ldc\t#0x12,exr*. | |
612 | .*ldc\tr3l,exr.* | |
613 | .*ldc\t@er0,exr.* | |
614 | .*ldc\t@\\(0x1234:16,er0\\),exr.* | |
615 | .*ldc\t@\\(0x12345678:32,er0\\),exr.* | |
616 | .*ldc\t@er1\\+,exr.* | |
617 | .*ldc\t@0x1234:16,exr.* | |
618 | .*ldc\t@0x12345678:32,exr.* | |
619 | .*stc\texr,r3l.* | |
620 | .*stc\texr,@er0.* | |
621 | .*stc\texr,@\\(0x1234:16,er0\\).* | |
622 | .*stc\texr,@\\(0x12345678:32,er0\\).* | |
623 | .*stc\texr,@\\-er1.* | |
624 | .*stc\texr,@0x1234:16.* | |
625 | .*stc\texr,@0x12345678:32.* | |
626 | .*andc\t#0x12,exr.* | |
627 | .*orc\t#0x34,exr.* | |
628 | .*xorc\t#0x56,exr.* | |
629 | .*nop.* | |
630 | .*$gdb_prompt $" { pass "system_control_tests" } | |
631 | -re "$gdb_prompt $" { fail "system_control_tests" } | |
632 | timeout { fail "(timeout) system_control_tests" } | |
633 | } | |
634 | } | |
635 | ||
636 | proc all_block_data_transfer_tests { } { | |
637 | global gdb_prompt | |
638 | global hex | |
639 | global decimal | |
640 | ||
641 | send_gdb "x/2i block_data_transfer_tests\n" | |
642 | gdb_expect { | |
643 | -re " | |
644 | .*eepmov.b.* | |
645 | .*eepmov.w.* | |
646 | .*$gdb_prompt $" { pass "block_data_transfer_tests" } | |
647 | -re "$gdb_prompt $" { fail "block_data_transfer_tests" } | |
648 | timeout { fail "(timeout) block_data_transfer_tests" } | |
649 | } | |
650 | } | |
651 | ||
652 | gdb_exit | |
653 | gdb_start | |
654 | gdb_reinitialize_dir $srcdir/$subdir | |
655 | all_set_machine_h8300s | |
656 | gdb_load $binfile | |
657 | ||
658 | # Data transfer | |
659 | all_movb_tests | |
660 | all_movw_tests | |
661 | all_movl_tests | |
662 | all_ldm_stm_tests | |
663 | all_movfpe_movtpe_tests | |
664 | ||
665 | # Arithmetic operations | |
666 | all_add_sub_addx_subx_tests | |
667 | all_inc_dec_adds_subs_tests | |
668 | all_daa_das_tests | |
669 | all_mul_div_tests | |
670 | all_cmp_tests | |
671 | all_neg_tests | |
672 | all_ext_tests | |
673 | all_tas_mac_tests | |
674 | ||
675 | # Logic operations | |
676 | all_logic_operations_tests | |
677 | ||
678 | # Shift | |
679 | all_sha_shl_tests | |
680 | all_rot_rotx_tests | |
681 | ||
682 | # Bit manipulation | |
683 | all_bset_bclr_tests | |
684 | all_bnot_btst_tests | |
685 | all_band_bor_bxor_tests | |
686 | all_bld_bst_tests | |
687 | ||
688 | # Branch | |
689 | all_branch_tests | |
690 | ||
691 | # System control | |
692 | all_system_control_tests | |
693 | ||
694 | # Block data transfer | |
695 | all_block_data_transfer_tests |