From: Jeff Law Date: Fri, 5 Apr 1996 23:50:28 +0000 (+0000) Subject: * gas/h8300/{addsubh.s,bitops1h.s,bitops2h.s}: New h8300h tests. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=638c6a9ca486b6fa45796b35e45e19cad7cedefd;p=binutils-gdb.git * gas/h8300/{addsubh.s,bitops1h.s,bitops2h.s}: New h8300h tests. * gas/h8300/{bitops3h.s,bitops4h.s,branchesh.s}: New h8300h tests. * gas/h8300/{cbranchh.s,compareh.s,decimalh.s}: New h8300h tests. * gas/h8300/{divmulh.s,incdech.s,logicalh.s}: New h8300h tests. * gas/h8300/{misch.s,movbh.s,movwh.s}: New h8300h tests. * gas/h8300/{pushpoph.s,rotshifth.s}: New h8300h tests. * gas/h8300/h8300.exp: Run them. More tests. --- diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 1f50cdf463f..beefd09562f 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,5 +1,13 @@ Fri Apr 5 10:13:28 1996 Jeffrey A Law (law@cygnus.com) + * gas/h8300/{addsubh.s,bitops1h.s,bitops2h.s}: New h8300h tests. + * gas/h8300/{bitops3h.s,bitops4h.s,branchesh.s}: New h8300h tests. + * gas/h8300/{cbranchh.s,compareh.s,decimalh.s}: New h8300h tests. + * gas/h8300/{divmulh.s,incdech.s,logicalh.s}: New h8300h tests. + * gas/h8300/{misch.s,movbh.s,movwh.s}: New h8300h tests. + * gas/h8300/{pushpoph.s,rotshifth.s}: New h8300h tests. + * gas/h8300/h8300.exp: Run them. + * gas/h8300/{movb.s,movw.s}: Correct predecrement syntax. * gas/h8300/h8300.exp: Fix typos in bitops4 and movb tests. diff --git a/gas/testsuite/gas/h8300/.Sanitize b/gas/testsuite/gas/h8300/.Sanitize index 023bd4ed4e3..4c4e8755f49 100644 --- a/gas/testsuite/gas/h8300/.Sanitize +++ b/gas/testsuite/gas/h8300/.Sanitize @@ -26,28 +26,46 @@ Do-first: Things-to-keep: -CVS addsub.s +addsubh.s bitops1.s +bitops1h.s bitops2.s +bitops2h.s bitops3.s +bitops3h.s bitops4.s +bitops4h.s branches.s +branchesh.s cbranch.s +cbranchh.s cmpsi2.s compare.s +compareh.s decimal.s +decimalh.s divmul.s +divmulh.s +extendh.s ffxx1.d ffxx1.s h8300.exp incdec.s +incdech.s logical.s +logicalh.s misc.s +misch.s movb.s +movbh.s +movlh.s movw.s +movwh.s pushpop.s +pushpoph.s rotshift.s +rotshifth.s Things-to-lose: diff --git a/gas/testsuite/gas/h8300/addsubh.s b/gas/testsuite/gas/h8300/addsubh.s new file mode 100644 index 00000000000..1f885d3fc5f --- /dev/null +++ b/gas/testsuite/gas/h8300/addsubh.s @@ -0,0 +1,25 @@ + .h8300h + .text +h8300h_add_sub: + add.b #16,r1l + add.b r1h,r1l + add.w #32,r1 + add.w r1,r2 + add.l #64,er1 + add.l er1,er2 + adds #1,er4 + adds #2,er5 + adds #4,er6 + addx r0l,r1l + addx #16,r2h + sub.b r0l,r1l + sub.w #16,r1 + sub.w r0,r1 + sub.l #64,er1 + sub.l er1,er2 + subs #1,er4 + subs #2,er5 + subs #4,er6 + subx r0l,r1l + subx #16,r2h + diff --git a/gas/testsuite/gas/h8300/bitops1h.s b/gas/testsuite/gas/h8300/bitops1h.s new file mode 100644 index 00000000000..4139a590e8f --- /dev/null +++ b/gas/testsuite/gas/h8300/bitops1h.s @@ -0,0 +1,19 @@ + .h8300h + .text +h8300h_bit_ops_1: + band #0,r0l + band #0,@er0 + band #0,@64:8 + bclr #0,r0l + bclr #0,@er0 + bclr #0,@64:8 + bclr r1l,r0l + bclr r1l,@er0 + bclr r1l,@64:8 + biand #0,r0l + biand #0,@er0 + biand #0,@64:8 + bild #0,r0l + bild #0,@er0 + bild #0,@64:8 + diff --git a/gas/testsuite/gas/h8300/bitops2h.s b/gas/testsuite/gas/h8300/bitops2h.s new file mode 100644 index 00000000000..22be74e4b78 --- /dev/null +++ b/gas/testsuite/gas/h8300/bitops2h.s @@ -0,0 +1,16 @@ + .h8300h + .text +h8300h_bit_ops_2: + bior #0,r0l + bior #0,@er0 + bior #0,@64:8 + bist #0,r0l + bist #0,@er0 + bist #0,@64:8 + bixor #0,r0l + bixor #0,@er0 + bixor #0,@64:8 + bld #0,r0l + bld #0,@er0 + bld #0,@64:8 + diff --git a/gas/testsuite/gas/h8300/bitops3h.s b/gas/testsuite/gas/h8300/bitops3h.s new file mode 100644 index 00000000000..fdeda609080 --- /dev/null +++ b/gas/testsuite/gas/h8300/bitops3h.s @@ -0,0 +1,16 @@ + .h8300h + .text +h8300h_bit_ops_3: + bnot #0,r0l + bnot #0,@er0 + bnot #0,@64:8 + bnot r1l,r0l + bnot r1l,@er0 + bnot r1l,@64:8 + bset #0,r0l + bset #0,@er0 + bset #0,@64:8 + bset r1l,r0l + bset r1l,@er0 + bset r1l,@64:8 + diff --git a/gas/testsuite/gas/h8300/bitops4h.s b/gas/testsuite/gas/h8300/bitops4h.s new file mode 100644 index 00000000000..ed35e17dcbd --- /dev/null +++ b/gas/testsuite/gas/h8300/bitops4h.s @@ -0,0 +1,19 @@ + .h8300h + .text +h8300h_bit_ops_4: + bor #0,r0l + bor #0,@er0 + bor #0,@64:8 + bst #0,r0l + bst #0,@er0 + bst #0,@64:8 + btst #0,r0l + btst #0,@er0 + btst #0,@64:8 + btst r1l,r0l + btst r1l,@er0 + btst r1l,@64:8 + bxor #0,r0l + bxor #0,@er0 + bxor #0,@64:8 + diff --git a/gas/testsuite/gas/h8300/branchesh.s b/gas/testsuite/gas/h8300/branchesh.s new file mode 100644 index 00000000000..7cbc62f3e2b --- /dev/null +++ b/gas/testsuite/gas/h8300/branchesh.s @@ -0,0 +1,12 @@ + .h8300h + .text +h8300h_branches: + bsr h8300h_branches:8 + bsr h8300h_branches:16 + jmp h8300h_branches + jmp @er0 + jmp @@16:8 + jsr h8300h_branches + jsr @er0 + jsr @@16:8 + diff --git a/gas/testsuite/gas/h8300/cbranchh.s b/gas/testsuite/gas/h8300/cbranchh.s new file mode 100644 index 00000000000..3582bb162ce --- /dev/null +++ b/gas/testsuite/gas/h8300/cbranchh.s @@ -0,0 +1,43 @@ + .text +h8300h_cbranch: + bra h8300h_cbranch:8 + bt h8300h_cbranch:8 + brn h8300h_cbranch:8 + bf h8300h_cbranch:8 + bhi h8300h_cbranch:8 + bls h8300h_cbranch:8 + bcc h8300h_cbranch:8 + bhs h8300h_cbranch:8 + bcs h8300h_cbranch:8 + blo h8300h_cbranch:8 + bne h8300h_cbranch:8 + beq h8300h_cbranch:8 + bvc h8300h_cbranch:8 + bvs h8300h_cbranch:8 + bpl h8300h_cbranch:8 + bmi h8300h_cbranch:8 + bge h8300h_cbranch:8 + blt h8300h_cbranch:8 + bgt h8300h_cbranch:8 + ble h8300h_cbranch:8 + bra h8300h_cbranch:16 + bt h8300h_cbranch:16 + brn h8300h_cbranch:16 + bf h8300h_cbranch:16 + bhi h8300h_cbranch:16 + bls h8300h_cbranch:16 + bcc h8300h_cbranch:16 + bhs h8300h_cbranch:16 + bcs h8300h_cbranch:16 + blo h8300h_cbranch:16 + bne h8300h_cbranch:16 + beq h8300h_cbranch:16 + bvc h8300h_cbranch:16 + bvs h8300h_cbranch:16 + bpl h8300h_cbranch:16 + bmi h8300h_cbranch:16 + bge h8300h_cbranch:16 + blt h8300h_cbranch:16 + bgt h8300h_cbranch:16 + ble h8300h_cbranch:16 + diff --git a/gas/testsuite/gas/h8300/compareh.s b/gas/testsuite/gas/h8300/compareh.s new file mode 100644 index 00000000000..c81e88e0c20 --- /dev/null +++ b/gas/testsuite/gas/h8300/compareh.s @@ -0,0 +1,10 @@ + .h8300h + .text +h8300h_cmp: + cmp.b #0,r0l + cmp.b r0h,r0l + cmp.w #32,r0 + cmp.w r0,r1 + cmp.l #64,er0 + cmp.l er0,er1 + diff --git a/gas/testsuite/gas/h8300/decimalh.s b/gas/testsuite/gas/h8300/decimalh.s new file mode 100644 index 00000000000..939240568eb --- /dev/null +++ b/gas/testsuite/gas/h8300/decimalh.s @@ -0,0 +1,6 @@ + .h8300h + .text +h8300h_decimal: + daa r0l + das r0l + diff --git a/gas/testsuite/gas/h8300/divmulh.s b/gas/testsuite/gas/h8300/divmulh.s new file mode 100644 index 00000000000..db60f8f49aa --- /dev/null +++ b/gas/testsuite/gas/h8300/divmulh.s @@ -0,0 +1,12 @@ + .h8300h + .text +h8300h_div_mul: + divxu.b r0l,r1 + divxu.w r0,er1 + divxs.b r0l,r1 + divxs.w r0,er1 + mulxu.b r0l,r1 + mulxu.w r0,er1 + mulxs.b r0l,r1 + mulxs.w r0,er1 + diff --git a/gas/testsuite/gas/h8300/extendh.s b/gas/testsuite/gas/h8300/extendh.s new file mode 100644 index 00000000000..c034c833ee6 --- /dev/null +++ b/gas/testsuite/gas/h8300/extendh.s @@ -0,0 +1,8 @@ + .h8300h + .text +h8300h_extend: + exts.w r0 + exts.l er0 + extu.w r0 + extu.l er0 + diff --git a/gas/testsuite/gas/h8300/h8300.exp b/gas/testsuite/gas/h8300/h8300.exp index 3b9f26b0390..6adc28738bd 100644 --- a/gas/testsuite/gas/h8300/h8300.exp +++ b/gas/testsuite/gas/h8300/h8300.exp @@ -541,6 +541,709 @@ proc do_h8300_rotate_shift {} { if [expr $x == 8] then { pass $testname } else { fail $testname } } +proc do_h8300h_add_sub {} { + set testname "addsubh.s: h8300h add/sub tests" + set x 0 + + gas_start "addsubh.s" "-al" + + # Check each instruction bit pattern to verify it got + # assembled correctly. + while 1 { + expect { + -re " +\[0-9\]+ 0000 8910\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0002 0819\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0004 79110020\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0008 0912\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000a 7A110000\[^\n\]*\n +\[0-9\]+ +0040\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0010 0A12\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0012 0B04\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0014 0B85\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0016 0B96\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0018 0E89\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001a 9210\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001c 1889\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001e 79310010\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0022 1901\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0024 7A310000\[^\n\]*\n +\[0-9\]+ +0040\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 002a 1A92\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 002c 1B04\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 002e 1B85\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0030 1B96\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0032 1E89\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0034 B210\[^\n\]*\n" { set x [expr $x+1] } + timeout { perror "timeout\n; break } + eof { break } + } + } + + # This was intended to do any cleanup necessary. It kinda looks like it + # isn't needed, but just in case, please keep it in for now. + gas_finish + + # Did we find what we were looking for? If not, flunk it. + if [expr $x == 21] then { pass $testname } else { fail $testname } +} + +proc do_h8300h_logical {} { + set testname "logicalh.s: h8300h logical tests" + set x 0 + + gas_start "logicalh.s" "-al" + + # Check each instruction bit pattern to verify it got + # assembled correctly. + while 1 { + expect { + -re " +\[0-9\]+ 0000 E910\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0002 1691\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0004 79610020\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0008 6611\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000a 7A610000\[^\n\]*\n +\[0-9\]+ +0040\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0010 01F06611\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0014 0610\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0016 C810\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0018 1498\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001a 79410020\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001e 6411\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0020 7A410000\[^\n\]*\n +\[0-9\]+ +0040\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0026 01F06411\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 002a 0410\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 002c D810\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 002e 1589\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0030 79510020\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0034 6511\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0036 7A510000\[^\n\]*\n +\[0-9\]+ +0040\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 003c 01F06511\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0040 0510\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0042 1788\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0044 1790\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0046 17B0\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0048 1708\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 004a 1710\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 004c 1730\[^\n\]*\n" { set x [expr $x+1] } + timeout { perror "timeout\n; break } + eof { break } + } + } + + # This was intended to do any cleanup necessary. It kinda looks like it + # isn't needed, but just in case, please keep it in for now. + gas_finish + + # Did we find what we were looking for? If not, flunk it. + if [expr $x == 27] then { pass $testname } else { fail $testname } +} + +proc do_h8300h_cbranch {} { + set testname "cbranchh.s: h8300h conditional branch tests" + set x 0 + + gas_start "cbranchh.s" "-al" + + # Check each instruction bit pattern to verify it got + # assembled correctly. + while 1 { + expect { + -re " +\[0-9\]+ 0000 4000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0002 4000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0004 4100\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0006 4100\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0008 4200\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000a 4300\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000c 4400\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000e 4400\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0010 4500\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0012 4500\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0014 4600\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0016 4700\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0018 4800\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001a 4900\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001c 4A00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001e 4B00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0020 4C00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0022 4D00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0024 4E00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0026 4F00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0028 58000000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 002c 58000000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0030 58100000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0034 58100000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0038 58200000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 003c 58300000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0040 58400000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0044 58400000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0048 58500000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 004c 58500000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0050 58600000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0054 58700000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0058 58800000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 005c 58900000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0060 58A00000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0064 58B00000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0068 58C00000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 006c 58D00000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0070 58E00000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0074 58F00000\[^\n\]*\n" { set x [expr $x+1] } + timeout { perror "timeout\n; break } + eof { break } + } + } + + # This was intended to do any cleanup necessary. It kinda looks like it + # isn't needed, but just in case, please keep it in for now. + gas_finish + + # Did we find what we were looking for? If not, flunk it. + if [expr $x == 40] then { pass $testname } else { fail $testname } +} +proc do_h8300h_bitops1 {} { + set testname "bitops1h.s: h8300h bitops tests #1" + set x 0 + + gas_start "bitops1h.s" "-al" + + # Check each instruction bit pattern to verify it got + # assembled correctly. + while 1 { + expect { + -re " +\[0-9\]+ 0000 7608\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0002 7C007600\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0006 7E407600\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000a 7208\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000c 7D007200\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0010 7F407200\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0014 6298\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0016 7D006290\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001a 7F406290\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001e 7688\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0020 7C007680\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0024 7E407680\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0028 7788\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 002a 7C007780\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 002e 7E407780\[^\n\]*\n" { set x [expr $x+1] } + timeout { perror "timeout\n; break } + eof { break } + } + } + + # This was intended to do any cleanup necessary. It kinda looks like it + # isn't needed, but just in case, please keep it in for now. + gas_finish + + # Did we find what we were looking for? If not, flunk it. + if [expr $x == 15] then { pass $testname } else { fail $testname } +} + +proc do_h8300h_bitops2 {} { + set testname "bitops2h.s: h8300h bitops tests #2" + set x 0 + + gas_start "bitops2h.s" "-al" + + # Check each instruction bit pattern to verify it got + # assembled correctly. + while 1 { + expect { + -re " +\[0-9\]+ 0000 7488\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0002 7C007480\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0006 7E407480\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000a 6788\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000c 7D006780\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0010 7F406780\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0014 7588\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0016 7C007580\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001a 7E407580\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001e 7708\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0020 7C007700\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0024 7E407700\[^\n\]*\n" { set x [expr $x+1] } + timeout { perror "timeout\n; break } + eof { break } + } + } + + # This was intended to do any cleanup necessary. It kinda looks like it + # isn't needed, but just in case, please keep it in for now. + gas_finish + + # Did we find what we were looking for? If not, flunk it. + if [expr $x == 12] then { pass $testname } else { fail $testname } +} + +proc do_h8300h_bitops3 {} { + set testname "bitops3h.s: h8300h bitops tests #3" + set x 0 + + gas_start "bitops3h.s" "-al" + + # Check each instruction bit pattern to verify it got + # assembled correctly. + while 1 { + expect { + -re " +\[0-9\]+ 0000 7108\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0002 7D007100\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0006 7F407100\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000a 6198\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000c 7D006190\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0010 7F406190\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0014 7008\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0016 7D007000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001a 7F407000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001e 6098\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0020 7D006090\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0024 7F406090\[^\n\]*\n" { set x [expr $x+1] } + timeout { perror "timeout\n; break } + eof { break } + } + } + + # This was intended to do any cleanup necessary. It kinda looks like it + # isn't needed, but just in case, please keep it in for now. + gas_finish + + # Did we find what we were looking for? If not, flunk it. + if [expr $x == 12] then { pass $testname } else { fail $testname } +} + +proc do_h8300h_bitops4 {} { + set testname "bitops4h.s: h8300h bitops tests #4" + set x 0 + + gas_start "bitops4h.s" "-al" + + # Check each instruction bit pattern to verify it got + # assembled correctly. + while 1 { + expect { + -re " +\[0-9\]+ 0000 7408\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0002 7C007400\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0006 7E407400\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000a 6708\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000c 7D006700\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0010 7F406700\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0014 7308\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0016 7C007300\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001a 7E407300\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001e 6398\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0020 7C006390\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0024 7E406390\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0028 7508\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 002a 7C007500\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 002e 7E407500\[^\n\]*\n" { set x [expr $x+1] } + timeout { perror "timeout\n; break } + eof { break } + } + } + + # This was intended to do any cleanup necessary. It kinda looks like it + # isn't needed, but just in case, please keep it in for now. + gas_finish + + # Did we find what we were looking for? If not, flunk it. + if [expr $x == 15] then { pass $testname } else { fail $testname } +} + +proc do_h8300h_branches {} { + set testname "branchesh.s: h8300h branch tests" + set x 0 + + gas_start "branchesh.s" "-al" + + # Check each instruction bit pattern to verify it got + # assembled correctly. + while 1 { + expect { + -re " +\[0-9\]+ 0000 5500\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0002 5C000000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0006 5A000000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000a 5900\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000c 5B00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000e 5E000000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0012 5D00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0014 5F00\[^\n\]*\n" { set x [expr $x+1] } + timeout { perror "timeout\n; break } + eof { break } + } + } + + # This was intended to do any cleanup necessary. It kinda looks like it + # isn't needed, but just in case, please keep it in for now. + gas_finish + + # Did we find what we were looking for? If not, flunk it. + if [expr $x == 8] then { pass $testname } else { fail $testname } +} + +proc do_h8300h_compare {} { + set testname "compareh.s: h8300h compare tests" + set x 0 + + gas_start "compareh.s" "-al" + + # Check each instruction bit pattern to verify it got + # assembled correctly. + while 1 { + expect { + -re " +\[0-9\]+ 0000 A800\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0002 1C08\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0004 79200020\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0008 1D01\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000a 7A200000\[^\n\]*\n +\[0-9\]+ +0040\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0010 1F81\[^\n\]*\n" { set x [expr $x+1] } + timeout { perror "timeout\n; break } + eof { break } + } + } + + # This was intended to do any cleanup necessary. It kinda looks like it + # isn't needed, but just in case, please keep it in for now. + gas_finish + + # Did we find what we were looking for? If not, flunk it. + if [expr $x == 6] then { pass $testname } else { fail $testname } +} + +proc do_h8300h_decimal {} { + set testname "decimalh.s: h8300h decimal tests" + set x 0 + + gas_start "decimalh.s" "-al" + + # Check each instruction bit pattern to verify it got + # assembled correctly. + while 1 { + expect { + -re " +\[0-9\]+ 0000 0F08\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0002 1F08\[^\n\]*\n" { set x [expr $x+1] } + eof { break } + } + } + + # This was intended to do any cleanup necessary. It kinda looks like it + # isn't needed, but just in case, please keep it in for now. + gas_finish + + # Did we find what we were looking for? If not, flunk it. + if [expr $x == 2] then { pass $testname } else { fail $testname } +} + +proc do_h8300h_incdec {} { + set testname "incdech.s: h8300h incdec tests" + set x 0 + + gas_start "incdech.s" "-al" + + # Check each instruction bit pattern to verify it got + # assembled correctly. + while 1 { + expect { + -re " +\[0-9\]+ 0000 1A08\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0002 1B50\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0004 1BD0\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0006 1B70\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0008 1BF0\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000a 0A08\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000c 0B50\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000e 0BD0\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0010 0B70\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0012 0BF0\[^\n\]*\n" { set x [expr $x+1] } + eof { break } + } + } + + # This was intended to do any cleanup necessary. It kinda looks like it + # isn't needed, but just in case, please keep it in for now. + gas_finish + + # Did we find what we were looking for? If not, flunk it. + if [expr $x == 10] then { pass $testname } else { fail $testname } +} + +proc do_h8300h_divmul {} { + set testname "divmulh.s: h8300h divmul tests" + set x 0 + + gas_start "divmulh.s" "-al" + + # Check each instruction bit pattern to verify it got + # assembled correctly. + while 1 { + expect { + -re " +\[0-9\]+ 0000 5181\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0002 5301\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0004 01D05181\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0008 01D05301\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000c 5081\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000e 5201\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0010 01C05081\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0014 01C05201\[^\n\]*\n" { set x [expr $x+1] } + eof { break } + } + } + + # This was intended to do any cleanup necessary. It kinda looks like it + # isn't needed, but just in case, please keep it in for now. + gas_finish + + # Did we find what we were looking for? If not, flunk it. + if [expr $x == 8] then { pass $testname } else { fail $testname } +} + +proc do_h8300h_misc {} { + set testname "misch.s: h8300h misc tests" + set x 0 + + gas_start "misch.s" "-al" + + # Check each instruction bit pattern to verify it got + # assembled correctly. + while 1 { + expect { + -re " +\[0-9\]+ 0000 7B5C598F\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0004 0700\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0006 0308\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0008 01406900\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000c 01406F00\[^\n\]*\n +\[0-9\]+ +0010\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0012 01407800\[^\n\]*\n +\[0-9\]+ +6B200000\[^\n\]*\n +\[0-9\]+ +0020\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001c 01406D00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0020 01406B00\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0026 01406B20\[^\n\]*\n +\[0-9\]+ +00000000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 002e 0000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0030 5670\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0032 5470\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0034 0180\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0036 0208\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0038 01406980\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 003c 01406F80\[^\n\]*\n +\[0-9\]+ +0010\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0042 01407800\[^\n\]*\n +\[0-9\]+ +6BA00000\[^\n\]*\n +\[0-9\]+ +0020\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 004c 01406D80\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0050 01406B80\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0056 01406BA0\[^\n\]*\n +\[0-9\]+ +00000000\[^\n\]*\n" { set x [expr $x+1] } + eof { break } + } + } + + # This was intended to do any cleanup necessary. It kinda looks like it + # isn't needed, but just in case, please keep it in for now. + gas_finish + + # Did we find what we were looking for? If not, flunk it. + if [expr $x == 20] then { pass $testname } else { fail $testname } + + setup_xfail "h8300*-*-*" + fail "h8300 movfpe/movtpe tests" + + setup_xfail "h8300*-*-*" + fail "h8300 eepmov.w tests" +} + +proc do_h8300h_movb {} { + set testname "movbh.s: h8300h movb tests" + set x 0 + + gas_start "movbh.s" "-al" + + # Check each instruction bit pattern to verify it got + # assembled correctly. + while 1 { + expect { + -re " +\[0-9\]+ 0000 0C89\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0002 F810\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0004 6818\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0006 6E180010\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000a 78106A28\[^\n\]*\n +\[0-9\]+ +00000020\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0012 6C18\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0014 2810\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0016 6A080000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001a 6A280000\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0020 6898\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0022 6E980010\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0026 78106AA8\[^\n\]*\n +\[0-9\]+ +00000020\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 002e 6C98\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0030 3810\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0032 6A880000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0036 6AA80000\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n" { set x [expr $x+1] } + eof { break } + } + } + + # This was intended to do any cleanup necessary. It kinda looks like it + # isn't needed, but just in case, please keep it in for now. + gas_finish + + # Did we find what we were looking for? If not, flunk it. + if [expr $x == 16] then { pass $testname } else { fail $testname } +} + +proc do_h8300h_movw {} { + set testname "movwh.s: h8300h movw tests" + set x 0 + + gas_start "movwh.s" "-al" + + # Check each instruction bit pattern to verify it got + # assembled correctly. + while 1 { + expect { + -re " +\[0-9\]+ 0000 0D01\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0002 79000010\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0006 6910\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0008 6F100010\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000c 78106B20\[^\n\]*\n +\[0-9\]+ +00000020\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0014 6D10\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0016 6B000000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001a 6B200000\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0020 6990\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0022 6F900010\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0026 78106BA0\[^\n\]*\n +\[0-9\]+ +00000020\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 002e 6D90\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0030 6B800000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0034 6BA00000\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n" { set x [expr $x+1] } + eof { break } + } + } + + # This was intended to do any cleanup necessary. It kinda looks like it + # isn't needed, but just in case, please keep it in for now. + gas_finish + + # Did we find what we were looking for? If not, flunk it. + if [expr $x == 14] then { pass $testname } else { fail $testname } +} + +proc do_h8300h_movl {} { + set testname "movlh.s: h8300h movl tests" + set x 0 + + gas_start "movlh.s" "-al" + + # Check each instruction bit pattern to verify it got + # assembled correctly. + while 1 { + expect { + -re " +\[0-9\]+ 0000 0F81\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0002 7A000000\[^\n\]*\n +\[0-9\]+ +0040\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0008 01006910\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000c 01006F10\[^\n\]*\n +\[0-9\]+ +0010\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0012 01007810\[^\n\]*\n +\[0-9\]+ +6B200000\[^\n\]*\n +\[0-9\]+ +0020\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001c 01006D10\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0020 01006B00\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0026 01006B20\[^\n\]*\n +\[0-9\]+ +00000000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 002e 01006990\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0032 01006F90\[^\n\]*\n +\[0-9\]+ +0010\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0038 01007890\[^\n\]*\n +\[0-9\]+ +6BA00000\[^\n\]*\n +\[0-9\]+ +0020\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0042 01006D90\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0046 01006B80\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 004c 01006BA0\[^\n\]*\n +\[0-9\]+ +00000000\[^\n\]*\n" { set x [expr $x+1] } + eof { break } + } + } + + # This was intended to do any cleanup necessary. It kinda looks like it + # isn't needed, but just in case, please keep it in for now. + gas_finish + + # Did we find what we were looking for? If not, flunk it. + if [expr $x == 14] then { pass $testname } else { fail $testname } +} + +proc do_h8300h_pushpop {} { + set testname "pushpoph.s: h8300h pushpop tests" + set x 0 + + gas_start "pushpoph.s" "-al" + + # Check each instruction bit pattern to verify it got + # assembled correctly. + while 1 { + expect { + -re " +\[0-9\]+ 0000 6D70\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0002 01006D70\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0006 6DF0\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0008 01006DF0\[^\n\]*\n" { set x [expr $x+1] } + eof { break } + } + } + + # This was intended to do any cleanup necessary. It kinda looks like it + # isn't needed, but just in case, please keep it in for now. + gas_finish + + # Did we find what we were looking for? If not, flunk it. + if [expr $x == 4] then { pass $testname } else { fail $testname } +} + +proc do_h8300h_rotate_shift {} { + set testname "rotshifth.s: h8300h rotate and shift tests" + set x 0 + + gas_start "rotshifth.s" "-al" + + # Check each instruction bit pattern to verify it got + # assembled correctly. + while 1 { + expect { + -re " +\[0-9\]+ 0000 1288\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0002 1290\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0004 12B0\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0006 1388\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0008 1390\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000a 13B0\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000c 1208\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000e 1210\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0010 1230\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0012 1308\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0014 1310\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0016 1330\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0018 1088\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001a 1090\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001c 10B0\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001e 1188\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0020 1190\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0022 11B0\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0024 1008\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0026 1010\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0028 1030\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 002a 1108\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 002c 1110\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 002e 1130\[^\n\]*\n" { set x [expr $x+1] } + eof { break } + } + } + + # This was intended to do any cleanup necessary. It kinda looks like it + # isn't needed, but just in case, please keep it in for now. + gas_finish + + # Did we find what we were looking for? If not, flunk it. + if [expr $x == 24] then { pass $testname } else { fail $testname } +} + +proc do_h8300h_extend {} { + set testname "extendh.s: h8300h extend tests" + set x 0 + + gas_start "extendh.s" "-al" + + # Check each instruction bit pattern to verify it got + # assembled correctly. + while 1 { + expect { + -re " +\[0-9\]+ 0000 17D0\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0002 17F0\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0004 1750\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0006 1770\[^\n\]*\n" { set x [expr $x+1] } + eof { break } + } + } + + # This was intended to do any cleanup necessary. It kinda looks like it + # isn't needed, but just in case, please keep it in for now. + gas_finish + + # Did we find what we were looking for? If not, flunk it. + if [expr $x == 4] then { pass $testname } else { fail $testname } +} if [istarget h8300*-*-*] then { # Test the basic h8300 instruction parser @@ -562,6 +1265,26 @@ if [istarget h8300*-*-*] then { do_h8300_pushpop do_h8300_rotate_shift + # Now test the h8300h instruction parser + do_h8300h_add_sub + do_h8300h_logical + do_h8300h_cbranch + do_h8300h_bitops1 + do_h8300h_bitops2 + do_h8300h_bitops3 + do_h8300h_bitops4 + do_h8300h_branches + do_h8300h_compare + do_h8300h_decimal + do_h8300h_incdec + do_h8300h_divmul + do_h8300h_misc + do_h8300h_movb + do_h8300h_movw + do_h8300h_movl + do_h8300_pushpop + do_h8300h_rotate_shift + do_h8300h_extend # Now some random tests set svr4pic [expr [istarget *-*-elf*] || [istarget *-*-irix5*] ] diff --git a/gas/testsuite/gas/h8300/incdech.s b/gas/testsuite/gas/h8300/incdech.s new file mode 100644 index 00000000000..bb93fc54b36 --- /dev/null +++ b/gas/testsuite/gas/h8300/incdech.s @@ -0,0 +1,14 @@ + .h8300h + .text +h8300h_incdec: + dec.b r0l + dec.w #1,r0 + dec.w #2,r0 + dec.l #1,er0 + dec.l #2,er0 + inc.b r0l + inc.w #1,r0 + inc.w #2,r0 + inc.l #1,er0 + inc.l #2,er0 + diff --git a/gas/testsuite/gas/h8300/logicalh.s b/gas/testsuite/gas/h8300/logicalh.s new file mode 100644 index 00000000000..9e95f11d454 --- /dev/null +++ b/gas/testsuite/gas/h8300/logicalh.s @@ -0,0 +1,31 @@ + .h8300h + .text +h8300h_logical: + and.b #16,r1l + and.b r1l,r1h + and.w #32,r1 + and.w r1,r1 + and.l #64,er1 + and.l er1,er1 + andc #16,ccr + or.b #16,r0l + or.b r1l,r0l + or.w #32,r1 + or.w r1,r1 + or.l #64,er1 + or.l er1,er1 + orc #16,ccr + xor.b #16,r0l + xor.b r0l,r1l + xor.w #32,r1 + xor.w r1,r1 + xor.l #64,er1 + xor.l er1,er1 + xorc #16,ccr + neg.b r0l + neg.w r0 + neg.l er0 + not.b r0l + not.w r0 + not.l er0 + diff --git a/gas/testsuite/gas/h8300/misch.s b/gas/testsuite/gas/h8300/misch.s new file mode 100644 index 00000000000..4127c86695e --- /dev/null +++ b/gas/testsuite/gas/h8300/misch.s @@ -0,0 +1,27 @@ + .h8300h + .text +h8300h_misc: + eepmov.b +; eepmov.w + ldc.b #0,ccr + ldc.b r0l,ccr + ldc.w @er0,ccr + ldc.w @(16:16,er0),ccr + ldc.w @(32:24,er0),ccr + ldc.w @er0+,ccr + ldc.w @h8300h_misc:16,ccr + ldc.w @h8300h_misc:24,ccr +; movfpe 16:16,r0l +; movtpe r0l,16:16 + nop + rte + rts + sleep + stc.b ccr,r0l + stc.w ccr,@er0 + stc.w ccr,@(16:16,er0) + stc.w ccr,@(32:24,er0) + stc.w ccr,@-er0 + stc.w ccr,@h8300h_misc:16 + stc.w ccr,@h8300h_misc:24 + diff --git a/gas/testsuite/gas/h8300/movbh.s b/gas/testsuite/gas/h8300/movbh.s new file mode 100644 index 00000000000..7d711f8512e --- /dev/null +++ b/gas/testsuite/gas/h8300/movbh.s @@ -0,0 +1,20 @@ + .h8300h + .text +h8300h_movb: + mov.b r0l,r1l + mov.b #16,r0l + mov.b @er1,r0l + mov.b @(16:16,er1),r0l + mov.b @(32:24,er1),r0l + mov.b @er1+,r0l + mov.b @16:8,r0l + mov.b @h8300h_movb:16,r0l + mov.b @h8300h_movb:24,r0l + mov.b r0l,@er1 + mov.b r0l,@(16:16,er1) + mov.b r0l,@(32:24,er1) + mov.b r0l,@-er1 + mov.b r0l,@16:8 + mov.b r0l,@h8300h_movb:16 + mov.b r0l,@h8300h_movb:24 + diff --git a/gas/testsuite/gas/h8300/movlh.s b/gas/testsuite/gas/h8300/movlh.s new file mode 100644 index 00000000000..0cc78e8d361 --- /dev/null +++ b/gas/testsuite/gas/h8300/movlh.s @@ -0,0 +1,18 @@ + .h8300h + .text +h8300h_movl: + mov.l er0,er1 + mov.l #64,er0 + mov.l @er1,er0 + mov.l @(16:16,er1),er0 + mov.l @(32:24,er1),er0 + mov.l @er1+,er0 + mov.l @h8300h_movl:16,er0 + mov.l @h8300h_movl:24,er0 + mov.l er0,@er1 + mov.l er0,@(16:16,er1) + mov.l er0,@(32:24,er1) + mov.l er0,@-er1 + mov.l er0,@h8300h_movl:16 + mov.l er0,@h8300h_movl:24 + diff --git a/gas/testsuite/gas/h8300/movwh.s b/gas/testsuite/gas/h8300/movwh.s new file mode 100644 index 00000000000..595057cb3d7 --- /dev/null +++ b/gas/testsuite/gas/h8300/movwh.s @@ -0,0 +1,18 @@ + .h8300h + .text +h8300h_movw: + mov.w r0,r1 + mov.w #16,r0 + mov.w @er1,r0 + mov.w @(16:16,er1),r0 + mov.w @(32:24,er1),r0 + mov.w @er1+,r0 + mov.w @h8300h_movw:16,r0 + mov.w @h8300h_movw:24,r0 + mov.w r0,@er1 + mov.w r0,@(16:16,er1) + mov.w r0,@(32:24,er1) + mov.w r0,@-er1 + mov.w r0,@h8300h_movw:16 + mov.w r0,@h8300h_movw:24 + diff --git a/gas/testsuite/gas/h8300/pushpoph.s b/gas/testsuite/gas/h8300/pushpoph.s new file mode 100644 index 00000000000..6049639f567 --- /dev/null +++ b/gas/testsuite/gas/h8300/pushpoph.s @@ -0,0 +1,8 @@ + .h8300h + .text +h8300h_push_pop: + pop.w r0 + pop.l er0 + push.w r0 + push.l er0 + diff --git a/gas/testsuite/gas/h8300/rotshifth.s b/gas/testsuite/gas/h8300/rotshifth.s new file mode 100644 index 00000000000..c7abe40a28f --- /dev/null +++ b/gas/testsuite/gas/h8300/rotshifth.s @@ -0,0 +1,27 @@ + .h8300h + .text +h8300h_rotate_shift: + rotl.b r0l + rotl.w r0 + rotl.l er0 + rotr.b r0l + rotr.w r0 + rotr.l er0 + rotxl.b r0l + rotxl.w r0 + rotxl.l er0 + rotxr.b r0l + rotxr.w r0 + rotxr.l er0 + shal.b r0l + shal.w r0 + shal.l er0 + shar.b r0l + shar.w r0 + shar.l er0 + shll.b r0l + shll.w r0 + shll.l er0 + shlr.b r0l + shlr.w r0 + shlr.l er0