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