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