aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.disasm/h8300s.exp
blob: ee9cea48d1a06297e2f5f0a9139a8cad7edb2f6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
# Copyright (C) 2000-2016 Free Software Foundation, Inc.

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

# This file was written by Kazu Hirata. (kazu@hxi.com)

if ![istarget "h8300*-*-*"] {
    verbose "Tests ignored for all but h8300s based targets."
    return
}


set testfile "h8300s"
set srcfile ${srcdir}/${subdir}/${testfile}.s
set binfile ${objdir}/${subdir}/${testfile}
if  { [gdb_compile "${srcfile}" "${binfile}" executable {debug additional_flags=-ms}] != "" } {
     untested "failed to compile"
     return -1
}

proc all_set_machine_h8300s { } {
    global gdb_prompt
    global hex
    global decimal

    send_gdb "set machine h8300s\n"
    gdb_expect {
	-re "$gdb_prompt $" {}
    }
}

proc all_movb_tests { } {
    global gdb_prompt
    global hex
    global decimal

    send_gdb "x/9i movb_tests\n"
    gdb_expect {
	-re "
.*mov.b\tr0l,r0h.*
.*mov.b\t#0x12,r1l.*
.*mov.b\t@er0,r1h.*
.*mov.b\t@\\(0x1234:16,er0\\),r2l.*
.*mov.b\t@\\(0x12345678:32,er0\\),r2h.*
.*mov.b\t@er0\\+,r3l.*
.*mov.b\t@0x12:8,r3h.*
.*mov.b\t@0x1234:16,r4l.*
.*mov.b\t@0x12345678:32,r4h.*
.*$gdb_prompt $" { pass "movb_tests" }
	-re "$gdb_prompt $" { fail "movb_tests" }
	timeout { fail "(timeout) movb_tests" }
    }
}

proc all_movw_tests { } {
    global gdb_prompt
    global hex
    global decimal

    send_gdb "x/8i movw_tests\n"
    gdb_expect {
	-re "
.*mov.w\te0,r0.*
.*mov.w\t#0x1234,r1.*
.*mov.w\t@er0,r2.*
.*mov.w\t@\\(0x1234:16,er0\\),r3.*
.*mov.w\t@\\(0x12345678:32,er0\\),r4.*
.*mov.w\t@er0\\+,r5.*
.*mov.w\t@0x1234:16,r6.*
.*mov.w\t@0x12345678:32,r7.*
.*$gdb_prompt $" { pass "movw_tests" }
	-re "$gdb_prompt $" { fail "movw_tests" }
	timeout { fail "(timeout) movw_tests" }
    }
}

proc all_movl_tests { } {
    global gdb_prompt
    global hex
    global decimal

    send_gdb "x/8i movl_tests\n"
    gdb_expect {
	-re "
.*mov.l\ter0,er1.*
.*mov.l\t#0x12345678,er1.*
.*mov.l\t@er0,er2.*
.*mov.l\t@\\(0x1234:16,er0\\),er3.*
.*mov.l\t@\\(0x12345678:32,er0\\),er4.*
.*mov.l\t@er0\\+,er5.*
.*mov.l\t@0x1234:16,er6.*
.*mov.l\t@0x12345678:32,er7.*
.*$gdb_prompt $" { pass "movl_tests" }
	-re "$gdb_prompt $" { fail "movl_tests" }
	timeout { fail "(timeout) movl_tests" }
    }
}

proc all_ldm_stm_tests { } {
    global gdb_prompt
    global hex
    global decimal

    send_gdb "x/6i ldm_stm_tests\n"
    gdb_expect {
	-re "
.*ldm.l\t@sp\\+,er0-er1.*
.*ldm.l\t@sp\\+,er0-er2.*
.*ldm.l\t@sp\\+,er0-er3.*
.*stm.l\ter0\\-er1,@-sp.*
.*stm.l\ter0\\-er2,@-sp.*
.*stm.l\ter0\\-er3,@-sp.*
.*$gdb_prompt $" { pass "ldm_stm_tests" }
	-re "$gdb_prompt $" { fail "ldm_stm_tests" }
	timeout { fail "(timeout) ldm_stm_tests" }
    }
}

proc all_movfpe_movtpe_tests { } {
    global gdb_prompt
    global hex
    global decimal

    send_gdb "x/2i movfpe_movtpe_tests\n"
    gdb_expect {
	-re "
.*movfpe\t@0x1234:16,r2l.*
.*movtpe\tr2l,@0x1234:16.*
.*$gdb_prompt $" { pass "movfpe_movtpe_tests" }
	-re "$gdb_prompt $" { fail "movfpe_movtpe_tests" }
	timeout { fail "(timeout) movfpe_movtpe_tests" }
    }
}

proc all_add_sub_addx_subx_tests { } {
    global gdb_prompt
    global hex
    global decimal

    send_gdb "x/15i add_sub_addx_subx_tests\n"
    gdb_expect {
	-re "
.*add.b\t#0x12,r0l.*
.*add.b\tr1l,r1h.*
.*add.w\t#0x1234,r2.*
.*add.w\tr3,r4.*
.*add.l\t#0x12345678,er5.*
.*add.l\ter6,er7.*
.*sub.b\tr1l,r1h.*
.*sub.w\t#0x1234,r2.*
.*sub.w\tr3,r4.*
.*sub.l\t#0x12345678,er5.*
.*sub.l\ter6,er7.*
.*addx\t#0x12,r0l.*
.*addx\tr1l,r1h.*
.*subx\t#0x12,r0l.*
.*subx\tr1l,r1h.*
.*$gdb_prompt $" { pass "add_sub_addx_subx_tests" }
	-re "$gdb_prompt $" { fail "add_sub_addx_subx_tests" }
	timeout { fail "(timeout) add_sub_addx_subx_tests" }
    }
}

proc all_inc_dec_adds_subs_tests { } {
    global gdb_prompt
    global hex
    global decimal

    send_gdb "x/16i inc_dec_adds_subs_tests\n"
    gdb_expect {
	-re "
.*inc(.b|)\tr0l.*
.*inc.w\t#(0x|)1,r4.*
.*inc.w\t#(0x|)2,r3.*
.*inc.l\t#(0x|)1,er2.*
.*inc.l\t#(0x|)2,er1.*
.*dec.b\tr0l.*
.*dec.w\t#(0x|)1,r4.*
.*dec.w\t#(0x|)2,r3.*
.*dec.l\t#(0x|)1,er2.*
.*dec.l\t#(0x|)2,er1.*
.*adds\t#(0x|)1,er7.*
.*adds\t#(0x|)2,er6.*
.*adds\t#(0x|)4,er5.*
.*subs\t#(0x|)1,er7.*
.*subs\t#(0x|)2,er6.*
.*subs\t#(0x|)4,er5.*
.*$gdb_prompt $" { pass "inc_dec_adds_subs_tests" }
	-re "$gdb_prompt $" { fail "inc_dec_adds_subs_tests" }
	timeout { fail "(timeout) inc_dec_adds_subs_tests" }
    }
}

proc all_daa_das_tests { } {
    global gdb_prompt
    global hex
    global decimal

    send_gdb "x/2i daa_das_tests\n"
    gdb_expect {
	-re "
.*daa\tr0l.*
.*das\tr0h.*
.*$gdb_prompt $" { pass "daa_das_tests" }
	-re "$gdb_prompt $" { fail "daa_das_tests" }
	timeout { fail "(timeout) daa_das_tests" }
    }
}

proc all_mul_div_tests { } {
    global gdb_prompt
    global hex
    global decimal

    send_gdb "x/8i mul_div_tests\n"
    gdb_expect {
	-re "
.*mulxs.b\tr0l,r1.*
.*mulxs.w\tr2,er3.*
.*mulxu.b\tr0l,e1.*
.*mulxu.w\te2,er3.*
.*divxs.b\tr0l,r1.*
.*divxs.w\tr2,er3.*
.*divxu.b\tr0l,e1.*
.*divxu.w\te2,er3.*
.*$gdb_prompt $" { pass "mul_div_tests" }
	-re "$gdb_prompt $" { fail "mul_div_tests" }
	timeout { fail "(timeout) mul_div_tests" }
    }
}

proc all_cmp_tests { } {
    global gdb_prompt
    global hex
    global decimal

    send_gdb "x/8i cmp_tests\n"
    gdb_expect {
	-re "
.*cmp.b\t#0x12,r0l.*
.*cmp.b\tr1l,r1h.*
.*cmp.w\t#0x1234,r2.*
.*cmp.w\tr3,e3.*
.*cmp.l\t#0x12345678,er4.*
.*cmp.l\ter5,er6.*
.*$gdb_prompt $" { pass "cmp_tests" }
	-re "$gdb_prompt $" { fail "cmp_tests" }
	timeout { fail "(timeout) cmp_tests" }
    }
}

proc all_neg_tests { } {
    global gdb_prompt
    global hex
    global decimal

    send_gdb "x/3i neg_tests\n"
    gdb_expect {
	-re "
.*neg.b\tr0l.*
.*neg.w\tr2.*
.*neg.l\ter3.*
.*$gdb_prompt $" { pass "neg_tests" }
	-re "$gdb_prompt $" { fail "neg_tests" }
	timeout { fail "(timeout) neg_tests" }
    }
}

proc all_ext_tests { } {
    global gdb_prompt
    global hex
    global decimal

    send_gdb "x/4i ext_tests\n"
    gdb_expect {
	-re "
.*exts.w\tr0.*
.*exts.l\ter1.*
.*extu.w\tr2.*
.*extu.l\ter3.*
.*$gdb_prompt $" { pass "ext_tests" }
	-re "$gdb_prompt $" { fail "ext_tests" }
	timeout { fail "(timeout) ext_tests" }
    }
}

proc all_tas_mac_tests { } {
    global gdb_prompt
    global hex
    global decimal

    send_gdb "x/7i tas_mac_tests\n"
    gdb_expect {
	-re "
.*tas\t@er0.*
.*mac\t@er1\\+,@er2\\+.*
.*clrmac.*
.*ldmac\ter4,mach.*
.*ldmac\ter5,macl.*
.*stmac\tmach,er6.*
.*stmac\tmacl,er7.*
.*$gdb_prompt $" { pass "tas_mac_tests" }
	-re "$gdb_prompt $" { fail "tas_mac_tests" }
	timeout { fail "(timeout) tas_mac_tests" }
    }
}

proc all_logic_operations_tests { } {
    global gdb_prompt
    global hex
    global decimal

    send_gdb "x/21i logic_operations_tests\n"
    gdb_expect {
	-re "
.*and.b\t#0x12,r0l.*
.*and.b\tr1l,r2h.*
.*and.w\t#0x1234,r0.*
.*and.w\tr1,r2.*
.*and.l\t#0x12345678,er0.*
.*and.l\ter1,er2.*
.*or.b\t#0x12,r0l.*
.*or.b\tr1l,r2h.*
.*or.w\t#0x1234,r0.*
.*or.w\tr1,r2.*
.*or.l\t#0x12345678,er0.*
.*or.l\ter1,er2.*
.*xor(.b|)\t#0x12,r0l.*
.*xor(.b|)\tr1l,r2h.*
.*xor.w\t#0x1234,r0.*
.*xor.w\tr1,r2.*
.*xor.l\t#0x12345678,er0.*
.*xor.l\ter1,er2.*
.*not.b\tr0l.*
.*not.w\tr1.*
.*not.l\ter2.*
.*$gdb_prompt $" { pass "logic_operations_tests" }
	-re "$gdb_prompt $" { fail "logic_operations_tests" }
	timeout { fail "(timeout) logic_operations_tests" }
    }
}

proc all_sha_shl_tests { } {
    global gdb_prompt
    global hex
    global decimal

    send_gdb "x/12i sha_shl_tests\n"
    gdb_expect {
	-re "
.*shal(.b|)\tr0l.*
.*shal(.w|)\tr1.*
.*shal(.l|)\ter2.*
.*shar(.b|)\tr3l.*
.*shar(.w|)\tr4.*
.*shar(.l|)\ter5.*
.*shll(.b|)\tr0l.*
.*shll(.w|)\tr1.*
.*shll(.l|)\ter2.*
.*shlr(.b|)\tr3l.*
.*shlr(.w|)\tr4.*
.*shlr(.l|)\ter5.*
.*$gdb_prompt $" { pass "sha_shl_tests" }
	-re "$gdb_prompt $" { fail "sha_shl_tests" }
	timeout { fail "(timeout) sha_shl_tests" }
    }
}

proc all_rot_rotx_tests { } {
    global gdb_prompt
    global hex
    global decimal

    send_gdb "x/12i rot_rotx_tests\n"
    gdb_expect {
	-re "
.*rotl(.b|)\tr0l.*
.*rotl(.w|)\tr1.*
.*rotl(.l|)\ter2.*
.*rotr(.b|)\tr3l.*
.*rotr(.w|)\tr4.*
.*rotr(.l|)\ter5.*
.*rotxl(.b|)\tr0l.*
.*rotxl(.w|)\tr1.*
.*rotxl(.l|)\ter2.*
.*rotxr(.b|)\tr3l.*
.*rotxr(.w|)\tr4.*
.*rotxr(.l|)\ter5.*
.*$gdb_prompt $" { pass "rot_rotx_tests" }
	-re "$gdb_prompt $" { fail "rot_rotx_tests" }
	timeout { fail "(timeout) rot_rotx_tests" }
    }
}

proc all_bset_bclr_tests { } {
    global gdb_prompt
    global hex
    global decimal

    send_gdb "x/20i bset_bclr_tests\n"
    gdb_expect {
	-re "
.*bset\t#0x7,r0l.*
.*bset\t#0x6,@er1.*
.*bset\t#0x5,@0x12:8.*
.*bset\t#0x4,@0x1234:16.*
.*bset\t#0x3,@0x12345678:32.*
.*bset\tr7l,r0h.*
.*bset\tr6l,@er1.*
.*bset\tr5l,@0x12:8.*
.*bset\tr4l,@0x1234:16.*
.*bset\tr3l,@0x12345678:32.*
.*bclr\t#0x7,r0l.*
.*bclr\t#0x6,@er1.*
.*bclr\t#0x5,@0x12:8.*
.*bclr\t#0x4,@0x1234:16.*
.*bclr\t#0x3,@0x12345678:32.*
.*bclr\tr7h,r0h.*
.*bclr\tr6h,@er1.*
.*bclr\tr5h,@0x12:8.*
.*bclr\tr4h,@0x1234:16.*
.*bclr\tr3h,@0x12345678:32.*
.*$gdb_prompt $" { pass "bset_bclr_tests" }
	-re "$gdb_prompt $" { fail "bset_bclr_tests" }
	timeout { fail "(timeout) bset_bclr_tests" }
    }
}

proc all_bnot_btst_tests { } {
    global gdb_prompt
    global hex
    global decimal

    send_gdb "x/20i bnot_btst_tests\n"
    gdb_expect {
	-re "
.*bnot\t#0x7,r0l.*
.*bnot\t#0x6,@er1.*
.*bnot\t#0x5,@0x12:8.*
.*bnot\t#0x4,@0x1234:16.*
.*bnot\t#0x3,@0x12345678:32.*
.*bnot\tr7l,r0h.*
.*bnot\tr6l,@er1.*
.*bnot\tr5l,@0x12:8.*
.*bnot\tr4l,@0x1234:16.*
.*bnot\tr3l,@0x12345678:32.*
.*btst\t#0x7,r0l.*
.*btst\t#0x6,@er1.*
.*btst\t#0x5,@0x12:8.*
.*btst\t#0x4,@0x1234:16.*
.*btst\t#0x3,@0x12345678:32.*
.*btst\tr7h,r0h.*
.*btst\tr6h,@er1.*
.*btst\tr5h,@0x12:8.*
.*btst\tr4h,@0x1234:16.*
.*btst\tr3h,@0x12345678:32.*
.*$gdb_prompt $" { pass "bnot_btst_tests" }
	-re "$gdb_prompt $" { fail "bnot_btst_tests" }
	timeout { fail "(timeout) bnot_btst_tests" }
    }
}

proc all_band_bor_bxor_tests { } {
    global gdb_prompt
    global hex
    global decimal

    send_gdb "x/15i band_bor_bxor_tests\n"
    gdb_expect {
	-re "
.*band\t#0x7,r0l.*
.*band\t#0x6,@er1.*
.*band\t#0x5,@0x12:8.*
.*band\t#0x4,@0x1234:16.*
.*band\t#0x3,@0x12345678:32.*
.*bor\t#0x7,r0l.*
.*bor\t#0x6,@er1.*
.*bor\t#0x5,@0x12:8.*
.*bor\t#0x4,@0x1234:16.*
.*bor\t#0x3,@0x12345678:32.*
.*bxor\t#0x7,r0l.*
.*bxor\t#0x6,@er1.*
.*bxor\t#0x5,@0x12:8.*
.*bxor\t#0x4,@0x1234:16.*
.*bxor\t#0x3,@0x12345678:32.*
.*$gdb_prompt $" { pass "band_bor_bxor_tests" }
	-re "$gdb_prompt $" { fail "band_bor_bxor_tests" }
	timeout { fail "(timeout) band_bor_bxor_tests" }
    }
}

proc all_bld_bst_tests { } {
    global gdb_prompt
    global hex
    global decimal

    send_gdb "x/20i bld_bst_tests\n"
    gdb_expect {
	-re "
.*bld\t#0x7,r0l.*
.*bld\t#0x6,@er1.*
.*bld\t#0x5,@0x12:8.*
.*bld\t#0x4,@0x1234:16.*
.*bld\t#0x3,@0x12345678:32.*
.*bild\t#0x7,r0l.*
.*bild\t#0x6,@er1.*
.*bild\t#0x5,@0x12:8.*
.*bild\t#0x4,@0x1234:16.*
.*bild\t#0x3,@0x12345678:32.*
.*bst\t#0x7,r0l.*
.*bst\t#0x6,@er1.*
.*bst\t#0x5,@0x12:8.*
.*bst\t#0x4,@0x1234:16.*
.*bst\t#0x3,@0x12345678:32.*
.*bist\t#0x7,r0l.*
.*bist\t#0x6,@er1.*
.*bist\t#0x5,@0x12:8.*
.*bist\t#0x4,@0x1234:16.*
.*bist\t#0x3,@0x12345678:32.*
.*$gdb_prompt $" { pass "bld_bst_tests" }
	-re "$gdb_prompt $" { fail "bld_bst_tests" }
	timeout { fail "(timeout) bld_bst_tests" }
    }
}

proc all_branch_tests { } {
    global gdb_prompt
    global hex
    global decimal

    send_gdb "x/25i branch_tests\n"
    gdb_expect {
	-re "
.*bra\t(branch_tests|.-2 ).*
.*brn\t(branch_tests|.-4 ).*
.*bhi\t(branch_tests|.-6 ).*
.*bls\t(branch_tests|.-8 ).*
.*bcc\t(branch_tests|.-10 ).*
.*bcs\t(branch_tests|.-12 ).*
.*bne\t(branch_tests|.-14 ).*
.*beq\t(branch_tests|.-16 ).*
.*bvc\t(branch_tests|.-18 ).*
.*bvs\t(branch_tests|.-20 ).*
.*bpl\t(branch_tests|.-22 ).*
.*bmi\t(branch_tests|.-24 ).*
.*bge\t(branch_tests|.-26 ).*
.*blt\t(branch_tests|.-28 ).*
.*bgt\t(branch_tests|.-30 ).*
.*ble\t(branch_tests|.-32 ).*
.*jmp\t@er0.*
.*jmp\t@(branch_tests|0x).*
.*jmp\t@@0 \\((0x|)0\\).*
.*bsr\t(branch_tests|.-42 ).*
.*bsr\t(branch_tests|.-46 ).*
.*jsr\t@er0.*
.*jsr\t@(branch_tests|0x).*
.*jsr\t@@0 \\((0x|)0\\).*
.*rts.*
.*$gdb_prompt $" { pass "branch_tests" }
	-re "$gdb_prompt $" { fail "branch_tests" }
	timeout { fail "(timeout) branch_tests" }
    }
}

proc all_system_control_tests { } {
    global gdb_prompt
    global hex
    global decimal

    send_gdb "x/40i system_control_tests\n"
    gdb_expect {
	-re "
.*trapa\t#0x2.*
.*rte.*
.*sleep.*
.*ldc\t#0x12,ccr*.
.*ldc\tr3l,ccr.*
.*ldc\t@er0,ccr.*
.*ldc\t@\\(0x1234:16,er0\\),ccr.*
.*ldc\t@\\(0x12345678:32,er0\\),ccr.*
.*ldc\t@er1\\+,ccr.*
.*ldc\t@0x1234:16,ccr.*
.*ldc\t@0x12345678:32,ccr.*
.*stc\tccr,r3l.*
.*stc\tccr,@er0.*
.*stc\tccr,@\\(0x1234:16,er0\\).*
.*stc\tccr,@\\(0x12345678:32,er0\\).*
.*stc\tccr,@\\-er1.*
.*stc\tccr,@0x1234:16.*
.*stc\tccr,@0x12345678:32.*
.*andc\t#0x12,ccr.*
.*orc\t#0x34,ccr.*
.*xorc\t#0x56,ccr.*
.*ldc\t#0x12,exr*.
.*ldc\tr3l,exr.*
.*ldc\t@er0,exr.*
.*ldc\t@\\(0x1234:16,er0\\),exr.*
.*ldc\t@\\(0x12345678:32,er0\\),exr.*
.*ldc\t@er1\\+,exr.*
.*ldc\t@0x1234:16,exr.*
.*ldc\t@0x12345678:32,exr.*
.*stc\texr,r3l.*
.*stc\texr,@er0.*
.*stc\texr,@\\(0x1234:16,er0\\).*
.*stc\texr,@\\(0x12345678:32,er0\\).*
.*stc\texr,@\\-er1.*
.*stc\texr,@0x1234:16.*
.*stc\texr,@0x12345678:32.*
.*andc\t#0x12,exr.*
.*orc\t#0x34,exr.*
.*xorc\t#0x56,exr.*
.*nop.*
.*$gdb_prompt $" { pass "system_control_tests" }
	-re "$gdb_prompt $" { fail "system_control_tests" }
	timeout { fail "(timeout) system_control_tests" }
    }
}

proc all_block_data_transfer_tests { } {
    global gdb_prompt
    global hex
    global decimal

    send_gdb "x/2i block_data_transfer_tests\n"
    gdb_expect {
	-re "
.*eepmov.b.*
.*eepmov.w.*
.*$gdb_prompt $" { pass "block_data_transfer_tests" }
	-re "$gdb_prompt $" { fail "block_data_transfer_tests" }
	timeout { fail "(timeout) block_data_transfer_tests" }
    }
}

gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
all_set_machine_h8300s
gdb_load $binfile

# Data transfer
all_movb_tests
all_movw_tests
all_movl_tests
all_ldm_stm_tests
all_movfpe_movtpe_tests

# Arithmetic operations
all_add_sub_addx_subx_tests
all_inc_dec_adds_subs_tests
all_daa_das_tests
all_mul_div_tests
all_cmp_tests
all_neg_tests
all_ext_tests
all_tas_mac_tests

# Logic operations
all_logic_operations_tests

# Shift
all_sha_shl_tests
all_rot_rotx_tests

# Bit manipulation
all_bset_bclr_tests
all_bnot_btst_tests
all_band_bor_bxor_tests
all_bld_bst_tests

# Branch
all_branch_tests

# System control
all_system_control_tests

# Block data transfer
all_block_data_transfer_tests