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