Home | History | Annotate | Download | only in h8300
      1 # Copyright (C) 2012-2014 Free Software Foundation, Inc.
      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
      5 # the Free Software Foundation; either version 3 of the License, or
      6 # (at your option) any later version.
      7 #
      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.
     12 #
     13 # You should have received a copy of the GNU General Public License
     14 # along with this program; if not, write to the Free Software
     15 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
     16 
     17 #
     18 # Some H8/300 tests
     19 #
     20 proc do_h8300_add_sub {} {
     21     set testname "addsub.s: h8300 add/sub tests"
     22     set x 0
     23 
     24     gas_start "addsub.s" "-al"
     25 
     26     # Check each instruction bit pattern to verify it got
     27     # assembled correctly.
     28     while 1 {
     29 	expect {
     30 	    -re " +\[0-9\]+ 0000 8910\[^\n\]*\n"   { set x [expr $x+1] }
     31 	    -re " +\[0-9\]+ 0002 0819\[^\n\]*\n"   { set x [expr $x+1] }
     32 	    -re " +\[0-9\]+ 0004 0912\[^\n\]*\n"   { set x [expr $x+1] }
     33 	    -re " +\[0-9\]+ 0006 0B04\[^\n\]*\n"   { set x [expr $x+1] }
     34 	    -re " +\[0-9\]+ 0008 0B85\[^\n\]*\n"   { set x [expr $x+1] }
     35 	    -re " +\[0-9\]+ 000a 0E89\[^\n\]*\n"   { set x [expr $x+1] }
     36 	    -re " +\[0-9\]+ 000c 9210\[^\n\]*\n"   { set x [expr $x+1] }
     37 	    -re " +\[0-9\]+ 000e 1889\[^\n\]*\n"   { set x [expr $x+1] }
     38 	    -re " +\[0-9\]+ 0010 1901\[^\n\]*\n"   { set x [expr $x+1] }
     39 	    -re " +\[0-9\]+ 0012 1B04\[^\n\]*\n"   { set x [expr $x+1] }
     40 	    -re " +\[0-9\]+ 0014 1B85\[^\n\]*\n"   { set x [expr $x+1] }
     41 	    -re " +\[0-9\]+ 0016 1E89\[^\n\]*\n"   { set x [expr $x+1] }
     42 	    -re " +\[0-9\]+ 0018 B210\[^\n\]*\n"   { set x [expr $x+1] }
     43 	    timeout 				{ perror "timeout\n; break }
     44 	    eof					{ break }
     45 	}
     46     }
     47 
     48     # This was intended to do any cleanup necessary.  It kinda looks like it
     49     # isn't needed, but just in case, please keep it in for now.
     50     gas_finish
     51 
     52     # Did we find what we were looking for?  If not, flunk it.
     53     if [expr $x == 13] then { pass $testname } else { fail $testname }
     54 }
     55 
     56 proc do_h8300_logical {} {
     57     set testname "logical.s: h8300 logical tests"
     58     set x 0
     59 
     60     gas_start "logical.s" "-al"
     61 
     62     # Check each instruction bit pattern to verify it got
     63     # assembled correctly.
     64     while 1 {
     65 	expect {
     66 	    -re " +\[0-9\]+ 0000 E910\[^\n\]*\n"   { set x [expr $x+1] }
     67 	    -re " +\[0-9\]+ 0002 1691\[^\n\]*\n"   { set x [expr $x+1] }
     68 	    -re " +\[0-9\]+ 0004 0610\[^\n\]*\n"   { set x [expr $x+1] }
     69 	    -re " +\[0-9\]+ 0006 C810\[^\n\]*\n"   { set x [expr $x+1] }
     70 	    -re " +\[0-9\]+ 0008 1498\[^\n\]*\n"   { set x [expr $x+1] }
     71 	    -re " +\[0-9\]+ 000a 0410\[^\n\]*\n"   { set x [expr $x+1] }
     72 	    -re " +\[0-9\]+ 000c D810\[^\n\]*\n"   { set x [expr $x+1] }
     73 	    -re " +\[0-9\]+ 000e 1589\[^\n\]*\n"   { set x [expr $x+1] }
     74 	    -re " +\[0-9\]+ 0010 0510\[^\n\]*\n"   { set x [expr $x+1] }
     75 	    -re " +\[0-9\]+ 0012 1788\[^\n\]*\n"   { set x [expr $x+1] }
     76 	    -re " +\[0-9\]+ 0014 1708\[^\n\]*\n"   { set x [expr $x+1] }
     77 	    timeout 				{ perror "timeout\n; break }
     78 	    eof					{ break }
     79 	}
     80     }
     81 
     82     # This was intended to do any cleanup necessary.  It kinda looks like it
     83     # isn't needed, but just in case, please keep it in for now.
     84     gas_finish
     85 
     86     # Did we find what we were looking for?  If not, flunk it.
     87     if [expr $x == 11] then { pass $testname } else { fail $testname }
     88 }
     89 
     90 proc do_h8300_cbranch {} {
     91     set testname "cbranch.s: h8300 conditional branch tests"
     92     set x 0
     93 
     94     gas_start "cbranch.s" "-al"
     95 
     96     # Check each instruction bit pattern to verify it got
     97     # assembled correctly.
     98     while 1 {
     99 	expect {
    100 	    -re " +\[0-9\]+ 0000 4000\[^\n\]*\n"   { set x [expr $x+1] }
    101 	    -re " +\[0-9\]+ 0002 4000\[^\n\]*\n"   { set x [expr $x+1] }
    102 	    -re " +\[0-9\]+ 0004 4100\[^\n\]*\n"   { set x [expr $x+1] }
    103 	    -re " +\[0-9\]+ 0006 4100\[^\n\]*\n"   { set x [expr $x+1] }
    104 	    -re " +\[0-9\]+ 0008 4200\[^\n\]*\n"   { set x [expr $x+1] }
    105 	    -re " +\[0-9\]+ 000a 4300\[^\n\]*\n"   { set x [expr $x+1] }
    106 	    -re " +\[0-9\]+ 000c 4400\[^\n\]*\n"   { set x [expr $x+1] }
    107 	    -re " +\[0-9\]+ 000e 4400\[^\n\]*\n"   { set x [expr $x+1] }
    108 	    -re " +\[0-9\]+ 0010 4500\[^\n\]*\n"   { set x [expr $x+1] }
    109 	    -re " +\[0-9\]+ 0012 4500\[^\n\]*\n"   { set x [expr $x+1] }
    110 	    -re " +\[0-9\]+ 0014 4600\[^\n\]*\n"   { set x [expr $x+1] }
    111 	    -re " +\[0-9\]+ 0016 4700\[^\n\]*\n"   { set x [expr $x+1] }
    112 	    -re " +\[0-9\]+ 0018 4800\[^\n\]*\n"   { set x [expr $x+1] }
    113 	    -re " +\[0-9\]+ 001a 4900\[^\n\]*\n"   { set x [expr $x+1] }
    114 	    -re " +\[0-9\]+ 001c 4A00\[^\n\]*\n"   { set x [expr $x+1] }
    115 	    -re " +\[0-9\]+ 001e 4B00\[^\n\]*\n"   { set x [expr $x+1] }
    116 	    -re " +\[0-9\]+ 0020 4C00\[^\n\]*\n"   { set x [expr $x+1] }
    117 	    -re " +\[0-9\]+ 0022 4D00\[^\n\]*\n"   { set x [expr $x+1] }
    118 	    -re " +\[0-9\]+ 0024 4E00\[^\n\]*\n"   { set x [expr $x+1] }
    119 	    -re " +\[0-9\]+ 0026 4F00\[^\n\]*\n"   { set x [expr $x+1] }
    120 	    timeout 				{ perror "timeout\n; break }
    121 	    eof					{ break }
    122 	}
    123     }
    124 
    125     # This was intended to do any cleanup necessary.  It kinda looks like it
    126     # isn't needed, but just in case, please keep it in for now.
    127     gas_finish
    128 
    129     # Did we find what we were looking for?  If not, flunk it.
    130     if [expr $x == 20] then { pass $testname } else { fail $testname }
    131 }
    132 
    133 proc do_h8300_bitops1 {} {
    134     set testname "bitops1.s: h8300 bitops tests #1"
    135     set x 0
    136 
    137     gas_start "bitops1.s" "-al"
    138 
    139     # Check each instruction bit pattern to verify it got
    140     # assembled correctly.
    141     while 1 {
    142 	expect {
    143 	    -re " +\[0-9\]+ 0000 7608\[^\n\]*\n"   { set x [expr $x+1] }
    144 	    -re " +\[0-9\]+ 0002 7C007600\[^\n\]*\n"   { set x [expr $x+1] }
    145 	    -re " +\[0-9\]+ 0006 7E407600\[^\n\]*\n"   { set x [expr $x+1] }
    146 	    -re " +\[0-9\]+ 000a 7208\[^\n\]*\n"   { set x [expr $x+1] }
    147 	    -re " +\[0-9\]+ 000c 7D007200\[^\n\]*\n"   { set x [expr $x+1] }
    148 	    -re " +\[0-9\]+ 0010 7F407200\[^\n\]*\n"   { set x [expr $x+1] }
    149 	    -re " +\[0-9\]+ 0014 6298\[^\n\]*\n"   { set x [expr $x+1] }
    150 	    -re " +\[0-9\]+ 0016 7D006290\[^\n\]*\n"   { set x [expr $x+1] }
    151 	    -re " +\[0-9\]+ 001a 7F406290\[^\n\]*\n"   { set x [expr $x+1] }
    152 	    -re " +\[0-9\]+ 001e 7688\[^\n\]*\n"   { set x [expr $x+1] }
    153 	    -re " +\[0-9\]+ 0020 7C007680\[^\n\]*\n"   { set x [expr $x+1] }
    154 	    -re " +\[0-9\]+ 0024 7E407680\[^\n\]*\n"   { set x [expr $x+1] }
    155 	    -re " +\[0-9\]+ 0028 7788\[^\n\]*\n"   { set x [expr $x+1] }
    156 	    -re " +\[0-9\]+ 002a 7C007780\[^\n\]*\n"   { set x [expr $x+1] }
    157 	    -re " +\[0-9\]+ 002e 7E407780\[^\n\]*\n"   { set x [expr $x+1] }
    158 	    timeout 				{ perror "timeout\n; break }
    159 	    eof					{ break }
    160 	}
    161     }
    162 
    163     # This was intended to do any cleanup necessary.  It kinda looks like it
    164     # isn't needed, but just in case, please keep it in for now.
    165     gas_finish
    166 
    167     # Did we find what we were looking for?  If not, flunk it.
    168     if [expr $x == 15] then { pass $testname } else { fail $testname }
    169 }
    170 
    171 proc do_h8300_bitops2 {} {
    172     set testname "bitops2.s: h8300 bitops tests #2"
    173     set x 0
    174 
    175     gas_start "bitops2.s" "-al"
    176 
    177     # Check each instruction bit pattern to verify it got
    178     # assembled correctly.
    179     while 1 {
    180 	expect {
    181 	    -re " +\[0-9\]+ 0000 7488\[^\n\]*\n"   { set x [expr $x+1] }
    182 	    -re " +\[0-9\]+ 0002 7C007480\[^\n\]*\n"   { set x [expr $x+1] }
    183 	    -re " +\[0-9\]+ 0006 7E407480\[^\n\]*\n"   { set x [expr $x+1] }
    184 	    -re " +\[0-9\]+ 000a 6788\[^\n\]*\n"   { set x [expr $x+1] }
    185 	    -re " +\[0-9\]+ 000c 7D006780\[^\n\]*\n"   { set x [expr $x+1] }
    186 	    -re " +\[0-9\]+ 0010 7F406780\[^\n\]*\n"   { set x [expr $x+1] }
    187 	    -re " +\[0-9\]+ 0014 7588\[^\n\]*\n"   { set x [expr $x+1] }
    188 	    -re " +\[0-9\]+ 0016 7C007580\[^\n\]*\n"   { set x [expr $x+1] }
    189 	    -re " +\[0-9\]+ 001a 7E407580\[^\n\]*\n"   { set x [expr $x+1] }
    190 	    -re " +\[0-9\]+ 001e 7708\[^\n\]*\n"   { set x [expr $x+1] }
    191 	    -re " +\[0-9\]+ 0020 7C007700\[^\n\]*\n"   { set x [expr $x+1] }
    192 	    -re " +\[0-9\]+ 0024 7E407700\[^\n\]*\n"   { set x [expr $x+1] }
    193 	    timeout 				{ perror "timeout\n; break }
    194 	    eof					{ break }
    195 	}
    196     }
    197 
    198     # This was intended to do any cleanup necessary.  It kinda looks like it
    199     # isn't needed, but just in case, please keep it in for now.
    200     gas_finish
    201 
    202     # Did we find what we were looking for?  If not, flunk it.
    203     if [expr $x == 12] then { pass $testname } else { fail $testname }
    204 }
    205 
    206 proc do_h8300_bitops3 {} {
    207     set testname "bitops3.s: h8300 bitops tests #3"
    208     set x 0
    209 
    210     gas_start "bitops3.s" "-al"
    211 
    212     # Check each instruction bit pattern to verify it got
    213     # assembled correctly.
    214     while 1 {
    215 	expect {
    216 	    -re " +\[0-9\]+ 0000 7108\[^\n\]*\n"   { set x [expr $x+1] }
    217 	    -re " +\[0-9\]+ 0002 7D007100\[^\n\]*\n"   { set x [expr $x+1] }
    218 	    -re " +\[0-9\]+ 0006 7F407100\[^\n\]*\n"   { set x [expr $x+1] }
    219 	    -re " +\[0-9\]+ 000a 6198\[^\n\]*\n"   { set x [expr $x+1] }
    220 	    -re " +\[0-9\]+ 000c 7D006190\[^\n\]*\n"   { set x [expr $x+1] }
    221 	    -re " +\[0-9\]+ 0010 7F406190\[^\n\]*\n"   { set x [expr $x+1] }
    222 	    -re " +\[0-9\]+ 0014 7008\[^\n\]*\n"   { set x [expr $x+1] }
    223 	    -re " +\[0-9\]+ 0016 7D007000\[^\n\]*\n"   { set x [expr $x+1] }
    224 	    -re " +\[0-9\]+ 001a 7F407000\[^\n\]*\n"   { set x [expr $x+1] }
    225 	    -re " +\[0-9\]+ 001e 6098\[^\n\]*\n"   { set x [expr $x+1] }
    226 	    -re " +\[0-9\]+ 0020 7D006090\[^\n\]*\n"   { set x [expr $x+1] }
    227 	    -re " +\[0-9\]+ 0024 7F406090\[^\n\]*\n"   { set x [expr $x+1] }
    228 	    timeout 				{ perror "timeout\n; break }
    229 	    eof					{ break }
    230 	}
    231     }
    232 
    233     # This was intended to do any cleanup necessary.  It kinda looks like it
    234     # isn't needed, but just in case, please keep it in for now.
    235     gas_finish
    236 
    237     # Did we find what we were looking for?  If not, flunk it.
    238     if [expr $x == 12] then { pass $testname } else { fail $testname }
    239 }
    240 
    241 proc do_h8300_bitops4 {} {
    242     set testname "bitops4.s: h8300 bitops tests #4"
    243     set x 0
    244 
    245     gas_start "bitops4.s" "-al"
    246 
    247     # Check each instruction bit pattern to verify it got
    248     # assembled correctly.
    249     while 1 {
    250 	expect {
    251 	    -re " +\[0-9\]+ 0000 7408\[^\n\]*\n"   { set x [expr $x+1] }
    252 	    -re " +\[0-9\]+ 0002 7C007400\[^\n\]*\n"   { set x [expr $x+1] }
    253 	    -re " +\[0-9\]+ 0006 7E407400\[^\n\]*\n"   { set x [expr $x+1] }
    254 	    -re " +\[0-9\]+ 000a 6708\[^\n\]*\n"   { set x [expr $x+1] }
    255 	    -re " +\[0-9\]+ 000c 7D006700\[^\n\]*\n"   { set x [expr $x+1] }
    256 	    -re " +\[0-9\]+ 0010 7F406700\[^\n\]*\n"   { set x [expr $x+1] }
    257 	    -re " +\[0-9\]+ 0014 7308\[^\n\]*\n"   { set x [expr $x+1] }
    258 	    -re " +\[0-9\]+ 0016 7C007300\[^\n\]*\n"   { set x [expr $x+1] }
    259 	    -re " +\[0-9\]+ 001a 7E407300\[^\n\]*\n"   { set x [expr $x+1] }
    260 	    -re " +\[0-9\]+ 001e 6398\[^\n\]*\n"   { set x [expr $x+1] }
    261 	    -re " +\[0-9\]+ 0020 7C006390\[^\n\]*\n"   { set x [expr $x+1] }
    262 	    -re " +\[0-9\]+ 0024 7E406390\[^\n\]*\n"   { set x [expr $x+1] }
    263 	    -re " +\[0-9\]+ 0028 7508\[^\n\]*\n"   { set x [expr $x+1] }
    264 	    -re " +\[0-9\]+ 002a 7C007500\[^\n\]*\n"   { set x [expr $x+1] }
    265 	    -re " +\[0-9\]+ 002e 7E407500\[^\n\]*\n"   { set x [expr $x+1] }
    266 	    timeout 				{ perror "timeout\n; break }
    267 	    eof					{ break }
    268 	}
    269     }
    270 
    271     # This was intended to do any cleanup necessary.  It kinda looks like it
    272     # isn't needed, but just in case, please keep it in for now.
    273     gas_finish
    274 
    275     # Did we find what we were looking for?  If not, flunk it.
    276     if [expr $x == 15] then { pass $testname } else { fail $testname }
    277 }
    278 
    279 proc do_h8300_branch {} {
    280     set testname "branch.s: h8300 branch tests"
    281     set x 0
    282 
    283     gas_start "branch.s" "-al"
    284 
    285     # Check each instruction bit pattern to verify it got
    286     # assembled correctly.
    287     while 1 {
    288 	expect {
    289 	    -re " +\[0-9\]+ 0000 5500\[^\n\]*\n"   { set x [expr $x+1] }
    290 	    -re " +\[0-9\]+ 0002 5A000000\[^\n\]*\n"   { set x [expr $x+1] }
    291 	    -re " +\[0-9\]+ 0006 5900\[^\n\]*\n"   { set x [expr $x+1] }
    292 	    -re " +\[0-9\]+ 0008 5B00\[^\n\]*\n"   { set x [expr $x+1] }
    293 	    -re " +\[0-9\]+ 000a 5E000000\[^\n\]*\n"   { set x [expr $x+1] }
    294 	    -re " +\[0-9\]+ 000e 5D00\[^\n\]*\n"   { set x [expr $x+1] }
    295 	    -re " +\[0-9\]+ 0010 5F00\[^\n\]*\n"   { set x [expr $x+1] }
    296 	    timeout 				{ perror "timeout\n; break }
    297 	    eof					{ break }
    298 	}
    299     }
    300 
    301     # This was intended to do any cleanup necessary.  It kinda looks like it
    302     # isn't needed, but just in case, please keep it in for now.
    303     gas_finish
    304 
    305     # Did we find what we were looking for?  If not, flunk it.
    306     if [expr $x == 7] then { pass $testname } else { fail $testname }
    307 }
    308 
    309 proc do_h8300_compare {} {
    310     set testname "compare.s: h8300 compare tests"
    311     set x 0
    312 
    313     gas_start "compare.s" "-al"
    314 
    315     # Check each instruction bit pattern to verify it got
    316     # assembled correctly.
    317     while 1 {
    318 	expect {
    319 	    -re " +\[0-9\]+ 0000 A800\[^\n\]*\n"   { set x [expr $x+1] }
    320 	    -re " +\[0-9\]+ 0002 1C08\[^\n\]*\n"   { set x [expr $x+1] }
    321 	    -re " +\[0-9\]+ 0004 1D01\[^\n\]*\n"   { set x [expr $x+1] }
    322 	    timeout 				{ perror "timeout\n; break }
    323 	    eof					{ break }
    324 	}
    325     }
    326 
    327     # This was intended to do any cleanup necessary.  It kinda looks like it
    328     # isn't needed, but just in case, please keep it in for now.
    329     gas_finish
    330 
    331     # Did we find what we were looking for?  If not, flunk it.
    332     if [expr $x == 3] then { pass $testname } else { fail $testname }
    333 }
    334 
    335 proc do_h8300_decimal {} {
    336     set testname "decimal.s: h8300 decimal tests"
    337     set x 0
    338 
    339     gas_start "decimal.s" "-al"
    340 
    341     # Check each instruction bit pattern to verify it got
    342     # assembled correctly.
    343     while 1 {
    344 	expect {
    345 	    -re " +\[0-9\]+ 0000 0F08\[^\n\]*\n"   { set x [expr $x+1] }
    346 	    -re " +\[0-9\]+ 0002 1F08\[^\n\]*\n"   { set x [expr $x+1] }
    347 	    eof					{ break }
    348 	}
    349     }
    350 
    351     # This was intended to do any cleanup necessary.  It kinda looks like it
    352     # isn't needed, but just in case, please keep it in for now.
    353     gas_finish
    354 
    355     # Did we find what we were looking for?  If not, flunk it.
    356     if [expr $x == 2] then { pass $testname } else { fail $testname }
    357 }
    358 
    359 proc do_h8300_incdec {} {
    360     set testname "incdec.s: h8300 incdec tests"
    361     set x 0
    362 
    363     gas_start "incdec.s" "-al"
    364 
    365     # Check each instruction bit pattern to verify it got
    366     # assembled correctly.
    367     while 1 {
    368 	expect {
    369 	    -re " +\[0-9\]+ 0000 1A08\[^\n\]*\n"   { set x [expr $x+1] }
    370 	    -re " +\[0-9\]+ 0002 0A08\[^\n\]*\n"   { set x [expr $x+1] }
    371 	    eof					{ break }
    372 	}
    373     }
    374 
    375     # This was intended to do any cleanup necessary.  It kinda looks like it
    376     # isn't needed, but just in case, please keep it in for now.
    377     gas_finish
    378 
    379     # Did we find what we were looking for?  If not, flunk it.
    380     if [expr $x == 2] then { pass $testname } else { fail $testname }
    381 }
    382 
    383 proc do_h8300_divmul {} {
    384     set testname "divmul.s: h8300 divmul tests"
    385     set x 0
    386 
    387     gas_start "divmul.s" "-al"
    388 
    389     # Check each instruction bit pattern to verify it got
    390     # assembled correctly.
    391     while 1 {
    392 	expect {
    393 	    -re " +\[0-9\]+ 0000 5181\[^\n\]*\n"   { set x [expr $x+1] }
    394 	    -re " +\[0-9\]+ 0002 5081\[^\n\]*\n"   { set x [expr $x+1] }
    395 	    eof					{ break }
    396 	}
    397     }
    398 
    399     # This was intended to do any cleanup necessary.  It kinda looks like it
    400     # isn't needed, but just in case, please keep it in for now.
    401     gas_finish
    402 
    403     # Did we find what we were looking for?  If not, flunk it.
    404     if [expr $x == 2] then { pass $testname } else { fail $testname }
    405 }
    406 
    407 proc do_h8300_misc {} {
    408     set testname "misc.s: h8300 misc tests"
    409     set x 0
    410 
    411     gas_start "misc.s" "-al"
    412 
    413     # Check each instruction bit pattern to verify it got
    414     # assembled correctly.
    415     while 1 {
    416 	expect {
    417 	    -re " +\[0-9\]+ 0000 7B5C598F\[^\n\]*\n"   { set x [expr $x+1] }
    418 	    -re " +\[0-9\]+ 0004 0700\[^\n\]*\n"   { set x [expr $x+1] }
    419 	    -re " +\[0-9\]+ 0006 0308\[^\n\]*\n"   { set x [expr $x+1] }
    420 	    -re " +\[0-9\]+ 0008 0000\[^\n\]*\n"   { set x [expr $x+1] }
    421 	    -re " +\[0-9\]+ 000a 5670\[^\n\]*\n"   { set x [expr $x+1] }
    422 	    -re " +\[0-9\]+ 000c 5470\[^\n\]*\n"   { set x [expr $x+1] }
    423 	    -re " +\[0-9\]+ 000e 0180\[^\n\]*\n"   { set x [expr $x+1] }
    424 	    -re " +\[0-9\]+ 0010 0208\[^\n\]*\n"   { set x [expr $x+1] }
    425 	    eof					{ break }
    426 	}
    427     }
    428 
    429     # This was intended to do any cleanup necessary.  It kinda looks like it
    430     # isn't needed, but just in case, please keep it in for now.
    431     gas_finish
    432 
    433     # Did we find what we were looking for?  If not, flunk it.
    434     if [expr $x == 8] then { pass $testname } else { fail $testname }
    435 
    436     setup_xfail "h8300*-*-*"
    437     fail "h8300 movfpe/movtpe tests"
    438 }
    439 
    440 proc do_h8300_movb {} {
    441     set testname "movb.s: h8300 movb tests"
    442     set x 0
    443 
    444     gas_start "movb.s" "-al"
    445 
    446     # Check each instruction bit pattern to verify it got
    447     # assembled correctly.
    448     while 1 {
    449 	expect {
    450 	    -re " +\[0-9\]+ 0000 0C89\[^\n\]*\n"   { set x [expr $x+1] }
    451 	    -re " +\[0-9\]+ 0002 F810\[^\n\]*\n"   { set x [expr $x+1] }
    452 	    -re " +\[0-9\]+ 0004 6818\[^\n\]*\n"   { set x [expr $x+1] }
    453 	    -re " +\[0-9\]+ 0006 6E180010\[^\n\]*\n"   { set x [expr $x+1] }
    454 	    -re " +\[0-9\]+ 000a 6C18\[^\n\]*\n"   { set x [expr $x+1] }
    455 	    -re " +\[0-9\]+ 000c 2810\[^\n\]*\n"   { set x [expr $x+1] }
    456 	    -re " +\[0-9\]+ 000e 6A080000\[^\n\]*\n"   { set x [expr $x+1] }
    457 	    -re " +\[0-9\]+ 0012 6898\[^\n\]*\n"   { set x [expr $x+1] }
    458 	    -re " +\[0-9\]+ 0014 6E980010\[^\n\]*\n"   { set x [expr $x+1] }
    459 	    -re " +\[0-9\]+ 0018 6C98\[^\n\]*\n"   { set x [expr $x+1] }
    460 	    -re " +\[0-9\]+ 001a 3810\[^\n\]*\n"   { set x [expr $x+1] }
    461 	    -re " +\[0-9\]+ 001c 6A880000\[^\n\]*\n"   { set x [expr $x+1] }
    462 	    eof					{ break }
    463 	}
    464     }
    465 
    466     # This was intended to do any cleanup necessary.  It kinda looks like it
    467     # isn't needed, but just in case, please keep it in for now.
    468     gas_finish
    469 
    470     # Did we find what we were looking for?  If not, flunk it.
    471     if [expr $x == 12] then { pass $testname } else { fail $testname }
    472 }
    473 
    474 proc do_h8300_movw {} {
    475     set testname "movw.s: h8300 movw tests"
    476     set x 0
    477 
    478     gas_start "movw.s" "-al"
    479 
    480     # Check each instruction bit pattern to verify it got
    481     # assembled correctly.
    482     while 1 {
    483 	expect {
    484 	    -re " +\[0-9\]+ 0000 0D01\[^\n\]*\n"   { set x [expr $x+1] }
    485 	    -re " +\[0-9\]+ 0002 79000010\[^\n\]*\n"   { set x [expr $x+1] }
    486 	    -re " +\[0-9\]+ 0006 6910\[^\n\]*\n"   { set x [expr $x+1] }
    487 	    -re " +\[0-9\]+ 0008 6F100010\[^\n\]*\n"   { set x [expr $x+1] }
    488 	    -re " +\[0-9\]+ 000c 6D10\[^\n\]*\n"   { set x [expr $x+1] }
    489 	    -re " +\[0-9\]+ 000e 6B000000\[^\n\]*\n"   { set x [expr $x+1] }
    490 	    -re " +\[0-9\]+ 0012 6990\[^\n\]*\n"   { set x [expr $x+1] }
    491 	    -re " +\[0-9\]+ 0014 6F900010\[^\n\]*\n"   { set x [expr $x+1] }
    492 	    -re " +\[0-9\]+ 0018 6D90\[^\n\]*\n"   { set x [expr $x+1] }
    493 	    -re " +\[0-9\]+ 001a 6B800000\[^\n\]*\n"   { set x [expr $x+1] }
    494 	    eof					{ break }
    495 	}
    496     }
    497 
    498     # This was intended to do any cleanup necessary.  It kinda looks like it
    499     # isn't needed, but just in case, please keep it in for now.
    500     gas_finish
    501 
    502     # Did we find what we were looking for?  If not, flunk it.
    503     if [expr $x == 10] then { pass $testname } else { fail $testname }
    504 }
    505 
    506 proc do_h8300_pushpop {} {
    507     set testname "pushpop.s: h8300 pushpop tests"
    508     set x 0
    509 
    510     gas_start "pushpop.s" "-al"
    511 
    512     # Check each instruction bit pattern to verify it got
    513     # assembled correctly.
    514     while 1 {
    515 	expect {
    516 	    -re " +\[0-9\]+ 0000 6D70\[^\n\]*\n"   { set x [expr $x+1] }
    517 	    -re " +\[0-9\]+ 0002 6DF0\[^\n\]*\n"   { set x [expr $x+1] }
    518 	    eof					{ break }
    519 	}
    520     }
    521 
    522     # This was intended to do any cleanup necessary.  It kinda looks like it
    523     # isn't needed, but just in case, please keep it in for now.
    524     gas_finish
    525 
    526     # Did we find what we were looking for?  If not, flunk it.
    527     if [expr $x == 2] then { pass $testname } else { fail $testname }
    528 }
    529 
    530 proc do_h8300_rotate_shift {} {
    531     set testname "rotsh.s: h8300 rotate and shift tests"
    532     set x 0
    533 
    534     gas_start "rotsh.s" "-al"
    535 
    536     # Check each instruction bit pattern to verify it got
    537     # assembled correctly.
    538     while 1 {
    539 	expect {
    540 	    -re " +\[0-9\]+ 0000 1288\[^\n\]*\n"   { set x [expr $x+1] }
    541 	    -re " +\[0-9\]+ 0002 1388\[^\n\]*\n"   { set x [expr $x+1] }
    542 	    -re " +\[0-9\]+ 0004 1208\[^\n\]*\n"   { set x [expr $x+1] }
    543 	    -re " +\[0-9\]+ 0006 1308\[^\n\]*\n"   { set x [expr $x+1] }
    544 	    -re " +\[0-9\]+ 0008 1088\[^\n\]*\n"   { set x [expr $x+1] }
    545 	    -re " +\[0-9\]+ 000a 1188\[^\n\]*\n"   { set x [expr $x+1] }
    546 	    -re " +\[0-9\]+ 000c 1008\[^\n\]*\n"   { set x [expr $x+1] }
    547 	    -re " +\[0-9\]+ 000e 1108\[^\n\]*\n"   { set x [expr $x+1] }
    548 	    eof					{ break }
    549 	}
    550     }
    551 
    552     # This was intended to do any cleanup necessary.  It kinda looks like it
    553     # isn't needed, but just in case, please keep it in for now.
    554     gas_finish
    555 
    556     # Did we find what we were looking for?  If not, flunk it.
    557     if [expr $x == 8] then { pass $testname } else { fail $testname }
    558 }
    559 
    560 proc do_h8300h_add_sub {} {
    561     set testname "addsubh.s: h8300h add/sub tests"
    562     set x 0
    563 
    564     gas_start "addsubh.s" "-al"
    565 
    566     # Check each instruction bit pattern to verify it got
    567     # assembled correctly.
    568     while 1 {
    569 	expect {
    570 	    -re " +\[0-9\]+ 0000 8910\[^\n\]*\n"   { set x [expr $x+1] }
    571 	    -re " +\[0-9\]+ 0002 0819\[^\n\]*\n"   { set x [expr $x+1] }
    572 	    -re " +\[0-9\]+ 0004 79110020\[^\n\]*\n"   { set x [expr $x+1] }
    573 	    -re " +\[0-9\]+ 0008 0912\[^\n\]*\n"   { set x [expr $x+1] }
    574 	    -re " +\[0-9\]+ 000a 7A110000\[^\n\]*\n +\[0-9\]+ +0040\[^\n\]*\n"   { set x [expr $x+1] }
    575 	    -re " +\[0-9\]+ 0010 0A92\[^\n\]*\n"   { set x [expr $x+1] }
    576 	    -re " +\[0-9\]+ 0012 0B04\[^\n\]*\n"   { set x [expr $x+1] }
    577 	    -re " +\[0-9\]+ 0014 0B85\[^\n\]*\n"   { set x [expr $x+1] }
    578 	    -re " +\[0-9\]+ 0016 0B96\[^\n\]*\n"   { set x [expr $x+1] }
    579 	    -re " +\[0-9\]+ 0018 0E89\[^\n\]*\n"   { set x [expr $x+1] }
    580 	    -re " +\[0-9\]+ 001a 9210\[^\n\]*\n"   { set x [expr $x+1] }
    581 	    -re " +\[0-9\]+ 001c 1889\[^\n\]*\n"   { set x [expr $x+1] }
    582 	    -re " +\[0-9\]+ 001e 79310010\[^\n\]*\n"   { set x [expr $x+1] }
    583 	    -re " +\[0-9\]+ 0022 1901\[^\n\]*\n"   { set x [expr $x+1] }
    584 	    -re " +\[0-9\]+ 0024 7A310000\[^\n\]*\n +\[0-9\]+ +0040\[^\n\]*\n"   { set x [expr $x+1] }
    585 	    -re " +\[0-9\]+ 002a 1A92\[^\n\]*\n"   { set x [expr $x+1] }
    586 	    -re " +\[0-9\]+ 002c 1B04\[^\n\]*\n"   { set x [expr $x+1] }
    587 	    -re " +\[0-9\]+ 002e 1B85\[^\n\]*\n"   { set x [expr $x+1] }
    588 	    -re " +\[0-9\]+ 0030 1B96\[^\n\]*\n"   { set x [expr $x+1] }
    589 	    -re " +\[0-9\]+ 0032 1E89\[^\n\]*\n"   { set x [expr $x+1] }
    590 	    -re " +\[0-9\]+ 0034 B210\[^\n\]*\n"   { set x [expr $x+1] }
    591 	    timeout 				{ perror "timeout\n; break }
    592 	    eof					{ break }
    593 	}
    594     }
    595 
    596     # This was intended to do any cleanup necessary.  It kinda looks like it
    597     # isn't needed, but just in case, please keep it in for now.
    598     gas_finish
    599 
    600     # Did we find what we were looking for?  If not, flunk it.
    601     if [expr $x == 21] then { pass $testname } else { fail $testname }
    602 }
    603 
    604 proc do_h8300h_logical {} {
    605     set testname "logicalh.s: h8300h logical tests"
    606     set x 0
    607 
    608     gas_start "logicalh.s" "-al"
    609 
    610     # Check each instruction bit pattern to verify it got
    611     # assembled correctly.
    612     while 1 {
    613 	expect {
    614 	    -re " +\[0-9\]+ 0000 E910\[^\n\]*\n"   { set x [expr $x+1] }
    615 	    -re " +\[0-9\]+ 0002 1691\[^\n\]*\n"   { set x [expr $x+1] }
    616 	    -re " +\[0-9\]+ 0004 79610020\[^\n\]*\n"   { set x [expr $x+1] }
    617 	    -re " +\[0-9\]+ 0008 6611\[^\n\]*\n"   { set x [expr $x+1] }
    618 	    -re " +\[0-9\]+ 000a 7A610000\[^\n\]*\n +\[0-9\]+ +0040\[^\n\]*\n"   { set x [expr $x+1] }
    619 	    -re " +\[0-9\]+ 0010 01F06611\[^\n\]*\n"   { set x [expr $x+1] }
    620 	    -re " +\[0-9\]+ 0014 0610\[^\n\]*\n"   { set x [expr $x+1] }
    621 	    -re " +\[0-9\]+ 0016 C810\[^\n\]*\n"   { set x [expr $x+1] }
    622 	    -re " +\[0-9\]+ 0018 1498\[^\n\]*\n"   { set x [expr $x+1] }
    623 	    -re " +\[0-9\]+ 001a 79410020\[^\n\]*\n"   { set x [expr $x+1] }
    624 	    -re " +\[0-9\]+ 001e 6411\[^\n\]*\n"   { set x [expr $x+1] }
    625 	    -re " +\[0-9\]+ 0020 7A410000\[^\n\]*\n +\[0-9\]+ +0040\[^\n\]*\n"   { set x [expr $x+1] }
    626 	    -re " +\[0-9\]+ 0026 01F06411\[^\n\]*\n"   { set x [expr $x+1] }
    627 	    -re " +\[0-9\]+ 002a 0410\[^\n\]*\n"   { set x [expr $x+1] }
    628 	    -re " +\[0-9\]+ 002c D810\[^\n\]*\n"   { set x [expr $x+1] }
    629 	    -re " +\[0-9\]+ 002e 1589\[^\n\]*\n"   { set x [expr $x+1] }
    630 	    -re " +\[0-9\]+ 0030 79510020\[^\n\]*\n"   { set x [expr $x+1] }
    631 	    -re " +\[0-9\]+ 0034 6511\[^\n\]*\n"   { set x [expr $x+1] }
    632 	    -re " +\[0-9\]+ 0036 7A510000\[^\n\]*\n +\[0-9\]+ +0040\[^\n\]*\n"   { set x [expr $x+1] }
    633 	    -re " +\[0-9\]+ 003c 01F06511\[^\n\]*\n"   { set x [expr $x+1] }
    634 	    -re " +\[0-9\]+ 0040 0510\[^\n\]*\n"   { set x [expr $x+1] }
    635 	    -re " +\[0-9\]+ 0042 1788\[^\n\]*\n"   { set x [expr $x+1] }
    636 	    -re " +\[0-9\]+ 0044 1790\[^\n\]*\n"   { set x [expr $x+1] }
    637 	    -re " +\[0-9\]+ 0046 17B0\[^\n\]*\n"   { set x [expr $x+1] }
    638 	    -re " +\[0-9\]+ 0048 1708\[^\n\]*\n"   { set x [expr $x+1] }
    639 	    -re " +\[0-9\]+ 004a 1710\[^\n\]*\n"   { set x [expr $x+1] }
    640 	    -re " +\[0-9\]+ 004c 1730\[^\n\]*\n"   { set x [expr $x+1] }
    641 	    timeout 				{ perror "timeout\n; break }
    642 	    eof					{ break }
    643 	}
    644     }
    645 
    646     # This was intended to do any cleanup necessary.  It kinda looks like it
    647     # isn't needed, but just in case, please keep it in for now.
    648     gas_finish
    649 
    650     # Did we find what we were looking for?  If not, flunk it.
    651     if [expr $x == 27] then { pass $testname } else { fail $testname }
    652 }
    653 
    654 proc do_h8300h_cbranch {} {
    655     set testname "cbranchh.s: h8300h conditional branch tests"
    656     set x 0
    657 
    658     gas_start "cbranchh.s" "-al"
    659 
    660     # Check each instruction bit pattern to verify it got
    661     # assembled correctly.
    662     while 1 {
    663 	expect {
    664 	    -re " +\[0-9\]+ 0000 4000\[^\n\]*\n"   { set x [expr $x+1] }
    665 	    -re " +\[0-9\]+ 0002 4000\[^\n\]*\n"   { set x [expr $x+1] }
    666 	    -re " +\[0-9\]+ 0004 4100\[^\n\]*\n"   { set x [expr $x+1] }
    667 	    -re " +\[0-9\]+ 0006 4100\[^\n\]*\n"   { set x [expr $x+1] }
    668 	    -re " +\[0-9\]+ 0008 4200\[^\n\]*\n"   { set x [expr $x+1] }
    669 	    -re " +\[0-9\]+ 000a 4300\[^\n\]*\n"   { set x [expr $x+1] }
    670 	    -re " +\[0-9\]+ 000c 4400\[^\n\]*\n"   { set x [expr $x+1] }
    671 	    -re " +\[0-9\]+ 000e 4400\[^\n\]*\n"   { set x [expr $x+1] }
    672 	    -re " +\[0-9\]+ 0010 4500\[^\n\]*\n"   { set x [expr $x+1] }
    673 	    -re " +\[0-9\]+ 0012 4500\[^\n\]*\n"   { set x [expr $x+1] }
    674 	    -re " +\[0-9\]+ 0014 4600\[^\n\]*\n"   { set x [expr $x+1] }
    675 	    -re " +\[0-9\]+ 0016 4700\[^\n\]*\n"   { set x [expr $x+1] }
    676 	    -re " +\[0-9\]+ 0018 4800\[^\n\]*\n"   { set x [expr $x+1] }
    677 	    -re " +\[0-9\]+ 001a 4900\[^\n\]*\n"   { set x [expr $x+1] }
    678 	    -re " +\[0-9\]+ 001c 4A00\[^\n\]*\n"   { set x [expr $x+1] }
    679 	    -re " +\[0-9\]+ 001e 4B00\[^\n\]*\n"   { set x [expr $x+1] }
    680 	    -re " +\[0-9\]+ 0020 4C00\[^\n\]*\n"   { set x [expr $x+1] }
    681 	    -re " +\[0-9\]+ 0022 4D00\[^\n\]*\n"   { set x [expr $x+1] }
    682 	    -re " +\[0-9\]+ 0024 4E00\[^\n\]*\n"   { set x [expr $x+1] }
    683 	    -re " +\[0-9\]+ 0026 4F00\[^\n\]*\n"   { set x [expr $x+1] }
    684 	    -re " +\[0-9\]+ 0028 58000000\[^\n\]*\n"   { set x [expr $x+1] }
    685 	    -re " +\[0-9\]+ 002c 58000000\[^\n\]*\n"   { set x [expr $x+1] }
    686 	    -re " +\[0-9\]+ 0030 58100000\[^\n\]*\n"   { set x [expr $x+1] }
    687 	    -re " +\[0-9\]+ 0034 58100000\[^\n\]*\n"   { set x [expr $x+1] }
    688 	    -re " +\[0-9\]+ 0038 58200000\[^\n\]*\n"   { set x [expr $x+1] }
    689 	    -re " +\[0-9\]+ 003c 58300000\[^\n\]*\n"   { set x [expr $x+1] }
    690 	    -re " +\[0-9\]+ 0040 58400000\[^\n\]*\n"   { set x [expr $x+1] }
    691 	    -re " +\[0-9\]+ 0044 58400000\[^\n\]*\n"   { set x [expr $x+1] }
    692 	    -re " +\[0-9\]+ 0048 58500000\[^\n\]*\n"   { set x [expr $x+1] }
    693 	    -re " +\[0-9\]+ 004c 58500000\[^\n\]*\n"   { set x [expr $x+1] }
    694 	    -re " +\[0-9\]+ 0050 58600000\[^\n\]*\n"   { set x [expr $x+1] }
    695 	    -re " +\[0-9\]+ 0054 58700000\[^\n\]*\n"   { set x [expr $x+1] }
    696 	    -re " +\[0-9\]+ 0058 58800000\[^\n\]*\n"   { set x [expr $x+1] }
    697 	    -re " +\[0-9\]+ 005c 58900000\[^\n\]*\n"   { set x [expr $x+1] }
    698 	    -re " +\[0-9\]+ 0060 58A00000\[^\n\]*\n"   { set x [expr $x+1] }
    699 	    -re " +\[0-9\]+ 0064 58B00000\[^\n\]*\n"   { set x [expr $x+1] }
    700 	    -re " +\[0-9\]+ 0068 58C00000\[^\n\]*\n"   { set x [expr $x+1] }
    701 	    -re " +\[0-9\]+ 006c 58D00000\[^\n\]*\n"   { set x [expr $x+1] }
    702 	    -re " +\[0-9\]+ 0070 58E00000\[^\n\]*\n"   { set x [expr $x+1] }
    703 	    -re " +\[0-9\]+ 0074 58F00000\[^\n\]*\n"   { set x [expr $x+1] }
    704 	    timeout 				{ perror "timeout\n; break }
    705 	    eof					{ break }
    706 	}
    707     }
    708 
    709     # This was intended to do any cleanup necessary.  It kinda looks like it
    710     # isn't needed, but just in case, please keep it in for now.
    711     gas_finish
    712 
    713     # Did we find what we were looking for?  If not, flunk it.
    714     if [expr $x == 40] then { pass $testname } else { fail $testname }
    715 }
    716 proc do_h8300h_bitops1 {} {
    717     set testname "bitops1h.s: h8300h bitops tests #1"
    718     set x 0
    719 
    720     gas_start "bitops1h.s" "-al"
    721 
    722     # Check each instruction bit pattern to verify it got
    723     # assembled correctly.
    724     while 1 {
    725 	expect {
    726 	    -re " +\[0-9\]+ 0000 7608\[^\n\]*\n"   { set x [expr $x+1] }
    727 	    -re " +\[0-9\]+ 0002 7C007600\[^\n\]*\n"   { set x [expr $x+1] }
    728 	    -re " +\[0-9\]+ 0006 7E407600\[^\n\]*\n"   { set x [expr $x+1] }
    729 	    -re " +\[0-9\]+ 000a 7208\[^\n\]*\n"   { set x [expr $x+1] }
    730 	    -re " +\[0-9\]+ 000c 7D007200\[^\n\]*\n"   { set x [expr $x+1] }
    731 	    -re " +\[0-9\]+ 0010 7F407200\[^\n\]*\n"   { set x [expr $x+1] }
    732 	    -re " +\[0-9\]+ 0014 6298\[^\n\]*\n"   { set x [expr $x+1] }
    733 	    -re " +\[0-9\]+ 0016 7D006290\[^\n\]*\n"   { set x [expr $x+1] }
    734 	    -re " +\[0-9\]+ 001a 7F406290\[^\n\]*\n"   { set x [expr $x+1] }
    735 	    -re " +\[0-9\]+ 001e 7688\[^\n\]*\n"   { set x [expr $x+1] }
    736 	    -re " +\[0-9\]+ 0020 7C007680\[^\n\]*\n"   { set x [expr $x+1] }
    737 	    -re " +\[0-9\]+ 0024 7E407680\[^\n\]*\n"   { set x [expr $x+1] }
    738 	    -re " +\[0-9\]+ 0028 7788\[^\n\]*\n"   { set x [expr $x+1] }
    739 	    -re " +\[0-9\]+ 002a 7C007780\[^\n\]*\n"   { set x [expr $x+1] }
    740 	    -re " +\[0-9\]+ 002e 7E407780\[^\n\]*\n"   { set x [expr $x+1] }
    741 	    timeout 				{ perror "timeout\n; break }
    742 	    eof					{ break }
    743 	}
    744     }
    745 
    746     # This was intended to do any cleanup necessary.  It kinda looks like it
    747     # isn't needed, but just in case, please keep it in for now.
    748     gas_finish
    749 
    750     # Did we find what we were looking for?  If not, flunk it.
    751     if [expr $x == 15] then { pass $testname } else { fail $testname }
    752 }
    753 
    754 proc do_h8300h_bitops2 {} {
    755     set testname "bitops2h.s: h8300h bitops tests #2"
    756     set x 0
    757 
    758     gas_start "bitops2h.s" "-al"
    759 
    760     # Check each instruction bit pattern to verify it got
    761     # assembled correctly.
    762     while 1 {
    763 	expect {
    764 	    -re " +\[0-9\]+ 0000 7488\[^\n\]*\n"   { set x [expr $x+1] }
    765 	    -re " +\[0-9\]+ 0002 7C007480\[^\n\]*\n"   { set x [expr $x+1] }
    766 	    -re " +\[0-9\]+ 0006 7E407480\[^\n\]*\n"   { set x [expr $x+1] }
    767 	    -re " +\[0-9\]+ 000a 6788\[^\n\]*\n"   { set x [expr $x+1] }
    768 	    -re " +\[0-9\]+ 000c 7D006780\[^\n\]*\n"   { set x [expr $x+1] }
    769 	    -re " +\[0-9\]+ 0010 7F406780\[^\n\]*\n"   { set x [expr $x+1] }
    770 	    -re " +\[0-9\]+ 0014 7588\[^\n\]*\n"   { set x [expr $x+1] }
    771 	    -re " +\[0-9\]+ 0016 7C007580\[^\n\]*\n"   { set x [expr $x+1] }
    772 	    -re " +\[0-9\]+ 001a 7E407580\[^\n\]*\n"   { set x [expr $x+1] }
    773 	    -re " +\[0-9\]+ 001e 7708\[^\n\]*\n"   { set x [expr $x+1] }
    774 	    -re " +\[0-9\]+ 0020 7C007700\[^\n\]*\n"   { set x [expr $x+1] }
    775 	    -re " +\[0-9\]+ 0024 7E407700\[^\n\]*\n"   { set x [expr $x+1] }
    776 	    timeout 				{ perror "timeout\n; break }
    777 	    eof					{ break }
    778 	}
    779     }
    780 
    781     # This was intended to do any cleanup necessary.  It kinda looks like it
    782     # isn't needed, but just in case, please keep it in for now.
    783     gas_finish
    784 
    785     # Did we find what we were looking for?  If not, flunk it.
    786     if [expr $x == 12] then { pass $testname } else { fail $testname }
    787 }
    788 
    789 proc do_h8300h_bitops3 {} {
    790     set testname "bitops3h.s: h8300h bitops tests #3"
    791     set x 0
    792 
    793     gas_start "bitops3h.s" "-al"
    794 
    795     # Check each instruction bit pattern to verify it got
    796     # assembled correctly.
    797     while 1 {
    798 	expect {
    799 	    -re " +\[0-9\]+ 0000 7108\[^\n\]*\n"   { set x [expr $x+1] }
    800 	    -re " +\[0-9\]+ 0002 7D007100\[^\n\]*\n"   { set x [expr $x+1] }
    801 	    -re " +\[0-9\]+ 0006 7F407100\[^\n\]*\n"   { set x [expr $x+1] }
    802 	    -re " +\[0-9\]+ 000a 6198\[^\n\]*\n"   { set x [expr $x+1] }
    803 	    -re " +\[0-9\]+ 000c 7D006190\[^\n\]*\n"   { set x [expr $x+1] }
    804 	    -re " +\[0-9\]+ 0010 7F406190\[^\n\]*\n"   { set x [expr $x+1] }
    805 	    -re " +\[0-9\]+ 0014 7008\[^\n\]*\n"   { set x [expr $x+1] }
    806 	    -re " +\[0-9\]+ 0016 7D007000\[^\n\]*\n"   { set x [expr $x+1] }
    807 	    -re " +\[0-9\]+ 001a 7F407000\[^\n\]*\n"   { set x [expr $x+1] }
    808 	    -re " +\[0-9\]+ 001e 6098\[^\n\]*\n"   { set x [expr $x+1] }
    809 	    -re " +\[0-9\]+ 0020 7D006090\[^\n\]*\n"   { set x [expr $x+1] }
    810 	    -re " +\[0-9\]+ 0024 7F406090\[^\n\]*\n"   { set x [expr $x+1] }
    811 	    timeout 				{ perror "timeout\n; break }
    812 	    eof					{ break }
    813 	}
    814     }
    815 
    816     # This was intended to do any cleanup necessary.  It kinda looks like it
    817     # isn't needed, but just in case, please keep it in for now.
    818     gas_finish
    819 
    820     # Did we find what we were looking for?  If not, flunk it.
    821     if [expr $x == 12] then { pass $testname } else { fail $testname }
    822 }
    823 
    824 proc do_h8300h_bitops4 {} {
    825     set testname "bitops4h.s: h8300h bitops tests #4"
    826     set x 0
    827 
    828     gas_start "bitops4h.s" "-al"
    829 
    830     # Check each instruction bit pattern to verify it got
    831     # assembled correctly.
    832     while 1 {
    833 	expect {
    834 	    -re " +\[0-9\]+ 0000 7408\[^\n\]*\n"   { set x [expr $x+1] }
    835 	    -re " +\[0-9\]+ 0002 7C007400\[^\n\]*\n"   { set x [expr $x+1] }
    836 	    -re " +\[0-9\]+ 0006 7E407400\[^\n\]*\n"   { set x [expr $x+1] }
    837 	    -re " +\[0-9\]+ 000a 6708\[^\n\]*\n"   { set x [expr $x+1] }
    838 	    -re " +\[0-9\]+ 000c 7D006700\[^\n\]*\n"   { set x [expr $x+1] }
    839 	    -re " +\[0-9\]+ 0010 7F406700\[^\n\]*\n"   { set x [expr $x+1] }
    840 	    -re " +\[0-9\]+ 0014 7308\[^\n\]*\n"   { set x [expr $x+1] }
    841 	    -re " +\[0-9\]+ 0016 7C007300\[^\n\]*\n"   { set x [expr $x+1] }
    842 	    -re " +\[0-9\]+ 001a 7E407300\[^\n\]*\n"   { set x [expr $x+1] }
    843 	    -re " +\[0-9\]+ 001e 6398\[^\n\]*\n"   { set x [expr $x+1] }
    844 	    -re " +\[0-9\]+ 0020 7C006390\[^\n\]*\n"   { set x [expr $x+1] }
    845 	    -re " +\[0-9\]+ 0024 7E406390\[^\n\]*\n"   { set x [expr $x+1] }
    846 	    -re " +\[0-9\]+ 0028 7508\[^\n\]*\n"   { set x [expr $x+1] }
    847 	    -re " +\[0-9\]+ 002a 7C007500\[^\n\]*\n"   { set x [expr $x+1] }
    848 	    -re " +\[0-9\]+ 002e 7E407500\[^\n\]*\n"   { set x [expr $x+1] }
    849 	    timeout 				{ perror "timeout\n; break }
    850 	    eof					{ break }
    851 	}
    852     }
    853 
    854     # This was intended to do any cleanup necessary.  It kinda looks like it
    855     # isn't needed, but just in case, please keep it in for now.
    856     gas_finish
    857 
    858     # Did we find what we were looking for?  If not, flunk it.
    859     if [expr $x == 15] then { pass $testname } else { fail $testname }
    860 }
    861 
    862 proc do_h8300h_branch {} {
    863     set testname "branchh.s: h8300h branch tests"
    864     set x 0
    865 
    866     gas_start "branchh.s" "-al"
    867 
    868     # Check each instruction bit pattern to verify it got
    869     # assembled correctly.
    870     while 1 {
    871 	expect {
    872 	    -re " +\[0-9\]+ 0000 5500\[^\n\]*\n"   { set x [expr $x+1] }
    873 	    -re " +\[0-9\]+ 0002 5C000000\[^\n\]*\n"   { set x [expr $x+1] }
    874 	    -re " +\[0-9\]+ 0006 5A000000\[^\n\]*\n"   { set x [expr $x+1] }
    875 	    -re " +\[0-9\]+ 000a 5900\[^\n\]*\n"   { set x [expr $x+1] }
    876 	    -re " +\[0-9\]+ 000c 5B00\[^\n\]*\n"   { set x [expr $x+1] }
    877 	    -re " +\[0-9\]+ 000e 5E000000\[^\n\]*\n"   { set x [expr $x+1] }
    878 	    -re " +\[0-9\]+ 0012 5D00\[^\n\]*\n"   { set x [expr $x+1] }
    879 	    -re " +\[0-9\]+ 0014 5F00\[^\n\]*\n"   { set x [expr $x+1] }
    880 	    timeout 				{ perror "timeout\n; break }
    881 	    eof					{ break }
    882 	}
    883     }
    884 
    885     # This was intended to do any cleanup necessary.  It kinda looks like it
    886     # isn't needed, but just in case, please keep it in for now.
    887     gas_finish
    888 
    889     # Did we find what we were looking for?  If not, flunk it.
    890     if [expr $x == 8] then { pass $testname } else { fail $testname }
    891 }
    892 
    893 proc do_h8300h_compare {} {
    894     set testname "compareh.s: h8300h compare tests"
    895     set x 0
    896 
    897     gas_start "compareh.s" "-al"
    898 
    899     # Check each instruction bit pattern to verify it got
    900     # assembled correctly.
    901     while 1 {
    902 	expect {
    903 	    -re " +\[0-9\]+ 0000 A800\[^\n\]*\n"   { set x [expr $x+1] }
    904 	    -re " +\[0-9\]+ 0002 1C08\[^\n\]*\n"   { set x [expr $x+1] }
    905 	    -re " +\[0-9\]+ 0004 79200020\[^\n\]*\n"   { set x [expr $x+1] }
    906 	    -re " +\[0-9\]+ 0008 1D01\[^\n\]*\n"   { set x [expr $x+1] }
    907 	    -re " +\[0-9\]+ 000a 7A200000\[^\n\]*\n +\[0-9\]+ +0040\[^\n\]*\n"   { set x [expr $x+1] }
    908 	    -re " +\[0-9\]+ 0010 1F81\[^\n\]*\n"   { set x [expr $x+1] }
    909 	    timeout 				{ perror "timeout\n; break }
    910 	    eof					{ break }
    911 	}
    912     }
    913 
    914     # This was intended to do any cleanup necessary.  It kinda looks like it
    915     # isn't needed, but just in case, please keep it in for now.
    916     gas_finish
    917 
    918     # Did we find what we were looking for?  If not, flunk it.
    919     if [expr $x == 6] then { pass $testname } else { fail $testname }
    920 }
    921 
    922 proc do_h8300h_decimal {} {
    923     set testname "decimalh.s: h8300h decimal tests"
    924     set x 0
    925 
    926     gas_start "decimalh.s" "-al"
    927 
    928     # Check each instruction bit pattern to verify it got
    929     # assembled correctly.
    930     while 1 {
    931 	expect {
    932 	    -re " +\[0-9\]+ 0000 0F08\[^\n\]*\n"   { set x [expr $x+1] }
    933 	    -re " +\[0-9\]+ 0002 1F08\[^\n\]*\n"   { set x [expr $x+1] }
    934 	    eof					{ break }
    935 	}
    936     }
    937 
    938     # This was intended to do any cleanup necessary.  It kinda looks like it
    939     # isn't needed, but just in case, please keep it in for now.
    940     gas_finish
    941 
    942     # Did we find what we were looking for?  If not, flunk it.
    943     if [expr $x == 2] then { pass $testname } else { fail $testname }
    944 }
    945 
    946 proc do_h8300h_incdec {} {
    947     set testname "incdech.s: h8300h incdec tests"
    948     set x 0
    949 
    950     gas_start "incdech.s" "-al"
    951 
    952     # Check each instruction bit pattern to verify it got
    953     # assembled correctly.
    954     while 1 {
    955 	expect {
    956 	    -re " +\[0-9\]+ 0000 1A08\[^\n\]*\n"   { set x [expr $x+1] }
    957 	    -re " +\[0-9\]+ 0002 1B50\[^\n\]*\n"   { set x [expr $x+1] }
    958 	    -re " +\[0-9\]+ 0004 1BD0\[^\n\]*\n"   { set x [expr $x+1] }
    959 	    -re " +\[0-9\]+ 0006 1B70\[^\n\]*\n"   { set x [expr $x+1] }
    960 	    -re " +\[0-9\]+ 0008 1BF0\[^\n\]*\n"   { set x [expr $x+1] }
    961 	    -re " +\[0-9\]+ 000a 0A08\[^\n\]*\n"   { set x [expr $x+1] }
    962 	    -re " +\[0-9\]+ 000c 0B50\[^\n\]*\n"   { set x [expr $x+1] }
    963 	    -re " +\[0-9\]+ 000e 0BD0\[^\n\]*\n"   { set x [expr $x+1] }
    964 	    -re " +\[0-9\]+ 0010 0B70\[^\n\]*\n"   { set x [expr $x+1] }
    965 	    -re " +\[0-9\]+ 0012 0BF0\[^\n\]*\n"   { set x [expr $x+1] }
    966 	    eof					{ break }
    967 	}
    968     }
    969 
    970     # This was intended to do any cleanup necessary.  It kinda looks like it
    971     # isn't needed, but just in case, please keep it in for now.
    972     gas_finish
    973 
    974     # Did we find what we were looking for?  If not, flunk it.
    975     if [expr $x == 10] then { pass $testname } else { fail $testname }
    976 }
    977 
    978 proc do_h8300h_divmul {} {
    979     set testname "divmulh.s: h8300h divmul tests"
    980     set x 0
    981 
    982     gas_start "divmulh.s" "-al"
    983 
    984     # Check each instruction bit pattern to verify it got
    985     # assembled correctly.
    986     while 1 {
    987 	expect {
    988 	    -re " +\[0-9\]+ 0000 5181\[^\n\]*\n"   { set x [expr $x+1] }
    989 	    -re " +\[0-9\]+ 0002 5301\[^\n\]*\n"   { set x [expr $x+1] }
    990 	    -re " +\[0-9\]+ 0004 01D05181\[^\n\]*\n"   { set x [expr $x+1] }
    991 	    -re " +\[0-9\]+ 0008 01D05301\[^\n\]*\n"   { set x [expr $x+1] }
    992 	    -re " +\[0-9\]+ 000c 5081\[^\n\]*\n"   { set x [expr $x+1] }
    993 	    -re " +\[0-9\]+ 000e 5201\[^\n\]*\n"   { set x [expr $x+1] }
    994 	    -re " +\[0-9\]+ 0010 01C05081\[^\n\]*\n"   { set x [expr $x+1] }
    995 	    -re " +\[0-9\]+ 0014 01C05201\[^\n\]*\n"   { set x [expr $x+1] }
    996 	    eof					{ break }
    997 	}
    998     }
    999 
   1000     # This was intended to do any cleanup necessary.  It kinda looks like it
   1001     # isn't needed, but just in case, please keep it in for now.
   1002     gas_finish
   1003 
   1004     # Did we find what we were looking for?  If not, flunk it.
   1005     if [expr $x == 8] then { pass $testname } else { fail $testname }
   1006 }
   1007 
   1008 proc do_h8300h_misc {} {
   1009     set testname "misch.s: h8300h misc tests"
   1010     set x 0
   1011 
   1012     gas_start "misch.s" "-al"
   1013 
   1014     # Check each instruction bit pattern to verify it got
   1015     # assembled correctly.
   1016     while 1 {
   1017 	expect {
   1018 	    -re " +\[0-9\]+ 0000 7B5C598F\[^\n\]*\n"   { set x [expr $x+1] }
   1019 	    -re " +\[0-9\]+ 0004 7BD4598F\[^\n\]*\n"   { set x [expr $x+1] }
   1020 	    -re " +\[0-9\]+ 0008 0700\[^\n\]*\n"   { set x [expr $x+1] }
   1021 	    -re " +\[0-9\]+ 000a 0308\[^\n\]*\n"   { set x [expr $x+1] }
   1022 	    -re " +\[0-9\]+ 000c 01406900\[^\n\]*\n"   { set x [expr $x+1] }
   1023 	    -re " +\[0-9\]+ 0010 01406F00\[^\n\]*\n +\[0-9\]+ +0010\[^\n\]*\n"   { set x [expr $x+1] }
   1024 	    -re " +\[0-9\]+ 0016 01407800\[^\n\]*\n +\[0-9\]+ +6B200000\[^\n\]*\n +\[0-9\]+ +0020\[^\n\]*\n"   { set x [expr $x+1] }
   1025 	    -re " +\[0-9\]+ 0020 01406D00\[^\n\]*\n"   { set x [expr $x+1] }
   1026 	    -re " +\[0-9\]+ 0024 01406B00\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n"   { set x [expr $x+1] }
   1027 	    -re " +\[0-9\]+ 002a 01406B20\[^\n\]*\n +\[0-9\]+ +00000000\[^\n\]*\n"   { set x [expr $x+1] }
   1028 	    -re " +\[0-9\]+ 0032 0000\[^\n\]*\n"   { set x [expr $x+1] }
   1029 	    -re " +\[0-9\]+ 0034 5670\[^\n\]*\n"   { set x [expr $x+1] }
   1030 	    -re " +\[0-9\]+ 0036 5470\[^\n\]*\n"   { set x [expr $x+1] }
   1031 	    -re " +\[0-9\]+ 0038 0180\[^\n\]*\n"   { set x [expr $x+1] }
   1032 	    -re " +\[0-9\]+ 003a 0208\[^\n\]*\n"   { set x [expr $x+1] }
   1033 	    -re " +\[0-9\]+ 003c 01406980\[^\n\]*\n"   { set x [expr $x+1] }
   1034 	    -re " +\[0-9\]+ 0040 01406F80\[^\n\]*\n +\[0-9\]+ +0010\[^\n\]*\n"   { set x [expr $x+1] }
   1035 	    -re " +\[0-9\]+ 0046 01407800\[^\n\]*\n +\[0-9\]+ +6BA00000\[^\n\]*\n +\[0-9\]+ +0020\[^\n\]*\n"   { set x [expr $x+1] }
   1036 	    -re " +\[0-9\]+ 0050 01406D80\[^\n\]*\n"   { set x [expr $x+1] }
   1037 	    -re " +\[0-9\]+ 0054 01406B80\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n"   { set x [expr $x+1] }
   1038 	    -re " +\[0-9\]+ 005a 01406BA0\[^\n\]*\n +\[0-9\]+ +00000000\[^\n\]*\n"   { set x [expr $x+1] }
   1039 	    eof					{ break }
   1040 	}
   1041     }
   1042 
   1043     # This was intended to do any cleanup necessary.  It kinda looks like it
   1044     # isn't needed, but just in case, please keep it in for now.
   1045     gas_finish
   1046 
   1047     # Did we find what we were looking for?  If not, flunk it.
   1048     if [expr $x == 21] then { pass $testname } else { fail $testname }
   1049 
   1050     setup_xfail "h8300*-*-*"
   1051     fail "h8300h movfpe/movtpe tests"
   1052 }
   1053 
   1054 proc do_h8300h_movb {} {
   1055     set testname "movbh.s: h8300h movb tests"
   1056     set x 0
   1057 
   1058     gas_start "movbh.s" "-al"
   1059 
   1060     # Check each instruction bit pattern to verify it got
   1061     # assembled correctly.
   1062     while 1 {
   1063 	expect {
   1064 	    -re " +\[0-9\]+ 0000 0C89\[^\n\]*\n"   { set x [expr $x+1] }
   1065 	    -re " +\[0-9\]+ 0002 F810\[^\n\]*\n"   { set x [expr $x+1] }
   1066 	    -re " +\[0-9\]+ 0004 6818\[^\n\]*\n"   { set x [expr $x+1] }
   1067 	    -re " +\[0-9\]+ 0006 6E180010\[^\n\]*\n"   { set x [expr $x+1] }
   1068 	    -re " +\[0-9\]+ 000a 78106A28\[^\n\]*\n +\[0-9\]+ +00000020\[^\n\]*\n"   { set x [expr $x+1] }
   1069 	    -re " +\[0-9\]+ 0012 6C18\[^\n\]*\n"   { set x [expr $x+1] }
   1070 	    -re " +\[0-9\]+ 0014 2810\[^\n\]*\n"   { set x [expr $x+1] }
   1071 	    -re " +\[0-9\]+ 0016 6A080000\[^\n\]*\n"   { set x [expr $x+1] }
   1072 	    -re " +\[0-9\]+ 001a 6A280000\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n"   { set x [expr $x+1] }
   1073 	    -re " +\[0-9\]+ 0020 6898\[^\n\]*\n"   { set x [expr $x+1] }
   1074 	    -re " +\[0-9\]+ 0022 6E980010\[^\n\]*\n"   { set x [expr $x+1] }
   1075 	    -re " +\[0-9\]+ 0026 78106AA8\[^\n\]*\n +\[0-9\]+ +00000020\[^\n\]*\n"   { set x [expr $x+1] }
   1076 	    -re " +\[0-9\]+ 002e 6C98\[^\n\]*\n"   { set x [expr $x+1] }
   1077 	    -re " +\[0-9\]+ 0030 3810\[^\n\]*\n"   { set x [expr $x+1] }
   1078 	    -re " +\[0-9\]+ 0032 6A880000\[^\n\]*\n"   { set x [expr $x+1] }
   1079 	    -re " +\[0-9\]+ 0036 6AA80000\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n"   { set x [expr $x+1] }
   1080 	    eof					{ break }
   1081 	}
   1082     }
   1083 
   1084     # This was intended to do any cleanup necessary.  It kinda looks like it
   1085     # isn't needed, but just in case, please keep it in for now.
   1086     gas_finish
   1087 
   1088     # Did we find what we were looking for?  If not, flunk it.
   1089     if [expr $x == 16] then { pass $testname } else { fail $testname }
   1090 }
   1091 
   1092 proc do_h8300h_movw {} {
   1093     set testname "movwh.s: h8300h movw tests"
   1094     set x 0
   1095 
   1096     gas_start "movwh.s" "-al"
   1097 
   1098     # Check each instruction bit pattern to verify it got
   1099     # assembled correctly.
   1100     while 1 {
   1101 	expect {
   1102 	    -re " +\[0-9\]+ 0000 0D01\[^\n\]*\n"   { set x [expr $x+1] }
   1103 	    -re " +\[0-9\]+ 0002 79000010\[^\n\]*\n"   { set x [expr $x+1] }
   1104 	    -re " +\[0-9\]+ 0006 6910\[^\n\]*\n"   { set x [expr $x+1] }
   1105 	    -re " +\[0-9\]+ 0008 6F100010\[^\n\]*\n"   { set x [expr $x+1] }
   1106 	    -re " +\[0-9\]+ 000c 78106B20\[^\n\]*\n +\[0-9\]+ +00000020\[^\n\]*\n"   { set x [expr $x+1] }
   1107 	    -re " +\[0-9\]+ 0014 6D10\[^\n\]*\n"   { set x [expr $x+1] }
   1108 	    -re " +\[0-9\]+ 0016 6B000000\[^\n\]*\n"   { set x [expr $x+1] }
   1109 	    -re " +\[0-9\]+ 001a 6B200000\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n"   { set x [expr $x+1] }
   1110 	    -re " +\[0-9\]+ 0020 6990\[^\n\]*\n"   { set x [expr $x+1] }
   1111 	    -re " +\[0-9\]+ 0022 6F900010\[^\n\]*\n"   { set x [expr $x+1] }
   1112 	    -re " +\[0-9\]+ 0026 78106BA0\[^\n\]*\n +\[0-9\]+ +00000020\[^\n\]*\n"   { set x [expr $x+1] }
   1113 	    -re " +\[0-9\]+ 002e 6D90\[^\n\]*\n"   { set x [expr $x+1] }
   1114 	    -re " +\[0-9\]+ 0030 6B800000\[^\n\]*\n"   { set x [expr $x+1] }
   1115 	    -re " +\[0-9\]+ 0034 6BA00000\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n"   { set x [expr $x+1] }
   1116 	    eof					{ break }
   1117 	}
   1118     }
   1119 
   1120     # This was intended to do any cleanup necessary.  It kinda looks like it
   1121     # isn't needed, but just in case, please keep it in for now.
   1122     gas_finish
   1123 
   1124     # Did we find what we were looking for?  If not, flunk it.
   1125     if [expr $x == 14] then { pass $testname } else { fail $testname }
   1126 }
   1127 
   1128 proc do_h8300h_movl {} {
   1129     set testname "movlh.s: h8300h movl tests"
   1130     set x 0
   1131 
   1132     gas_start "movlh.s" "-al"
   1133 
   1134     # Check each instruction bit pattern to verify it got
   1135     # assembled correctly.
   1136     while 1 {
   1137 	expect {
   1138 	    -re " +\[0-9\]+ 0000 0F81\[^\n\]*\n"   { set x [expr $x+1] }
   1139 	    -re " +\[0-9\]+ 0002 7A000000\[^\n\]*\n +\[0-9\]+ +0040\[^\n\]*\n"   { set x [expr $x+1] }
   1140 	    -re " +\[0-9\]+ 0008 01006910\[^\n\]*\n"   { set x [expr $x+1] }
   1141 	    -re " +\[0-9\]+ 000c 01006F10\[^\n\]*\n +\[0-9\]+ +0010\[^\n\]*\n"   { set x [expr $x+1] }
   1142 	    -re " +\[0-9\]+ 0012 01007810\[^\n\]*\n +\[0-9\]+ +6B200000\[^\n\]*\n +\[0-9\]+ +0020\[^\n\]*\n"   { set x [expr $x+1] }
   1143 	    -re " +\[0-9\]+ 001c 01006D10\[^\n\]*\n"   { set x [expr $x+1] }
   1144 	    -re " +\[0-9\]+ 0020 01006B00\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n"   { set x [expr $x+1] }
   1145 	    -re " +\[0-9\]+ 0026 01006B20\[^\n\]*\n +\[0-9\]+ +00000000\[^\n\]*\n"   { set x [expr $x+1] }
   1146 	    -re " +\[0-9\]+ 002e 01006990\[^\n\]*\n"   { set x [expr $x+1] }
   1147 	    -re " +\[0-9\]+ 0032 01006F90\[^\n\]*\n +\[0-9\]+ +0010\[^\n\]*\n"   { set x [expr $x+1] }
   1148 	    -re " +\[0-9\]+ 0038 01007890\[^\n\]*\n +\[0-9\]+ +6BA00000\[^\n\]*\n +\[0-9\]+ +0020\[^\n\]*\n"   { set x [expr $x+1] }
   1149 	    -re " +\[0-9\]+ 0042 01006D90\[^\n\]*\n"   { set x [expr $x+1] }
   1150 	    -re " +\[0-9\]+ 0046 01006B80\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n"   { set x [expr $x+1] }
   1151 	    -re " +\[0-9\]+ 004c 01006BA0\[^\n\]*\n +\[0-9\]+ +00000000\[^\n\]*\n"   { set x [expr $x+1] }
   1152 	    eof					{ break }
   1153 	}
   1154     }
   1155 
   1156     # This was intended to do any cleanup necessary.  It kinda looks like it
   1157     # isn't needed, but just in case, please keep it in for now.
   1158     gas_finish
   1159 
   1160     # Did we find what we were looking for?  If not, flunk it.
   1161     if [expr $x == 14] then { pass $testname } else { fail $testname }
   1162 }
   1163 
   1164 proc do_h8300h_pushpop {} {
   1165     set testname "pushpoph.s: h8300h pushpop tests"
   1166     set x 0
   1167 
   1168     gas_start "pushpoph.s" "-al"
   1169 
   1170     # Check each instruction bit pattern to verify it got
   1171     # assembled correctly.
   1172     while 1 {
   1173 	expect {
   1174 	    -re " +\[0-9\]+ 0000 6D70\[^\n\]*\n"   { set x [expr $x+1] }
   1175 	    -re " +\[0-9\]+ 0002 01006D70\[^\n\]*\n"   { set x [expr $x+1] }
   1176 	    -re " +\[0-9\]+ 0006 6DF0\[^\n\]*\n"   { set x [expr $x+1] }
   1177 	    -re " +\[0-9\]+ 0008 01006DF0\[^\n\]*\n"   { set x [expr $x+1] }
   1178 	    eof					{ break }
   1179 	}
   1180     }
   1181 
   1182     # This was intended to do any cleanup necessary.  It kinda looks like it
   1183     # isn't needed, but just in case, please keep it in for now.
   1184     gas_finish
   1185 
   1186     # Did we find what we were looking for?  If not, flunk it.
   1187     if [expr $x == 4] then { pass $testname } else { fail $testname }
   1188 }
   1189 
   1190 proc do_h8300h_rotate_shift {} {
   1191     set testname "rotshh.s: h8300h rotate and shift tests"
   1192     set x 0
   1193 
   1194     gas_start "rotshh.s" "-al"
   1195 
   1196     # Check each instruction bit pattern to verify it got
   1197     # assembled correctly.
   1198     while 1 {
   1199 	expect {
   1200 	    -re " +\[0-9\]+ 0000 1288\[^\n\]*\n"   { set x [expr $x+1] }
   1201 	    -re " +\[0-9\]+ 0002 1290\[^\n\]*\n"   { set x [expr $x+1] }
   1202 	    -re " +\[0-9\]+ 0004 12B0\[^\n\]*\n"   { set x [expr $x+1] }
   1203 	    -re " +\[0-9\]+ 0006 1388\[^\n\]*\n"   { set x [expr $x+1] }
   1204 	    -re " +\[0-9\]+ 0008 1390\[^\n\]*\n"   { set x [expr $x+1] }
   1205 	    -re " +\[0-9\]+ 000a 13B0\[^\n\]*\n"   { set x [expr $x+1] }
   1206 	    -re " +\[0-9\]+ 000c 1208\[^\n\]*\n"   { set x [expr $x+1] }
   1207 	    -re " +\[0-9\]+ 000e 1210\[^\n\]*\n"   { set x [expr $x+1] }
   1208 	    -re " +\[0-9\]+ 0010 1230\[^\n\]*\n"   { set x [expr $x+1] }
   1209 	    -re " +\[0-9\]+ 0012 1308\[^\n\]*\n"   { set x [expr $x+1] }
   1210 	    -re " +\[0-9\]+ 0014 1310\[^\n\]*\n"   { set x [expr $x+1] }
   1211 	    -re " +\[0-9\]+ 0016 1330\[^\n\]*\n"   { set x [expr $x+1] }
   1212 	    -re " +\[0-9\]+ 0018 1088\[^\n\]*\n"   { set x [expr $x+1] }
   1213 	    -re " +\[0-9\]+ 001a 1090\[^\n\]*\n"   { set x [expr $x+1] }
   1214 	    -re " +\[0-9\]+ 001c 10B0\[^\n\]*\n"   { set x [expr $x+1] }
   1215 	    -re " +\[0-9\]+ 001e 1188\[^\n\]*\n"   { set x [expr $x+1] }
   1216 	    -re " +\[0-9\]+ 0020 1190\[^\n\]*\n"   { set x [expr $x+1] }
   1217 	    -re " +\[0-9\]+ 0022 11B0\[^\n\]*\n"   { set x [expr $x+1] }
   1218 	    -re " +\[0-9\]+ 0024 1008\[^\n\]*\n"   { set x [expr $x+1] }
   1219 	    -re " +\[0-9\]+ 0026 1010\[^\n\]*\n"   { set x [expr $x+1] }
   1220 	    -re " +\[0-9\]+ 0028 1030\[^\n\]*\n"   { set x [expr $x+1] }
   1221 	    -re " +\[0-9\]+ 002a 1108\[^\n\]*\n"   { set x [expr $x+1] }
   1222 	    -re " +\[0-9\]+ 002c 1110\[^\n\]*\n"   { set x [expr $x+1] }
   1223 	    -re " +\[0-9\]+ 002e 1130\[^\n\]*\n"   { set x [expr $x+1] }
   1224 	    eof					{ break }
   1225 	}
   1226     }
   1227 
   1228     # This was intended to do any cleanup necessary.  It kinda looks like it
   1229     # isn't needed, but just in case, please keep it in for now.
   1230     gas_finish
   1231 
   1232     # Did we find what we were looking for?  If not, flunk it.
   1233     if [expr $x == 24] then { pass $testname } else { fail $testname }
   1234 }
   1235 
   1236 proc do_h8300h_extend {} {
   1237     set testname "extendh.s: h8300h extend tests"
   1238     set x 0
   1239 
   1240     gas_start "extendh.s" "-al"
   1241 
   1242     # Check each instruction bit pattern to verify it got
   1243     # assembled correctly.
   1244     while 1 {
   1245 	expect {
   1246 	    -re " +\[0-9\]+ 0000 17D0\[^\n\]*\n"   { set x [expr $x+1] }
   1247 	    -re " +\[0-9\]+ 0002 17F0\[^\n\]*\n"   { set x [expr $x+1] }
   1248 	    -re " +\[0-9\]+ 0004 1750\[^\n\]*\n"   { set x [expr $x+1] }
   1249 	    -re " +\[0-9\]+ 0006 1770\[^\n\]*\n"   { set x [expr $x+1] }
   1250 	    eof					{ break }
   1251 	}
   1252     }
   1253 
   1254     # This was intended to do any cleanup necessary.  It kinda looks like it
   1255     # isn't needed, but just in case, please keep it in for now.
   1256     gas_finish
   1257 
   1258     # Did we find what we were looking for?  If not, flunk it.
   1259     if [expr $x == 4] then { pass $testname } else { fail $testname }
   1260 }
   1261 
   1262 proc do_h8300s_add_sub {} {
   1263     set testname "addsubs.s: h8300s add/sub tests"
   1264     set x 0
   1265 
   1266     gas_start "addsubs.s" "-al"
   1267 
   1268     # Check each instruction bit pattern to verify it got
   1269     # assembled correctly.
   1270     while 1 {
   1271 	expect {
   1272 	    -re " +\[0-9\]+ 0000 8910\[^\n\]*\n"   { set x [expr $x+1] }
   1273 	    -re " +\[0-9\]+ 0002 0819\[^\n\]*\n"   { set x [expr $x+1] }
   1274 	    -re " +\[0-9\]+ 0004 79110020\[^\n\]*\n"   { set x [expr $x+1] }
   1275 	    -re " +\[0-9\]+ 0008 0912\[^\n\]*\n"   { set x [expr $x+1] }
   1276 	    -re " +\[0-9\]+ 000a 7A110000\[^\n\]*\n +\[0-9\]+ +0040\[^\n\]*\n"   { set x [expr $x+1] }
   1277 	    -re " +\[0-9\]+ 0010 0A92\[^\n\]*\n"   { set x [expr $x+1] }
   1278 	    -re " +\[0-9\]+ 0012 0B04\[^\n\]*\n"   { set x [expr $x+1] }
   1279 	    -re " +\[0-9\]+ 0014 0B85\[^\n\]*\n"   { set x [expr $x+1] }
   1280 	    -re " +\[0-9\]+ 0016 0B96\[^\n\]*\n"   { set x [expr $x+1] }
   1281 	    -re " +\[0-9\]+ 0018 0E89\[^\n\]*\n"   { set x [expr $x+1] }
   1282 	    -re " +\[0-9\]+ 001a 9210\[^\n\]*\n"   { set x [expr $x+1] }
   1283 	    -re " +\[0-9\]+ 001c 1889\[^\n\]*\n"   { set x [expr $x+1] }
   1284 	    -re " +\[0-9\]+ 001e 79310010\[^\n\]*\n"   { set x [expr $x+1] }
   1285 	    -re " +\[0-9\]+ 0022 1901\[^\n\]*\n"   { set x [expr $x+1] }
   1286 	    -re " +\[0-9\]+ 0024 7A310000\[^\n\]*\n +\[0-9\]+ +0040\[^\n\]*\n"   { set x [expr $x+1] }
   1287 	    -re " +\[0-9\]+ 002a 1A92\[^\n\]*\n"   { set x [expr $x+1] }
   1288 	    -re " +\[0-9\]+ 002c 1B04\[^\n\]*\n"   { set x [expr $x+1] }
   1289 	    -re " +\[0-9\]+ 002e 1B85\[^\n\]*\n"   { set x [expr $x+1] }
   1290 	    -re " +\[0-9\]+ 0030 1B96\[^\n\]*\n"   { set x [expr $x+1] }
   1291 	    -re " +\[0-9\]+ 0032 1E89\[^\n\]*\n"   { set x [expr $x+1] }
   1292 	    -re " +\[0-9\]+ 0034 B210\[^\n\]*\n"   { set x [expr $x+1] }
   1293 	    timeout 				{ perror "timeout\n; break }
   1294 	    eof					{ break }
   1295 	}
   1296     }
   1297 
   1298     # This was intended to do any cleanup necessary.  It kinda looks like it
   1299     # isn't needed, but just in case, please keep it in for now.
   1300     gas_finish
   1301 
   1302     # Did we find what we were looking for?  If not, flunk it.
   1303     if [expr $x == 21] then { pass $testname } else { fail $testname }
   1304 }
   1305 
   1306 proc do_h8300s_logical {} {
   1307     set testname "logicals.s: h8300s logical tests"
   1308     set x 0
   1309 
   1310     gas_start "logicals.s" "-al"
   1311 
   1312     # Check each instruction bit pattern to verify it got
   1313     # assembled correctly.
   1314     while 1 {
   1315 	expect {
   1316 	    -re " +\[0-9\]+ 0000 E910\[^\n\]*\n"   { set x [expr $x+1] }
   1317 	    -re " +\[0-9\]+ 0002 1691\[^\n\]*\n"   { set x [expr $x+1] }
   1318 	    -re " +\[0-9\]+ 0004 79610020\[^\n\]*\n"   { set x [expr $x+1] }
   1319 	    -re " +\[0-9\]+ 0008 6611\[^\n\]*\n"   { set x [expr $x+1] }
   1320 	    -re " +\[0-9\]+ 000a 7A610000\[^\n\]*\n +\[0-9\]+ +0040\[^\n\]*\n"   { set x [expr $x+1] }
   1321 	    -re " +\[0-9\]+ 0010 01F06611\[^\n\]*\n"   { set x [expr $x+1] }
   1322 	    -re " +\[0-9\]+ 0014 0610\[^\n\]*\n"   { set x [expr $x+1] }
   1323 	    -re " +\[0-9\]+ 0016 01410610\[^\n\]*\n"   { set x [expr $x+1] }
   1324 	    -re " +\[0-9\]+ 001a C810\[^\n\]*\n"   { set x [expr $x+1] }
   1325 	    -re " +\[0-9\]+ 001c 1498\[^\n\]*\n"   { set x [expr $x+1] }
   1326 	    -re " +\[0-9\]+ 001e 79410020\[^\n\]*\n"   { set x [expr $x+1] }
   1327 	    -re " +\[0-9\]+ 0022 6411\[^\n\]*\n"   { set x [expr $x+1] }
   1328 	    -re " +\[0-9\]+ 0024 7A410000\[^\n\]*\n +\[0-9\]+ +0040\[^\n\]*\n"   { set x [expr $x+1] }
   1329 	    -re " +\[0-9\]+ 002a 01F06411\[^\n\]*\n"   { set x [expr $x+1] }
   1330 	    -re " +\[0-9\]+ 002e 0410\[^\n\]*\n"   { set x [expr $x+1] }
   1331 	    -re " +\[0-9\]+ 0030 01410410\[^\n\]*\n"   { set x [expr $x+1] }
   1332 
   1333 	    -re " +\[0-9\]+ 0034 D810\[^\n\]*\n"   { set x [expr $x+1] }
   1334 	    -re " +\[0-9\]+ 0036 1589\[^\n\]*\n"   { set x [expr $x+1] }
   1335 	    -re " +\[0-9\]+ 0038 79510020\[^\n\]*\n"   { set x [expr $x+1] }
   1336 	    -re " +\[0-9\]+ 003c 6511\[^\n\]*\n"   { set x [expr $x+1] }
   1337 	    -re " +\[0-9\]+ 003e 7A510000\[^\n\]*\n +\[0-9\]+ +0040\[^\n\]*\n"   { set x [expr $x+1] }
   1338 	    -re " +\[0-9\]+ 0044 01F06511\[^\n\]*\n"   { set x [expr $x+1] }
   1339 	    -re " +\[0-9\]+ 0048 0510\[^\n\]*\n"   { set x [expr $x+1] }
   1340 	    -re " +\[0-9\]+ 004a 01410510\[^\n\]*\n"   { set x [expr $x+1] }
   1341 	    -re " +\[0-9\]+ 004e 1788\[^\n\]*\n"   { set x [expr $x+1] }
   1342 	    -re " +\[0-9\]+ 0050 1790\[^\n\]*\n"   { set x [expr $x+1] }
   1343 	    -re " +\[0-9\]+ 0052 17B0\[^\n\]*\n"   { set x [expr $x+1] }
   1344 	    -re " +\[0-9\]+ 0054 1708\[^\n\]*\n"   { set x [expr $x+1] }
   1345 	    -re " +\[0-9\]+ 0056 1710\[^\n\]*\n"   { set x [expr $x+1] }
   1346 	    -re " +\[0-9\]+ 0058 1730\[^\n\]*\n"   { set x [expr $x+1] }
   1347 	    timeout 				{ perror "timeout\n; break }
   1348 	    eof					{ break }
   1349 	}
   1350     }
   1351 
   1352     # This was intended to do any cleanup necessary.  It kinda looks like it
   1353     # isn't needed, but just in case, please keep it in for now.
   1354     gas_finish
   1355 
   1356     # Did we find what we were looking for?  If not, flunk it.
   1357     if [expr $x == 30] then { pass $testname } else { fail $testname }
   1358 }
   1359 
   1360 proc do_h8300s_cbranch {} {
   1361     set testname "cbranchs.s: h8300s conditional branch tests"
   1362     set x 0
   1363 
   1364     gas_start "cbranchs.s" "-al"
   1365 
   1366     # Check each instruction bit pattern to verify it got
   1367     # assembled correctly.
   1368     while 1 {
   1369 	expect {
   1370 	    -re " +\[0-9\]+ 0000 4000\[^\n\]*\n"   { set x [expr $x+1] }
   1371 	    -re " +\[0-9\]+ 0002 4000\[^\n\]*\n"   { set x [expr $x+1] }
   1372 	    -re " +\[0-9\]+ 0004 4100\[^\n\]*\n"   { set x [expr $x+1] }
   1373 	    -re " +\[0-9\]+ 0006 4100\[^\n\]*\n"   { set x [expr $x+1] }
   1374 	    -re " +\[0-9\]+ 0008 4200\[^\n\]*\n"   { set x [expr $x+1] }
   1375 	    -re " +\[0-9\]+ 000a 4300\[^\n\]*\n"   { set x [expr $x+1] }
   1376 	    -re " +\[0-9\]+ 000c 4400\[^\n\]*\n"   { set x [expr $x+1] }
   1377 	    -re " +\[0-9\]+ 000e 4400\[^\n\]*\n"   { set x [expr $x+1] }
   1378 	    -re " +\[0-9\]+ 0010 4500\[^\n\]*\n"   { set x [expr $x+1] }
   1379 	    -re " +\[0-9\]+ 0012 4500\[^\n\]*\n"   { set x [expr $x+1] }
   1380 	    -re " +\[0-9\]+ 0014 4600\[^\n\]*\n"   { set x [expr $x+1] }
   1381 	    -re " +\[0-9\]+ 0016 4700\[^\n\]*\n"   { set x [expr $x+1] }
   1382 	    -re " +\[0-9\]+ 0018 4800\[^\n\]*\n"   { set x [expr $x+1] }
   1383 	    -re " +\[0-9\]+ 001a 4900\[^\n\]*\n"   { set x [expr $x+1] }
   1384 	    -re " +\[0-9\]+ 001c 4A00\[^\n\]*\n"   { set x [expr $x+1] }
   1385 	    -re " +\[0-9\]+ 001e 4B00\[^\n\]*\n"   { set x [expr $x+1] }
   1386 	    -re " +\[0-9\]+ 0020 4C00\[^\n\]*\n"   { set x [expr $x+1] }
   1387 	    -re " +\[0-9\]+ 0022 4D00\[^\n\]*\n"   { set x [expr $x+1] }
   1388 	    -re " +\[0-9\]+ 0024 4E00\[^\n\]*\n"   { set x [expr $x+1] }
   1389 	    -re " +\[0-9\]+ 0026 4F00\[^\n\]*\n"   { set x [expr $x+1] }
   1390 	    -re " +\[0-9\]+ 0028 58000000\[^\n\]*\n"   { set x [expr $x+1] }
   1391 	    -re " +\[0-9\]+ 002c 58000000\[^\n\]*\n"   { set x [expr $x+1] }
   1392 	    -re " +\[0-9\]+ 0030 58100000\[^\n\]*\n"   { set x [expr $x+1] }
   1393 	    -re " +\[0-9\]+ 0034 58100000\[^\n\]*\n"   { set x [expr $x+1] }
   1394 	    -re " +\[0-9\]+ 0038 58200000\[^\n\]*\n"   { set x [expr $x+1] }
   1395 	    -re " +\[0-9\]+ 003c 58300000\[^\n\]*\n"   { set x [expr $x+1] }
   1396 	    -re " +\[0-9\]+ 0040 58400000\[^\n\]*\n"   { set x [expr $x+1] }
   1397 	    -re " +\[0-9\]+ 0044 58400000\[^\n\]*\n"   { set x [expr $x+1] }
   1398 	    -re " +\[0-9\]+ 0048 58500000\[^\n\]*\n"   { set x [expr $x+1] }
   1399 	    -re " +\[0-9\]+ 004c 58500000\[^\n\]*\n"   { set x [expr $x+1] }
   1400 	    -re " +\[0-9\]+ 0050 58600000\[^\n\]*\n"   { set x [expr $x+1] }
   1401 	    -re " +\[0-9\]+ 0054 58700000\[^\n\]*\n"   { set x [expr $x+1] }
   1402 	    -re " +\[0-9\]+ 0058 58800000\[^\n\]*\n"   { set x [expr $x+1] }
   1403 	    -re " +\[0-9\]+ 005c 58900000\[^\n\]*\n"   { set x [expr $x+1] }
   1404 	    -re " +\[0-9\]+ 0060 58A00000\[^\n\]*\n"   { set x [expr $x+1] }
   1405 	    -re " +\[0-9\]+ 0064 58B00000\[^\n\]*\n"   { set x [expr $x+1] }
   1406 	    -re " +\[0-9\]+ 0068 58C00000\[^\n\]*\n"   { set x [expr $x+1] }
   1407 	    -re " +\[0-9\]+ 006c 58D00000\[^\n\]*\n"   { set x [expr $x+1] }
   1408 	    -re " +\[0-9\]+ 0070 58E00000\[^\n\]*\n"   { set x [expr $x+1] }
   1409 	    -re " +\[0-9\]+ 0074 58F00000\[^\n\]*\n"   { set x [expr $x+1] }
   1410 	    timeout 				{ perror "timeout\n; break }
   1411 	    eof					{ break }
   1412 	}
   1413     }
   1414 
   1415     # This was intended to do any cleanup necessary.  It kinda looks like it
   1416     # isn't needed, but just in case, please keep it in for now.
   1417     gas_finish
   1418 
   1419     # Did we find what we were looking for?  If not, flunk it.
   1420     if [expr $x == 40] then { pass $testname } else { fail $testname }
   1421 }
   1422 proc do_h8300s_bitops1 {} {
   1423     set testname "bitops1s.s: h8300s bitops tests #1"
   1424     set x 0
   1425 
   1426     gas_start "bitops1s.s" "-al"
   1427 
   1428     # Check each instruction bit pattern to verify it got
   1429     # assembled correctly.
   1430     while 1 {
   1431 	expect {
   1432 	    -re " +\[0-9\]+ 0000 7608\[^\n\]*\n"   { set x [expr $x+1] }
   1433 	    -re " +\[0-9\]+ 0002 7C007600\[^\n\]*\n"   { set x [expr $x+1] }
   1434 	    -re " +\[0-9\]+ 0006 7E407600\[^\n\]*\n"   { set x [expr $x+1] }
   1435 	    -re " +\[0-9\]+ 000a 6A100080\[^\n\]*\n +\[0-9\]+ +7600"   { set x [expr $x+1] }
   1436 	    -re " +\[0-9\]+ 0010 6A300001\[^\n\]*\n +\[0-9\]+ +00007600"   { set x [expr $x+1] }
   1437 	    -re " +\[0-9\]+ 0018 7208\[^\n\]*\n"   { set x [expr $x+1] }
   1438 	    -re " +\[0-9\]+ 001a 7D007200\[^\n\]*\n"   { set x [expr $x+1] }
   1439 	    -re " +\[0-9\]+ 001e 7F407200\[^\n\]*\n"   { set x [expr $x+1] }
   1440 	    -re " +\[0-9\]+ 0022 6A180080\[^\n\]*\n +\[0-9\]+ +7200"   { set x [expr $x+1] }
   1441 	    -re " +\[0-9\]+ 0028 6A380001\[^\n\]*\n +\[0-9\]+ +00007200"   { set x [expr $x+1] }
   1442 	    -re " +\[0-9\]+ 0030 6298\[^\n\]*\n"   { set x [expr $x+1] }
   1443 	    -re " +\[0-9\]+ 0032 7D006290\[^\n\]*\n"   { set x [expr $x+1] }
   1444 	    -re " +\[0-9\]+ 0036 7F406290\[^\n\]*\n"   { set x [expr $x+1] }
   1445 	    -re " +\[0-9\]+ 003a 6A180080\[^\n\]*\n +\[0-9\]+ +6290"   { set x [expr $x+1] }
   1446 	    -re " +\[0-9\]+ 0040 6A380001\[^\n\]*\n +\[0-9\]+ +00006290"   { set x [expr $x+1] }
   1447 	    -re " +\[0-9\]+ 0048 7688\[^\n\]*\n"   { set x [expr $x+1] }
   1448 	    -re " +\[0-9\]+ 004a 7C007680\[^\n\]*\n"   { set x [expr $x+1] }
   1449 	    -re " +\[0-9\]+ 004e 7E407680\[^\n\]*\n"   { set x [expr $x+1] }
   1450 	    -re " +\[0-9\]+ 0052 6A100080\[^\n\]*\n +\[0-9\]+ +7680"   { set x [expr $x+1] }
   1451 	    -re " +\[0-9\]+ 0058 6A300001\[^\n\]*\n +\[0-9\]+ +00007680"   { set x [expr $x+1] }
   1452 	    -re " +\[0-9\]+ 0060 7788\[^\n\]*\n"   { set x [expr $x+1] }
   1453 	    -re " +\[0-9\]+ 0062 7C007780\[^\n\]*\n"   { set x [expr $x+1] }
   1454 	    -re " +\[0-9\]+ 0066 7E407780\[^\n\]*\n"   { set x [expr $x+1] }
   1455 	    -re " +\[0-9\]+ 006a 6A100080\[^\n\]*\n +\[0-9\]+ +7780"   { set x [expr $x+1] }
   1456 	    -re " +\[0-9\]+ 0070 6A300001\[^\n\]*\n +\[0-9\]+ +00007780"   { set x [expr $x+1] }
   1457 	    timeout 				{ perror "timeout\n; break }
   1458 	    eof					{ break }
   1459 	}
   1460     }
   1461 
   1462     # This was intended to do any cleanup necessary.  It kinda looks like it
   1463     # isn't needed, but just in case, please keep it in for now.
   1464     gas_finish
   1465 
   1466     # Did we find what we were looking for?  If not, flunk it.
   1467     if [expr $x == 25] then { pass $testname } else { fail $testname }
   1468 }
   1469 
   1470 proc do_h8300s_bitops2 {} {
   1471     set testname "bitops2s.s: h8300s bitops tests #2"
   1472     set x 0
   1473 
   1474     gas_start "bitops2s.s" "-al"
   1475 
   1476     # Check each instruction bit pattern to verify it got
   1477     # assembled correctly.
   1478     while 1 {
   1479 	expect {
   1480 	    -re " +\[0-9\]+ 0000 7488\[^\n\]*\n"   { set x [expr $x+1] }
   1481 	    -re " +\[0-9\]+ 0002 7C007480\[^\n\]*\n"   { set x [expr $x+1] }
   1482 	    -re " +\[0-9\]+ 0006 7E407480\[^\n\]*\n"   { set x [expr $x+1] }
   1483 	    -re " +\[0-9\]+ 000a 6A100080\[^\n\]*\n +\[0-9\]+ +7480"   { set x [expr $x+1] }
   1484 	    -re " +\[0-9\]+ 0010 6A300001\[^\n\]*\n +\[0-9\]+ +00007480"   { set x [expr $x+1] }
   1485 	    -re " +\[0-9\]+ 0018 6788\[^\n\]*\n"   { set x [expr $x+1] }
   1486 	    -re " +\[0-9\]+ 001a 7D006780\[^\n\]*\n"   { set x [expr $x+1] }
   1487 	    -re " +\[0-9\]+ 001e 7F406780\[^\n\]*\n"   { set x [expr $x+1] }
   1488 	    -re " +\[0-9\]+ 0022 6A180080\[^\n\]*\n +\[0-9\]+ +6780"   { set x [expr $x+1] }
   1489 	    -re " +\[0-9\]+ 0028 6A380001\[^\n\]*\n +\[0-9\]+ +00006780"   { set x [expr $x+1] }
   1490 
   1491 	    -re " +\[0-9\]+ 0030 7588\[^\n\]*\n"   { set x [expr $x+1] }
   1492 	    -re " +\[0-9\]+ 0032 7C007580\[^\n\]*\n"   { set x [expr $x+1] }
   1493 	    -re " +\[0-9\]+ 0036 7E407580\[^\n\]*\n"   { set x [expr $x+1] }
   1494 	    -re " +\[0-9\]+ 003a 6A100080\[^\n\]*\n +\[0-9\]+ +7580"   { set x [expr $x+1] }
   1495 	    -re " +\[0-9\]+ 0040 6A300001\[^\n\]*\n +\[0-9\]+ +00007580"   { set x [expr $x+1] }
   1496 	    -re " +\[0-9\]+ 0048 7708\[^\n\]*\n"   { set x [expr $x+1] }
   1497 	    -re " +\[0-9\]+ 004a 7C007700\[^\n\]*\n"   { set x [expr $x+1] }
   1498 	    -re " +\[0-9\]+ 004e 7E407700\[^\n\]*\n"   { set x [expr $x+1] }
   1499 	    -re " +\[0-9\]+ 0052 6A100080\[^\n\]*\n +\[0-9\]+ +7700"   { set x [expr $x+1] }
   1500 	    -re " +\[0-9\]+ 0058 6A300001\[^\n\]*\n +\[0-9\]+ +00007700"   { set x [expr $x+1] }
   1501 	    timeout 				{ perror "timeout\n; break }
   1502 	    eof					{ break }
   1503 	}
   1504     }
   1505 
   1506     # This was intended to do any cleanup necessary.  It kinda looks like it
   1507     # isn't needed, but just in case, please keep it in for now.
   1508     gas_finish
   1509 
   1510     # Did we find what we were looking for?  If not, flunk it.
   1511     if [expr $x == 20] then { pass $testname } else { fail $testname }
   1512 }
   1513 
   1514 proc do_h8300s_bitops3 {} {
   1515     set testname "bitops3s.s: h8300s bitops tests #3"
   1516     set x 0
   1517 
   1518     gas_start "bitops3s.s" "-al"
   1519 
   1520     # Check each instruction bit pattern to verify it got
   1521     # assembled correctly.
   1522     while 1 {
   1523 	expect {
   1524 	    -re " +\[0-9\]+ 0000 7108\[^\n\]*\n"   { set x [expr $x+1] }
   1525 	    -re " +\[0-9\]+ 0002 7D007100\[^\n\]*\n"   { set x [expr $x+1] }
   1526 	    -re " +\[0-9\]+ 0006 7F407100\[^\n\]*\n"   { set x [expr $x+1] }
   1527 	    -re " +\[0-9\]+ 000a 6A180080\[^\n\]*\n +\[0-9\]+ +7100"   { set x [expr $x+1] }
   1528 	    -re " +\[0-9\]+ 0010 6A380001\[^\n\]*\n +\[0-9\]+ +00007100"   { set x [expr $x+1] }
   1529 	    -re " +\[0-9\]+ 0018 6198\[^\n\]*\n"   { set x [expr $x+1] }
   1530 	    -re " +\[0-9\]+ 001a 7D006190\[^\n\]*\n"   { set x [expr $x+1] }
   1531 	    -re " +\[0-9\]+ 001e 7F406190\[^\n\]*\n"   { set x [expr $x+1] }
   1532 	    -re " +\[0-9\]+ 0022 6A180080\[^\n\]*\n +\[0-9\]+ +6190"   { set x [expr $x+1] }
   1533 	    -re " +\[0-9\]+ 0028 6A380001\[^\n\]*\n +\[0-9\]+ +00006190"   { set x [expr $x+1] }
   1534 	    -re " +\[0-9\]+ 0030 7008\[^\n\]*\n"   { set x [expr $x+1] }
   1535 	    -re " +\[0-9\]+ 0032 7D007000\[^\n\]*\n"   { set x [expr $x+1] }
   1536 	    -re " +\[0-9\]+ 0036 7F407000\[^\n\]*\n"   { set x [expr $x+1] }
   1537 	    -re " +\[0-9\]+ 003a 6A180080\[^\n\]*\n +\[0-9\]+ +7000"   { set x [expr $x+1] }
   1538 	    -re " +\[0-9\]+ 0040 6A380001\[^\n\]*\n +\[0-9\]+ +00007000"   { set x [expr $x+1] }
   1539 	    -re " +\[0-9\]+ 0048 6098\[^\n\]*\n"   { set x [expr $x+1] }
   1540 	    -re " +\[0-9\]+ 004a 7D006090\[^\n\]*\n"   { set x [expr $x+1] }
   1541 	    -re " +\[0-9\]+ 004e 7F406090\[^\n\]*\n"   { set x [expr $x+1] }
   1542 	    -re " +\[0-9\]+ 0052 6A180080\[^\n\]*\n +\[0-9\]+ +6090"   { set x [expr $x+1] }
   1543 	    -re " +\[0-9\]+ 0058 6A380001\[^\n\]*\n +\[0-9\]+ +00006090"   { set x [expr $x+1] }
   1544 	    timeout 				{ perror "timeout\n; break }
   1545 	    eof					{ break }
   1546 	}
   1547     }
   1548 
   1549     # This was intended to do any cleanup necessary.  It kinda looks like it
   1550     # isn't needed, but just in case, please keep it in for now.
   1551     gas_finish
   1552 
   1553     # Did we find what we were looking for?  If not, flunk it.
   1554     if [expr $x == 20] then { pass $testname } else { fail $testname }
   1555 }
   1556 
   1557 proc do_h8300s_bitops4 {} {
   1558     set testname "bitops4s.s: h8300s bitops tests #4"
   1559     set x 0
   1560 
   1561     gas_start "bitops4s.s" "-al"
   1562 
   1563     # Check each instruction bit pattern to verify it got
   1564     # assembled correctly.
   1565     while 1 {
   1566 	expect {
   1567 	    -re " +\[0-9\]+ 0000 7408\[^\n\]*\n"   { set x [expr $x+1] }
   1568 	    -re " +\[0-9\]+ 0002 7C007400\[^\n\]*\n"   { set x [expr $x+1] }
   1569 	    -re " +\[0-9\]+ 0006 7E407400\[^\n\]*\n"   { set x [expr $x+1] }
   1570 	    -re " +\[0-9\]+ 000a 6A100080\[^\n\]*\n +\[0-9\]+ +7400"   { set x [expr $x+1] }
   1571 	    -re " +\[0-9\]+ 0010 6A300001\[^\n\]*\n +\[0-9\]+ +00007400"   { set x [expr $x+1] }
   1572 	    -re " +\[0-9\]+ 0018 6708\[^\n\]*\n"   { set x [expr $x+1] }
   1573 	    -re " +\[0-9\]+ 001a 7D006700\[^\n\]*\n"   { set x [expr $x+1] }
   1574 	    -re " +\[0-9\]+ 001e 7F406700\[^\n\]*\n"   { set x [expr $x+1] }
   1575 	    -re " +\[0-9\]+ 0022 6A180080\[^\n\]*\n +\[0-9\]+ +6700"   { set x [expr $x+1] }
   1576 	    -re " +\[0-9\]+ 0028 6A380001\[^\n\]*\n +\[0-9\]+ +00006700"   { set x [expr $x+1] }
   1577 	    -re " +\[0-9\]+ 0030 7308\[^\n\]*\n"   { set x [expr $x+1] }
   1578 	    -re " +\[0-9\]+ 0032 7C007300\[^\n\]*\n"   { set x [expr $x+1] }
   1579 	    -re " +\[0-9\]+ 0036 7E407300\[^\n\]*\n"   { set x [expr $x+1] }
   1580 	    -re " +\[0-9\]+ 003a 6A100080\[^\n\]*\n +\[0-9\]+ +7300"   { set x [expr $x+1] }
   1581 	    -re " +\[0-9\]+ 0040 6A300001\[^\n\]*\n +\[0-9\]+ +00007300"   { set x [expr $x+1] }
   1582 	    -re " +\[0-9\]+ 0048 6398\[^\n\]*\n"   { set x [expr $x+1] }
   1583 	    -re " +\[0-9\]+ 004a 7C006390\[^\n\]*\n"   { set x [expr $x+1] }
   1584 	    -re " +\[0-9\]+ 004e 7E406390\[^\n\]*\n"   { set x [expr $x+1] }
   1585 	    -re " +\[0-9\]+ 0052 6A100080\[^\n\]*\n +\[0-9\]+ +6390"   { set x [expr $x+1] }
   1586 	    -re " +\[0-9\]+ 0058 6A300001\[^\n\]*\n +\[0-9\]+ +00006390"   { set x [expr $x+1] }
   1587 	    -re " +\[0-9\]+ 0060 7508\[^\n\]*\n"   { set x [expr $x+1] }
   1588 	    -re " +\[0-9\]+ 0062 7C007500\[^\n\]*\n"   { set x [expr $x+1] }
   1589 	    -re " +\[0-9\]+ 0066 7E407500\[^\n\]*\n"   { set x [expr $x+1] }
   1590 	    -re " +\[0-9\]+ 006a 6A100080\[^\n\]*\n +\[0-9\]+ +7500"   { set x [expr $x+1] }
   1591 	    -re " +\[0-9\]+ 0070 6A300001\[^\n\]*\n +\[0-9\]+ +00007500"   { set x [expr $x+1] }
   1592 	    timeout 				{ perror "timeout\n; break }
   1593 	    eof					{ break }
   1594 	}
   1595     }
   1596 
   1597     # This was intended to do any cleanup necessary.  It kinda looks like it
   1598     # isn't needed, but just in case, please keep it in for now.
   1599     gas_finish
   1600 
   1601     # Did we find what we were looking for?  If not, flunk it.
   1602     if [expr $x == 25] then { pass $testname } else { fail $testname }
   1603 }
   1604 
   1605 proc do_h8300s_branch {} {
   1606     set testname "branchs.s: h8300s branch tests"
   1607     set x 0
   1608 
   1609     gas_start "branchs.s" "-al"
   1610 
   1611     # Check each instruction bit pattern to verify it got
   1612     # assembled correctly.
   1613     while 1 {
   1614 	expect {
   1615 	    -re " +\[0-9\]+ 0000 5500\[^\n\]*\n"   { set x [expr $x+1] }
   1616 	    -re " +\[0-9\]+ 0002 5C000000\[^\n\]*\n"   { set x [expr $x+1] }
   1617 	    -re " +\[0-9\]+ 0006 5A000000\[^\n\]*\n"   { set x [expr $x+1] }
   1618 	    -re " +\[0-9\]+ 000a 5900\[^\n\]*\n"   { set x [expr $x+1] }
   1619 	    -re " +\[0-9\]+ 000c 5B00\[^\n\]*\n"   { set x [expr $x+1] }
   1620 	    -re " +\[0-9\]+ 000e 5E000000\[^\n\]*\n"   { set x [expr $x+1] }
   1621 	    -re " +\[0-9\]+ 0012 5D00\[^\n\]*\n"   { set x [expr $x+1] }
   1622 	    -re " +\[0-9\]+ 0014 5F00\[^\n\]*\n"   { set x [expr $x+1] }
   1623 	    timeout 				{ perror "timeout\n; break }
   1624 	    eof					{ break }
   1625 	}
   1626     }
   1627 
   1628     # This was intended to do any cleanup necessary.  It kinda looks like it
   1629     # isn't needed, but just in case, please keep it in for now.
   1630     gas_finish
   1631 
   1632     # Did we find what we were looking for?  If not, flunk it.
   1633     if [expr $x == 8] then { pass $testname } else { fail $testname }
   1634 }
   1635 
   1636 proc do_h8300s_compare {} {
   1637     set testname "compares.s: h8300s compare tests"
   1638     set x 0
   1639 
   1640     gas_start "compares.s" "-al"
   1641 
   1642     # Check each instruction bit pattern to verify it got
   1643     # assembled correctly.
   1644     while 1 {
   1645 	expect {
   1646 	    -re " +\[0-9\]+ 0000 A800\[^\n\]*\n"   { set x [expr $x+1] }
   1647 	    -re " +\[0-9\]+ 0002 1C08\[^\n\]*\n"   { set x [expr $x+1] }
   1648 	    -re " +\[0-9\]+ 0004 79200020\[^\n\]*\n"   { set x [expr $x+1] }
   1649 	    -re " +\[0-9\]+ 0008 1D01\[^\n\]*\n"   { set x [expr $x+1] }
   1650 	    -re " +\[0-9\]+ 000a 7A200000\[^\n\]*\n +\[0-9\]+ +0040\[^\n\]*\n"   { set x [expr $x+1] }
   1651 	    -re " +\[0-9\]+ 0010 1F81\[^\n\]*\n"   { set x [expr $x+1] }
   1652 	    timeout 				{ perror "timeout\n; break }
   1653 	    eof					{ break }
   1654 	}
   1655     }
   1656 
   1657     # This was intended to do any cleanup necessary.  It kinda looks like it
   1658     # isn't needed, but just in case, please keep it in for now.
   1659     gas_finish
   1660 
   1661     # Did we find what we were looking for?  If not, flunk it.
   1662     if [expr $x == 6] then { pass $testname } else { fail $testname }
   1663 }
   1664 
   1665 proc do_h8300s_decimal {} {
   1666     set testname "decimals.s: h8300s decimal tests"
   1667     set x 0
   1668 
   1669     gas_start "decimals.s" "-al"
   1670 
   1671     # Check each instruction bit pattern to verify it got
   1672     # assembled correctly.
   1673     while 1 {
   1674 	expect {
   1675 	    -re " +\[0-9\]+ 0000 0F08\[^\n\]*\n"   { set x [expr $x+1] }
   1676 	    -re " +\[0-9\]+ 0002 1F08\[^\n\]*\n"   { set x [expr $x+1] }
   1677 	    eof					{ break }
   1678 	}
   1679     }
   1680 
   1681     # This was intended to do any cleanup necessary.  It kinda looks like it
   1682     # isn't needed, but just in case, please keep it in for now.
   1683     gas_finish
   1684 
   1685     # Did we find what we were looking for?  If not, flunk it.
   1686     if [expr $x == 2] then { pass $testname } else { fail $testname }
   1687 }
   1688 
   1689 proc do_h8300s_incdec {} {
   1690     set testname "incdecs.s: h8300s incdec tests"
   1691     set x 0
   1692 
   1693     gas_start "incdecs.s" "-al"
   1694 
   1695     # Check each instruction bit pattern to verify it got
   1696     # assembled correctly.
   1697     while 1 {
   1698 	expect {
   1699 	    -re " +\[0-9\]+ 0000 1A08\[^\n\]*\n"   { set x [expr $x+1] }
   1700 	    -re " +\[0-9\]+ 0002 1B50\[^\n\]*\n"   { set x [expr $x+1] }
   1701 	    -re " +\[0-9\]+ 0004 1BD0\[^\n\]*\n"   { set x [expr $x+1] }
   1702 	    -re " +\[0-9\]+ 0006 1B70\[^\n\]*\n"   { set x [expr $x+1] }
   1703 	    -re " +\[0-9\]+ 0008 1BF0\[^\n\]*\n"   { set x [expr $x+1] }
   1704 	    -re " +\[0-9\]+ 000a 0A08\[^\n\]*\n"   { set x [expr $x+1] }
   1705 	    -re " +\[0-9\]+ 000c 0B50\[^\n\]*\n"   { set x [expr $x+1] }
   1706 	    -re " +\[0-9\]+ 000e 0BD0\[^\n\]*\n"   { set x [expr $x+1] }
   1707 	    -re " +\[0-9\]+ 0010 0B70\[^\n\]*\n"   { set x [expr $x+1] }
   1708 	    -re " +\[0-9\]+ 0012 0BF0\[^\n\]*\n"   { set x [expr $x+1] }
   1709 	    eof					{ break }
   1710 	}
   1711     }
   1712 
   1713     # This was intended to do any cleanup necessary.  It kinda looks like it
   1714     # isn't needed, but just in case, please keep it in for now.
   1715     gas_finish
   1716 
   1717     # Did we find what we were looking for?  If not, flunk it.
   1718     if [expr $x == 10] then { pass $testname } else { fail $testname }
   1719 }
   1720 
   1721 proc do_h8300s_divmul {} {
   1722     set testname "divmuls.s: h8300s divmul tests"
   1723     set x 0
   1724 
   1725     gas_start "divmuls.s" "-al"
   1726 
   1727     # Check each instruction bit pattern to verify it got
   1728     # assembled correctly.
   1729     while 1 {
   1730 	expect {
   1731 	    -re " +\[0-9\]+ 0000 5181\[^\n\]*\n"   { set x [expr $x+1] }
   1732 	    -re " +\[0-9\]+ 0002 5301\[^\n\]*\n"   { set x [expr $x+1] }
   1733 	    -re " +\[0-9\]+ 0004 01D05181\[^\n\]*\n"   { set x [expr $x+1] }
   1734 	    -re " +\[0-9\]+ 0008 01D05301\[^\n\]*\n"   { set x [expr $x+1] }
   1735 	    -re " +\[0-9\]+ 000c 5081\[^\n\]*\n"   { set x [expr $x+1] }
   1736 	    -re " +\[0-9\]+ 000e 5201\[^\n\]*\n"   { set x [expr $x+1] }
   1737 	    -re " +\[0-9\]+ 0010 01C05081\[^\n\]*\n"   { set x [expr $x+1] }
   1738 	    -re " +\[0-9\]+ 0014 01C05201\[^\n\]*\n"   { set x [expr $x+1] }
   1739 	    eof					{ break }
   1740 	}
   1741     }
   1742 
   1743     # This was intended to do any cleanup necessary.  It kinda looks like it
   1744     # isn't needed, but just in case, please keep it in for now.
   1745     gas_finish
   1746 
   1747     # Did we find what we were looking for?  If not, flunk it.
   1748     if [expr $x == 8] then { pass $testname } else { fail $testname }
   1749 }
   1750 
   1751 proc do_h8300s_misc {} {
   1752     set testname "miscs.s: h8300s misc tests"
   1753     set x 0
   1754 
   1755     gas_start "miscs.s" "-al"
   1756 
   1757     # Check each instruction bit pattern to verify it got
   1758     # assembled correctly.
   1759     while 1 {
   1760 	expect {
   1761 	    -re " +\[0-9\]+ 0000 7B5C598F\[^\n\]*\n"   { set x [expr $x+1] }
   1762 	    -re " +\[0-9\]+ 0004 7BD4598F\[^\n\]*\n"   { set x [expr $x+1] }
   1763 	    -re " +\[0-9\]+ 0008 0700\[^\n\]*\n"   { set x [expr $x+1] }
   1764 	    -re " +\[0-9\]+ 000a 0308\[^\n\]*\n"   { set x [expr $x+1] }
   1765 	    -re " +\[0-9\]+ 000c 01410700\[^\n\]*\n"   { set x [expr $x+1] }
   1766 	    -re " +\[0-9\]+ 0010 0318\[^\n\]*\n"   { set x [expr $x+1] }
   1767 	    -re " +\[0-9\]+ 0012 01406900\[^\n\]*\n"   { set x [expr $x+1] }
   1768 	    -re " +\[0-9\]+ 0016 01406F00\[^\n\]*\n +\[0-9\]+ +0010\[^\n\]*\n"   { set x [expr $x+1] }
   1769 	    -re " +\[0-9\]+ 001c 01407800\[^\n\]*\n +\[0-9\]+ +6B200000\[^\n\]*\n +\[0-9\]+ +0020\[^\n\]*\n"   { set x [expr $x+1] }
   1770 	    -re " +\[0-9\]+ 0026 01406D00\[^\n\]*\n"   { set x [expr $x+1] }
   1771 	    -re " +\[0-9\]+ 002a 01406B00\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n"   { set x [expr $x+1] }
   1772 	    -re " +\[0-9\]+ 0030 01406B20\[^\n\]*\n +\[0-9\]+ +00000000\[^\n\]*\n"   { set x [expr $x+1] }
   1773 	    -re " +\[0-9\]+ 0038 01416900\[^\n\]*\n"   { set x [expr $x+1] }
   1774 	    -re " +\[0-9\]+ 003c 01416F00\[^\n\]*\n +\[0-9\]+ +0010\[^\n\]*\n"   { set x [expr $x+1] }
   1775 	    -re " +\[0-9\]+ 0042 01417800\[^\n\]*\n +\[0-9\]+ +6B200000\[^\n\]*\n +\[0-9\]+ +0020\[^\n\]*\n"   { set x [expr $x+1] }
   1776 	    -re " +\[0-9\]+ 004c 01416D00\[^\n\]*\n"   { set x [expr $x+1] }
   1777 	    -re " +\[0-9\]+ 0050 01416B00\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n"   { set x [expr $x+1] }
   1778 	    -re " +\[0-9\]+ 0056 01416B20\[^\n\]*\n +\[0-9\]+ +00000000\[^\n\]*\n"   { set x [expr $x+1] }
   1779 	    -re " +\[0-9\]+ 005e 0000\[^\n\]*\n"   { set x [expr $x+1] }
   1780 	    -re " +\[0-9\]+ 0060 5670\[^\n\]*\n"   { set x [expr $x+1] }
   1781 	    -re " +\[0-9\]+ 0062 5470\[^\n\]*\n"   { set x [expr $x+1] }
   1782 	    -re " +\[0-9\]+ 0064 0180\[^\n\]*\n"   { set x [expr $x+1] }
   1783 	    -re " +\[0-9\]+ 0066 0208\[^\n\]*\n"   { set x [expr $x+1] }
   1784 	    -re " +\[0-9\]+ 0068 0218\[^\n\]*\n"   { set x [expr $x+1] }
   1785 	    -re " +\[0-9\]+ 006a 01406980\[^\n\]*\n"   { set x [expr $x+1] }
   1786 	    -re " +\[0-9\]+ 006e 01406F80\[^\n\]*\n +\[0-9\]+ +0010\[^\n\]*\n"   { set x [expr $x+1] }
   1787 	    -re " +\[0-9\]+ 0074 01407800\[^\n\]*\n +\[0-9\]+ +6BA00000\[^\n\]*\n +\[0-9\]+ +0020\[^\n\]*\n"   { set x [expr $x+1] }
   1788 	    -re " +\[0-9\]+ 007e 01406D80\[^\n\]*\n"   { set x [expr $x+1] }
   1789 	    -re " +\[0-9\]+ 0082 01406B80\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n"   { set x [expr $x+1] }
   1790 	    -re " +\[0-9\]+ 0088 01406BA0\[^\n\]*\n +\[0-9\]+ +00000000\[^\n\]*\n"   { set x [expr $x+1] }
   1791 	    -re " +\[0-9\]+ 0090 01416980\[^\n\]*\n"   { set x [expr $x+1] }
   1792 	    -re " +\[0-9\]+ 0094 01416F80\[^\n\]*\n +\[0-9\]+ +0010\[^\n\]*\n"   { set x [expr $x+1] }
   1793 	    -re " +\[0-9\]+ 009a 01417800\[^\n\]*\n +\[0-9\]+ +6BA00000\[^\n\]*\n +\[0-9\]+ +0020\[^\n\]*\n"   { set x [expr $x+1] }
   1794 	    -re " +\[0-9\]+ 00a4 01416D80\[^\n\]*\n"   { set x [expr $x+1] }
   1795 	    -re " +\[0-9\]+ 00a8 01416B80\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n"   { set x [expr $x+1] }
   1796 	    -re " +\[0-9\]+ 00ae 01416BA0\[^\n\]*\n +\[0-9\]+ +00000000\[^\n\]*\n"   { set x [expr $x+1] }
   1797 	    eof					{ break }
   1798 	}
   1799     }
   1800 
   1801     # This was intended to do any cleanup necessary.  It kinda looks like it
   1802     # isn't needed, but just in case, please keep it in for now.
   1803     gas_finish
   1804 
   1805     # Did we find what we were looking for?  If not, flunk it.
   1806     if [expr $x == 36] then { pass $testname } else { fail $testname }
   1807 
   1808     setup_xfail "h8300*-*-*"
   1809     fail "h8300s movfpe/movtpe tests"
   1810 }
   1811 
   1812 proc do_h8300s_movb {} {
   1813     set testname "movbs.s: h8300s movb tests"
   1814     set x 0
   1815 
   1816     gas_start "movbs.s" "-al"
   1817 
   1818     # Check each instruction bit pattern to verify it got
   1819     # assembled correctly.
   1820     while 1 {
   1821 	expect {
   1822 	    -re " +\[0-9\]+ 0000 0C89\[^\n\]*\n"   { set x [expr $x+1] }
   1823 	    -re " +\[0-9\]+ 0002 F810\[^\n\]*\n"   { set x [expr $x+1] }
   1824 	    -re " +\[0-9\]+ 0004 6818\[^\n\]*\n"   { set x [expr $x+1] }
   1825 	    -re " +\[0-9\]+ 0006 6E180010\[^\n\]*\n"   { set x [expr $x+1] }
   1826 	    -re " +\[0-9\]+ 000a 78106A28\[^\n\]*\n +\[0-9\]+ +00000020\[^\n\]*\n"   { set x [expr $x+1] }
   1827 	    -re " +\[0-9\]+ 0012 6C18\[^\n\]*\n"   { set x [expr $x+1] }
   1828 	    -re " +\[0-9\]+ 0014 2810\[^\n\]*\n"   { set x [expr $x+1] }
   1829 	    -re " +\[0-9\]+ 0016 6A080000\[^\n\]*\n"   { set x [expr $x+1] }
   1830 	    -re " +\[0-9\]+ 001a 6A280000\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n"   { set x [expr $x+1] }
   1831 	    -re " +\[0-9\]+ 0020 6898\[^\n\]*\n"   { set x [expr $x+1] }
   1832 	    -re " +\[0-9\]+ 0022 6E980010\[^\n\]*\n"   { set x [expr $x+1] }
   1833 	    -re " +\[0-9\]+ 0026 78106AA8\[^\n\]*\n +\[0-9\]+ +00000020\[^\n\]*\n"   { set x [expr $x+1] }
   1834 	    -re " +\[0-9\]+ 002e 6C98\[^\n\]*\n"   { set x [expr $x+1] }
   1835 	    -re " +\[0-9\]+ 0030 3810\[^\n\]*\n"   { set x [expr $x+1] }
   1836 	    -re " +\[0-9\]+ 0032 6A880000\[^\n\]*\n"   { set x [expr $x+1] }
   1837 	    -re " +\[0-9\]+ 0036 6AA80000\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n"   { set x [expr $x+1] }
   1838 	    eof					{ break }
   1839 	}
   1840     }
   1841 
   1842     # This was intended to do any cleanup necessary.  It kinda looks like it
   1843     # isn't needed, but just in case, please keep it in for now.
   1844     gas_finish
   1845 
   1846     # Did we find what we were looking for?  If not, flunk it.
   1847     if [expr $x == 16] then { pass $testname } else { fail $testname }
   1848 }
   1849 
   1850 proc do_h8300s_movw {} {
   1851     set testname "movws.s: h8300s movw tests"
   1852     set x 0
   1853 
   1854     gas_start "movws.s" "-al"
   1855 
   1856     # Check each instruction bit pattern to verify it got
   1857     # assembled correctly.
   1858     while 1 {
   1859 	expect {
   1860 	    -re " +\[0-9\]+ 0000 0D01\[^\n\]*\n"   { set x [expr $x+1] }
   1861 	    -re " +\[0-9\]+ 0002 79000010\[^\n\]*\n"   { set x [expr $x+1] }
   1862 	    -re " +\[0-9\]+ 0006 6910\[^\n\]*\n"   { set x [expr $x+1] }
   1863 	    -re " +\[0-9\]+ 0008 6F100010\[^\n\]*\n"   { set x [expr $x+1] }
   1864 	    -re " +\[0-9\]+ 000c 78106B20\[^\n\]*\n +\[0-9\]+ +00000020\[^\n\]*\n"   { set x [expr $x+1] }
   1865 	    -re " +\[0-9\]+ 0014 6D10\[^\n\]*\n"   { set x [expr $x+1] }
   1866 	    -re " +\[0-9\]+ 0016 6B000000\[^\n\]*\n"   { set x [expr $x+1] }
   1867 	    -re " +\[0-9\]+ 001a 6B200000\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n"   { set x [expr $x+1] }
   1868 	    -re " +\[0-9\]+ 0020 6990\[^\n\]*\n"   { set x [expr $x+1] }
   1869 	    -re " +\[0-9\]+ 0022 6F900010\[^\n\]*\n"   { set x [expr $x+1] }
   1870 	    -re " +\[0-9\]+ 0026 78106BA0\[^\n\]*\n +\[0-9\]+ +00000020\[^\n\]*\n"   { set x [expr $x+1] }
   1871 	    -re " +\[0-9\]+ 002e 6D90\[^\n\]*\n"   { set x [expr $x+1] }
   1872 	    -re " +\[0-9\]+ 0030 6B800000\[^\n\]*\n"   { set x [expr $x+1] }
   1873 	    -re " +\[0-9\]+ 0034 6BA00000\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n"   { set x [expr $x+1] }
   1874 	    eof					{ break }
   1875 	}
   1876     }
   1877 
   1878     # This was intended to do any cleanup necessary.  It kinda looks like it
   1879     # isn't needed, but just in case, please keep it in for now.
   1880     gas_finish
   1881 
   1882     # Did we find what we were looking for?  If not, flunk it.
   1883     if [expr $x == 14] then { pass $testname } else { fail $testname }
   1884 }
   1885 
   1886 
   1887 proc do_h8300s_movl {} {
   1888     set testname "movls.s: h8300s movl tests"
   1889     set x 0
   1890 
   1891     gas_start "movls.s" "-al"
   1892 
   1893     # Check each instruction bit pattern to verify it got
   1894     # assembled correctly.
   1895     while 1 {
   1896 	expect {
   1897 	    -re " +\[0-9\]+ 0000 0F81\[^\n\]*\n"   { set x [expr $x+1] }
   1898 	    -re " +\[0-9\]+ 0002 7A000000\[^\n\]*\n +\[0-9\]+ +0040\[^\n\]*\n"   { set x [expr $x+1] }
   1899 	    -re " +\[0-9\]+ 0008 01006910\[^\n\]*\n"   { set x [expr $x+1] }
   1900 	    -re " +\[0-9\]+ 000c 01006F10\[^\n\]*\n +\[0-9\]+ +0010\[^\n\]*\n"   { set x [expr $x+1] }
   1901 	    -re " +\[0-9\]+ 0012 01007810\[^\n\]*\n +\[0-9\]+ +6B200000\[^\n\]*\n +\[0-9\]+ +0020\[^\n\]*\n"   { set x [expr $x+1] }
   1902 	    -re " +\[0-9\]+ 001c 01006D10\[^\n\]*\n"   { set x [expr $x+1] }
   1903 	    -re " +\[0-9\]+ 0020 01006B00\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n"   { set x [expr $x+1] }
   1904 	    -re " +\[0-9\]+ 0026 01006B20\[^\n\]*\n +\[0-9\]+ +00000000\[^\n\]*\n"   { set x [expr $x+1] }
   1905 	    -re " +\[0-9\]+ 002e 01006990\[^\n\]*\n"   { set x [expr $x+1] }
   1906 	    -re " +\[0-9\]+ 0032 01006F90\[^\n\]*\n +\[0-9\]+ +0010\[^\n\]*\n"   { set x [expr $x+1] }
   1907 	    -re " +\[0-9\]+ 0038 01007890\[^\n\]*\n +\[0-9\]+ +6BA00000\[^\n\]*\n +\[0-9\]+ +0020\[^\n\]*\n"   { set x [expr $x+1] }
   1908 	    -re " +\[0-9\]+ 0042 01006D90\[^\n\]*\n"   { set x [expr $x+1] }
   1909 	    -re " +\[0-9\]+ 0046 01006B80\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n"   { set x [expr $x+1] }
   1910 	    -re " +\[0-9\]+ 004c 01006BA0\[^\n\]*\n +\[0-9\]+ +00000000\[^\n\]*\n"   { set x [expr $x+1] }
   1911 	    eof					{ break }
   1912 	}
   1913     }
   1914 
   1915     # This was intended to do any cleanup necessary.  It kinda looks like it
   1916     # isn't needed, but just in case, please keep it in for now.
   1917     gas_finish
   1918 
   1919     # Did we find what we were looking for?  If not, flunk it.
   1920     if [expr $x == 14] then { pass $testname } else { fail $testname }
   1921 }
   1922 
   1923 proc do_h8300s_pushpop {} {
   1924     set testname "pushpops.s: h8300s pushpop tests"
   1925     set x 0
   1926 
   1927     gas_start "pushpops.s" "-al"
   1928 
   1929     # Check each instruction bit pattern to verify it got
   1930     # assembled correctly.
   1931     while 1 {
   1932 	expect {
   1933 	    -re " +\[0-9\]+ 0000 6D70\[^\n\]*\n"   { set x [expr $x+1] }
   1934 	    -re " +\[0-9\]+ 0002 01006D70\[^\n\]*\n"   { set x [expr $x+1] }
   1935 	    -re " +\[0-9\]+ 0006 6DF0\[^\n\]*\n"   { set x [expr $x+1] }
   1936 	    -re " +\[0-9\]+ 0008 01006DF0\[^\n\]*\n"   { set x [expr $x+1] }
   1937 	    eof					{ break }
   1938 	}
   1939     }
   1940 
   1941     # This was intended to do any cleanup necessary.  It kinda looks like it
   1942     # isn't needed, but just in case, please keep it in for now.
   1943     gas_finish
   1944 
   1945     # Did we find what we were looking for?  If not, flunk it.
   1946     if [expr $x == 4] then { pass $testname } else { fail $testname }
   1947 }
   1948 
   1949 proc do_h8300s_rotate_shift {} {
   1950     set testname "rotshs.s: h8300s rotate and shift tests"
   1951     set x 0
   1952 
   1953     gas_start "rotshs.s" "-al"
   1954 
   1955     # Check each instruction bit pattern to verify it got
   1956     # assembled correctly.
   1957     while 1 {
   1958 	expect {
   1959 	    -re " +\[0-9\]+ 0000 1288\[^\n\]*\n"   { set x [expr $x+1] }
   1960 	    -re " +\[0-9\]+ 0002 12C8\[^\n\]*\n"   { set x [expr $x+1] }
   1961 	    -re " +\[0-9\]+ 0004 1290\[^\n\]*\n"   { set x [expr $x+1] }
   1962 	    -re " +\[0-9\]+ 0006 12D0\[^\n\]*\n"   { set x [expr $x+1] }
   1963 	    -re " +\[0-9\]+ 0008 12B0\[^\n\]*\n"   { set x [expr $x+1] }
   1964 	    -re " +\[0-9\]+ 000a 12F0\[^\n\]*\n"   { set x [expr $x+1] }
   1965 	    -re " +\[0-9\]+ 000c 1388\[^\n\]*\n"   { set x [expr $x+1] }
   1966 	    -re " +\[0-9\]+ 000e 13C8\[^\n\]*\n"   { set x [expr $x+1] }
   1967 	    -re " +\[0-9\]+ 0010 1390\[^\n\]*\n"   { set x [expr $x+1] }
   1968 	    -re " +\[0-9\]+ 0012 13D0\[^\n\]*\n"   { set x [expr $x+1] }
   1969 	    -re " +\[0-9\]+ 0014 13B0\[^\n\]*\n"   { set x [expr $x+1] }
   1970 	    -re " +\[0-9\]+ 0016 13F0\[^\n\]*\n"   { set x [expr $x+1] }
   1971 	    -re " +\[0-9\]+ 0018 1208\[^\n\]*\n"   { set x [expr $x+1] }
   1972 	    -re " +\[0-9\]+ 001a 1248\[^\n\]*\n"   { set x [expr $x+1] }
   1973 	    -re " +\[0-9\]+ 001c 1210\[^\n\]*\n"   { set x [expr $x+1] }
   1974 	    -re " +\[0-9\]+ 001e 1250\[^\n\]*\n"   { set x [expr $x+1] }
   1975 	    -re " +\[0-9\]+ 0020 1230\[^\n\]*\n"   { set x [expr $x+1] }
   1976 	    -re " +\[0-9\]+ 0022 1270\[^\n\]*\n"   { set x [expr $x+1] }
   1977 	    -re " +\[0-9\]+ 0024 1308\[^\n\]*\n"   { set x [expr $x+1] }
   1978 	    -re " +\[0-9\]+ 0026 1348\[^\n\]*\n"   { set x [expr $x+1] }
   1979 	    -re " +\[0-9\]+ 0028 1310\[^\n\]*\n"   { set x [expr $x+1] }
   1980 	    -re " +\[0-9\]+ 002a 1350\[^\n\]*\n"   { set x [expr $x+1] }
   1981 	    -re " +\[0-9\]+ 002c 1330\[^\n\]*\n"   { set x [expr $x+1] }
   1982 	    -re " +\[0-9\]+ 002e 1370\[^\n\]*\n"   { set x [expr $x+1] }
   1983 	    -re " +\[0-9\]+ 0030 1088\[^\n\]*\n"   { set x [expr $x+1] }
   1984 	    -re " +\[0-9\]+ 0032 10C8\[^\n\]*\n"   { set x [expr $x+1] }
   1985 	    -re " +\[0-9\]+ 0034 1090\[^\n\]*\n"   { set x [expr $x+1] }
   1986 	    -re " +\[0-9\]+ 0036 10D0\[^\n\]*\n"   { set x [expr $x+1] }
   1987 	    -re " +\[0-9\]+ 0038 10B0\[^\n\]*\n"   { set x [expr $x+1] }
   1988 	    -re " +\[0-9\]+ 003a 10F0\[^\n\]*\n"   { set x [expr $x+1] }
   1989 	    -re " +\[0-9\]+ 003c 1188\[^\n\]*\n"   { set x [expr $x+1] }
   1990 	    -re " +\[0-9\]+ 003e 11C8\[^\n\]*\n"   { set x [expr $x+1] }
   1991 	    -re " +\[0-9\]+ 0040 1190\[^\n\]*\n"   { set x [expr $x+1] }
   1992 	    -re " +\[0-9\]+ 0042 11D0\[^\n\]*\n"   { set x [expr $x+1] }
   1993 	    -re " +\[0-9\]+ 0044 11B0\[^\n\]*\n"   { set x [expr $x+1] }
   1994 	    -re " +\[0-9\]+ 0046 11F0\[^\n\]*\n"   { set x [expr $x+1] }
   1995 	    -re " +\[0-9\]+ 0048 1008\[^\n\]*\n"   { set x [expr $x+1] }
   1996 	    -re " +\[0-9\]+ 004a 1048\[^\n\]*\n"   { set x [expr $x+1] }
   1997 	    -re " +\[0-9\]+ 004c 1010\[^\n\]*\n"   { set x [expr $x+1] }
   1998 	    -re " +\[0-9\]+ 004e 1050\[^\n\]*\n"   { set x [expr $x+1] }
   1999 	    -re " +\[0-9\]+ 0050 1030\[^\n\]*\n"   { set x [expr $x+1] }
   2000 	    -re " +\[0-9\]+ 0052 1070\[^\n\]*\n"   { set x [expr $x+1] }
   2001 	    -re " +\[0-9\]+ 0054 1108\[^\n\]*\n"   { set x [expr $x+1] }
   2002 	    -re " +\[0-9\]+ 0056 1148\[^\n\]*\n"   { set x [expr $x+1] }
   2003 	    -re " +\[0-9\]+ 0058 1110\[^\n\]*\n"   { set x [expr $x+1] }
   2004 	    -re " +\[0-9\]+ 005a 1150\[^\n\]*\n"   { set x [expr $x+1] }
   2005 	    -re " +\[0-9\]+ 005c 1130\[^\n\]*\n"   { set x [expr $x+1] }
   2006 	    -re " +\[0-9\]+ 005e 1170\[^\n\]*\n"   { set x [expr $x+1] }
   2007 	    eof					{ break }
   2008 	}
   2009     }
   2010 
   2011     # This was intended to do any cleanup necessary.  It kinda looks like it
   2012     # isn't needed, but just in case, please keep it in for now.
   2013     gas_finish
   2014 
   2015     # Did we find what we were looking for?  If not, flunk it.
   2016     if [expr $x == 48] then { pass $testname } else { fail $testname }
   2017 }
   2018 
   2019 proc do_h8300s_extend {} {
   2020     set testname "extends.s: h8300s extend tests"
   2021     set x 0
   2022 
   2023     gas_start "extends.s" "-al"
   2024 
   2025     # Check each instruction bit pattern to verify it got
   2026     # assembled correctly.
   2027     while 1 {
   2028 	expect {
   2029 	    -re " +\[0-9\]+ 0000 17D0\[^\n\]*\n"   { set x [expr $x+1] }
   2030 	    -re " +\[0-9\]+ 0002 17F0\[^\n\]*\n"   { set x [expr $x+1] }
   2031 	    -re " +\[0-9\]+ 0004 1750\[^\n\]*\n"   { set x [expr $x+1] }
   2032 	    -re " +\[0-9\]+ 0006 1770\[^\n\]*\n"   { set x [expr $x+1] }
   2033 	    eof					{ break }
   2034 	}
   2035     }
   2036 
   2037     # This was intended to do any cleanup necessary.  It kinda looks like it
   2038     # isn't needed, but just in case, please keep it in for now.
   2039     gas_finish
   2040 
   2041     # Did we find what we were looking for?  If not, flunk it.
   2042     if [expr $x == 4] then { pass $testname } else { fail $testname }
   2043 }
   2044 
   2045 proc do_h8300s_mac {} {
   2046     set testname "macs.s: h8300s mac tests"
   2047     set x 0
   2048 
   2049     gas_start "macs.s" "-al"
   2050 
   2051     # Check each instruction bit pattern to verify it got
   2052     # assembled correctly.
   2053     while 1 {
   2054 	expect {
   2055  	    -re " +\[0-9\]+ 0000 01A0\[^\n\]*\n"   { set x [expr $x+1] }
   2056 	    -re " +\[0-9\]+ 0002 0324\[^\n\]*\n"   { set x [expr $x+1] }
   2057 	    -re " +\[0-9\]+ 0004 0335\[^\n\]*\n"   { set x [expr $x+1] }
   2058 	    -re " +\[0-9\]+ 0006 01606D45\[^\n\]*\n"   { set x [expr $x+1] }
   2059 	    -re " +\[0-9\]+ 000a 0224\[^\n\]*\n"   { set x [expr $x+1] }
   2060 	    -re " +\[0-9\]+ 000c 0235\[^\n\]*\n"   { set x [expr $x+1] }
   2061 	    eof					{ break }
   2062 	}
   2063     }
   2064 
   2065     # This was intended to do any cleanup necessary.  It kinda looks like it
   2066     # isn't needed, but just in case, please keep it in for now.
   2067     gas_finish
   2068 
   2069     # Did we find what we were looking for?  If not, flunk it.
   2070     if [expr $x == 6] then { pass $testname } else { fail $testname }
   2071 }
   2072 
   2073 proc do_h8300s_multiple {} {
   2074     set testname "multiples.s: h8300s multiple tests"
   2075     set x 0
   2076 
   2077     gas_start "multiples.s" "-al"
   2078 
   2079     # Check each instruction bit pattern to verify it got
   2080     # assembled correctly.
   2081     while 1 {
   2082 	expect {
   2083 	    -re " +\[0-9\]+ 0000 01106D71\[^\n\]*\n"   { set x [expr $x+1] }
   2084 	    -re " +\[0-9\]+ 0004 01206D72\[^\n\]*\n"   { set x [expr $x+1] }
   2085 	    -re " +\[0-9\]+ 0008 01306D73\[^\n\]*\n"   { set x [expr $x+1] }
   2086 	    -re " +\[0-9\]+ 000c 01106DF0\[^\n\]*\n"   { set x [expr $x+1] }
   2087 	    -re " +\[0-9\]+ 0010 01206DF0\[^\n\]*\n"   { set x [expr $x+1] }
   2088 	    -re " +\[0-9\]+ 0014 01306DF0\[^\n\]*\n"   { set x [expr $x+1] }
   2089             -re " +\[0-9\]+ 0018 01106D73\[^\n\]*\n"   { set x [expr $x+1] }
   2090             -re " +\[0-9\]+ 001c 01106DF2\[^\n\]*\n"   { set x [expr $x+1] }
   2091             -re " +\[0-9\]+ 0020 01106D75\[^\n\]*\n"   { set x [expr $x+1] }
   2092             -re " +\[0-9\]+ 0024 01206D76\[^\n\]*\n"   { set x [expr $x+1] }
   2093             -re " +\[0-9\]+ 0028 01106DF4\[^\n\]*\n"   { set x [expr $x+1] }
   2094             -re " +\[0-9\]+ 002c 01206DF4\[^\n\]*\n"   { set x [expr $x+1] }
   2095 
   2096 	    eof					{ break }
   2097 	}
   2098     }
   2099 
   2100     # This was intended to do any cleanup necessary.  It kinda looks like it
   2101     # isn't needed, but just in case, please keep it in for now.
   2102     gas_finish
   2103 
   2104     # Did we find what we were looking for?  If not, flunk it.
   2105     if [expr $x == 12] then { pass $testname } else { fail $testname }
   2106 }
   2107 
   2108 proc do_h8300h_mov32bug {} {
   2109     set testname "mov32bug.s: h8300h mov32bug test"
   2110     set x 0
   2111 
   2112     if [gas_test_old "mov32bug.s" "" "Proper relocation for mov.l (part 1)"] then {
   2113         objdump_start_no_subdir "a.out" "-r"
   2114 
   2115 	while 1 {
   2116 	    expect {
   2117 		-re "00000002\[^\n\]*32\[^\n\]*_a-0x77359400\[^\n\]*\n"
   2118 						{ set x [expr $x+1] }
   2119 		timeout 			{ perror "timeout\n; break }
   2120 		eof				{ break }
   2121 	    }
   2122 	}
   2123     }
   2124 
   2125     # This was intended to do any cleanup necessary.  It kinda looks like it
   2126     # isn't needed, but just in case, please keep it in for now.
   2127     objdump_finish
   2128 
   2129     # Did we find what we were looking for?  If not, flunk it.
   2130     if [expr $x == 1] then { pass $testname } else { fail $testname }
   2131 }
   2132 
   2133 proc do_h8300hn_addressgen {} {
   2134     set testname "symaddgen.s: h8300hn symbol address generation"
   2135     set x 0
   2136 
   2137     gas_start "symaddgen.s" "-al"
   2138 
   2139     # Check each instruction bit pattern to verify it got
   2140     # assembled correctly.
   2141     while 1 {
   2142 	expect {
   2143 	    -re " +\[0-9\]+ .* 01006DF6\[^\n\]*\n"   { set x [expr $x+1] }
   2144 	    -re " +\[0-9\]+ .* 0D76\[^\n\]*\n"       { set x [expr $x+1] }
   2145 	    -re " +\[0-9\]+ .* 790207D0\[^\n\]*\n"   { set x [expr $x+1] }
   2146 	    -re " +\[0-9\]+ .* 6B82F020\[^\n\]*\n"   { set x [expr $x+1] }
   2147 	    -re " +\[0-9\]+ .* 79022710\[^\n\]*\n"   { set x [expr $x+1] }
   2148 	    -re " +\[0-9\]+ .* 6B820000\[^\n\]*\n"   { set x [expr $x+1] }
   2149 	    -re " +\[0-9\]+ .* 01006D76\[^\n\]*\n"   { set x [expr $x+1] }
   2150 	    -re " +\[0-9\]+ .* 5470\[^\n\]*\n"       { set x [expr $x+1] }
   2151 
   2152 	    eof					{ break }
   2153 	}
   2154     }
   2155     # This was intended to do any cleanup necessary.  It kinda looks like it
   2156     # isn't needed, but just in case, please keep it in for now.
   2157     gas_finish
   2158     # Did we find what we were looking for?  If not, flunk it.
   2159     if [expr $x == 8] then { pass $testname } else { fail $testname }
   2160 }
   2161 
   2162 proc do_h8300_addsubrxcheck {} {
   2163     set testname "addsubrxcheck.s: h8300 check rx generation for adds subs instructions"
   2164     set x 0
   2165 
   2166     gas_start "addsubrxcheck.s" "-al"
   2167 
   2168     # Check each instruction bit pattern to verify it got
   2169     # assembled correctly.
   2170     while 1 {
   2171 	expect {
   2172 	    -re " +\[0-9\]+ .* 6DF6\[^\n\]*\n"       { set x [expr $x+1] }
   2173 	    -re " +\[0-9\]+ .* 0D76\[^\n\]*\n"       { set x [expr $x+1] }
   2174 	    -re " +\[0-9\]+ .* 1B87\[^\n\]*\n"       { set x [expr $x+1] }
   2175 	    -re " +\[0-9\]+ .* 6F62FFFE\[^\n\]*\n"   { set x [expr $x+1] }
   2176 	    -re " +\[0-9\]+ .* 1B82\[^\n\]*\n"       { set x [expr $x+1] }
   2177 	    -re " +\[0-9\]+ .* 6FE2FFFE\[^\n\]*\n"   { set x [expr $x+1] }
   2178 	    -re " +\[0-9\]+ .* 1922\[^\n\]*\n"       { set x [expr $x+1] }
   2179 	    -re " +\[0-9\]+ .* 0D20\[^\n\]*\n"       { set x [expr $x+1] }
   2180 	    -re " +\[0-9\]+ .* 0B87\[^\n\]*\n"       { set x [expr $x+1] }
   2181 	    -re " +\[0-9\]+ .* 6D76\[^\n\]*\n"       { set x [expr $x+1] }
   2182 	    -re " +\[0-9\]+ .* 5470\[^\n\]*\n"       { set x [expr $x+1] }
   2183 
   2184 	    eof					{ break }
   2185 	}
   2186     }
   2187     # This was intended to do any cleanup necessary.  It kinda looks like it
   2188     # isn't needed, but just in case, please keep it in for now.
   2189     gas_finish
   2190     # Did we find what we were looking for?  If not, flunk it.
   2191     if [expr $x == 11] then { pass $testname } else { fail $testname }
   2192 }
   2193 
   2194 if [istarget h8300*-*-*] then {
   2195     # Test the basic h8300 instruction parser
   2196     do_h8300_add_sub
   2197     do_h8300_logical
   2198     do_h8300_bitops1
   2199     do_h8300_bitops2
   2200     do_h8300_bitops3
   2201     do_h8300_bitops4
   2202     do_h8300_compare
   2203     do_h8300_decimal
   2204     do_h8300_incdec
   2205     do_h8300_divmul
   2206     do_h8300_misc
   2207     do_h8300_movb
   2208     do_h8300_movw
   2209     do_h8300_pushpop
   2210     do_h8300_rotate_shift
   2211     do_h8300hn_addressgen
   2212 
   2213     do_h8300_addsubrxcheck
   2214 
   2215     # Now test the h8300h instruction parser
   2216     do_h8300h_add_sub
   2217     do_h8300h_logical
   2218     do_h8300h_bitops1
   2219     do_h8300h_bitops2
   2220     do_h8300h_bitops3
   2221     do_h8300h_bitops4
   2222     do_h8300h_compare
   2223     do_h8300h_decimal
   2224     do_h8300h_incdec
   2225     do_h8300h_divmul
   2226     do_h8300h_misc
   2227     do_h8300h_movb
   2228     do_h8300h_movw
   2229     do_h8300h_movl
   2230     do_h8300_pushpop
   2231     do_h8300h_rotate_shift
   2232     do_h8300h_extend
   2233 
   2234     # Now test the h8300s instruction parser
   2235     do_h8300s_add_sub
   2236     do_h8300s_logical
   2237     do_h8300s_bitops1
   2238     do_h8300s_bitops2
   2239     do_h8300s_bitops3
   2240     do_h8300s_bitops4
   2241     do_h8300s_compare
   2242     do_h8300s_decimal
   2243     do_h8300s_incdec
   2244     do_h8300s_divmul
   2245     do_h8300s_misc
   2246     do_h8300s_movb
   2247     do_h8300s_movw
   2248     do_h8300s_movl
   2249     do_h8300_pushpop
   2250     do_h8300s_rotate_shift
   2251     do_h8300s_extend
   2252     do_h8300s_mac
   2253     do_h8300s_multiple
   2254 
   2255     do_h8300h_mov32bug
   2256 
   2257     # Now some random tests
   2258     set svr4pic [expr [istarget *-*-elf*] || [istarget *-*-irix5*] ]
   2259     set empic [expr [istarget *-*-ecoff*] || [istarget *-*-ultrix*] || [istarget *-*-irix\[1-4\]*] ]
   2260     set aout [expr [istarget *-*-bsd*] || [istarget *-*-netbsd*]]
   2261 
   2262     gas_test "cmpsi2.s" "" "" "cmpsi2.s"
   2263 
   2264     run_dump_test "pr3134"
   2265 }
   2266