OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [binutils-2.20.1/] [gas/] [testsuite/] [gas/] [xc16x/] [xc16x.exp] - Blame information for rev 205

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 205 julius
#
2
# Some xc16x tests
3
#
4
proc do_xc16x_add {} {
5
    set testname "add.s: xc16x add word tests"
6
    set x 0
7
 
8
    gas_start "add.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 0001\[^\n\]*\n"  { set x [expr $x+1] }
15
            -re " +\[0-9\]+ 0002 0809\[^\n\]*\n"  { set x [expr $x+1] }
16
            -re " +\[0-9\]+ 0004 080D\[^\n\]*\n"  { set x [expr $x+1] }
17
            -re " +\[0-9\]+ 0006 0803\[^\n\]*\n"  { set x [expr $x+1] }
18
            -re " +\[0-9\]+ 0008 06F0D204\[^\n\]*\n"  { set x [expr $x+1] }
19
            -re " +\[0-9\]+ 000c 02F0EDFF\[^\n\]*\n"  { set x [expr $x+1] }
20
            -re " +\[0-9\]+ 0010 04F0EDFF\[^\n\]*\n"  { set x [expr $x+1] }
21
            timeout                             { perror "timeout\n; break }
22
            eof                             { break }
23
        }
24
    }
25
 
26
    # This was intended to do any cleanup necessary.  It kinda looks like it
27
    # isn't needed, but just in case, please keep it in for now.
28
    gas_finish
29
 
30
    # Did we find what we were looking for?  If not, flunk it.
31
    if [expr $x == 7] then { pass $testname } else { fail $testname }
32
}
33
 
34
proc do_xc16x_addb {} {
35
    set testname "addb.s: xc16x add byte tests"
36
    set x 0
37
 
38
    gas_start "addb.s" "-al"
39
 
40
    # Check each instruction bit pattern to verify it got
41
    # assembled correctly.
42
    while 1 {
43
        expect {
44
            -re " +\[0-9\]+ 0000 0102\[^\n\]*\n"   { set x [expr $x+1] }
45
            -re " +\[0-9\]+ 0002 0909\[^\n\]*\n"   { set x [expr $x+1] }
46
            -re " +\[0-9\]+ 0004 090D\[^\n\]*\n"   { set x [expr $x+1] }
47
            -re " +\[0-9\]+ 0006 0902\[^\n\]*\n"   { set x [expr $x+1] }
48
            -re " +\[0-9\]+ 0008 07F03300\[^\n\]*\n"   { set x [expr $x+1] }
49
            -re " +\[0-9\]+ 000c 03F08723\[^\n\]*\n"   { set x [expr $x+1] }
50
            -re " +\[0-9\]+ 0010 05F08723\[^\n\]*\n"   { set x [expr $x+1] }
51
            timeout                             { perror "timeout\n; break }
52
            eof                                 { break }
53
        }
54
    }
55
 
56
    # This was intended to do any cleanup necessary.  It kinda looks like it
57
    # isn't needed, but just in case, please keep it in for now.
58
    gas_finish
59
 
60
    # Did we find what we were looking for?  If not, flunk it.
61
    if [expr $x == 7] then { pass $testname } else { fail $testname }
62
}
63
 
64
proc do_xc16x_addc {} {
65
    set testname "addc.s: xc16x add with carry tests"
66
    set x 0
67
 
68
    gas_start "addc.s" "-al"
69
 
70
    # Check each instruction bit pattern to verify it got
71
    # assembled correctly.
72
    while 1 {
73
        expect {
74
            -re " +\[0-9\]+ 0000 1001\[^\n\]*\n"   { set x [expr $x+1] }
75
            -re " +\[0-9\]+ 0002 1809\[^\n\]*\n"   { set x [expr $x+1] }
76
            -re " +\[0-9\]+ 0004 180D\[^\n\]*\n"   { set x [expr $x+1] }
77
            -re " +\[0-9\]+ 0006 16F03400\[^\n\]*\n"   { set x [expr $x+1] }
78
            -re " +\[0-9\]+ 000a 16F05634\[^\n\]*\n"   { set x [expr $x+1] }
79
            -re " +\[0-9\]+ 000e 12F08723\[^\n\]*\n"   { set x [expr $x+1] }
80
            -re " +\[0-9\]+ 0012 14F08723\[^\n\]*\n"   { set x [expr $x+1] }
81
            timeout                             { perror "timeout\n; break }
82
            eof                                 { break }
83
        }
84
    }
85
 
86
    # This was intended to do any cleanup necessary.  It kinda looks like it
87
    # isn't needed, but just in case, please keep it in for now.
88
    gas_finish
89
 
90
    # Did we find what we were looking for?  If not, flunk it.
91
    if [expr $x == 7] then { pass $testname } else { fail $testname }
92
}
93
 
94
proc do_xc16x_addcb {} {
95
    set testname "addcb.s: xc16x add byte with carry tests"
96
    set x 0
97
 
98
    gas_start "addcb.s" "-al"
99
 
100
    # Check each instruction bit pattern to verify it got
101
    # assembled correctly.
102
    while 1 {
103
        expect {
104
            -re " +\[0-9\]+ 0000 1102\[^\n\]*\n"   { set x [expr $x+1] }
105
            -re " +\[0-9\]+ 0002 1909\[^\n\]*\n"   { set x [expr $x+1] }
106
            -re " +\[0-9\]+ 0004 190D\[^\n\]*\n"   { set x [expr $x+1] }
107
            -re " +\[0-9\]+ 0006 17F00200\[^\n\]*\n"   { set x [expr $x+1] }
108
            -re " +\[0-9\]+ 000a 17F02300\[^\n\]*\n"   { set x [expr $x+1] }
109
            -re " +\[0-9\]+ 000e 15F08723\[^\n\]*\n"   { set x [expr $x+1] }
110
            timeout                             { perror "timeout\n; break }
111
            eof                                 { break }
112
        }
113
    }
114
 
115
    # This was intended to do any cleanup necessary.  It kinda looks like it
116
    # isn't needed, but just in case, please keep it in for now.
117
    gas_finish
118
 
119
    # Did we find what we were looking for?  If not, flunk it.
120
    if [expr $x == 6] then { pass $testname } else { fail $testname }
121
}
122
 
123
proc do_xc16x_sub {} {
124
    set testname "sub.s: xc16x sub tests"
125
    set x 0
126
 
127
    gas_start "sub.s" "-al"
128
 
129
    # Check each instruction bit pattern to verify it got
130
    # assembled correctly.
131
    while 1 {
132
        expect {
133
            -re " +\[0-9\]+ 0000 2001\[^\n\]*\n"   { set x [expr $x+1] }
134
            -re " +\[0-9\]+ 0002 2809\[^\n\]*\n"   { set x [expr $x+1] }
135
            -re " +\[0-9\]+ 0004 280D\[^\n\]*\n"   { set x [expr $x+1] }
136
            -re " +\[0-9\]+ 0006 2801\[^\n\]*\n"   { set x [expr $x+1] }
137
            -re " +\[0-9\]+ 0008 26F04376\[^\n\]*\n"   { set x [expr $x+1] }
138
            -re " +\[0-9\]+ 000c 22F04376\[^\n\]*\n"   { set x [expr $x+1] }
139
            -re " +\[0-9\]+ 0010 24F04376\[^\n\]*\n"   { set x [expr $x+1] }
140
            timeout                             { perror "timeout\n; break }
141
            eof                                 { break }
142
        }
143
    }
144
 
145
    # This was intended to do any cleanup necessary.  It kinda looks like it
146
    # isn't needed, but just in case, please keep it in for now.
147
    gas_finish
148
 
149
    # Did we find what we were looking for?  If not, flunk it.
150
    if [expr $x == 7] then { pass $testname } else { fail $testname }
151
}
152
 
153
proc do_xc16x_subb {} {
154
    set testname "subb.s: xc16x sub byte tests"
155
    set x 0
156
 
157
    gas_start "subb.s" "-al"
158
 
159
    # Check each instruction bit pattern to verify it got
160
    # assembled correctly.
161
    while 1 {
162
        expect {
163
            -re " +\[0-9\]+ 0000 2102\[^\n\]*\n"   { set x [expr $x+1] }
164
            -re " +\[0-9\]+ 0002 2909\[^\n\]*\n"   { set x [expr $x+1] }
165
            -re " +\[0-9\]+ 0004 290D\[^\n\]*\n"   { set x [expr $x+1] }
166
            -re " +\[0-9\]+ 0006 2901\[^\n\]*\n"   { set x [expr $x+1] }
167
            -re " +\[0-9\]+ 0008 27F04300\[^\n\]*\n"   { set x [expr $x+1] }
168
            -re " +\[0-9\]+ 000c 23F04376\[^\n\]*\n"   { set x [expr $x+1] }
169
            -re " +\[0-9\]+ 0010 25F04376\[^\n\]*\n"   { set x [expr $x+1] }
170
            timeout                             { perror "timeout\n; break }
171
            eof                                 { break }
172
        }
173
    }
174
 
175
    # This was intended to do any cleanup necessary.  It kinda looks like it
176
    # isn't needed, but just in case, please keep it in for now.
177
    gas_finish
178
 
179
    # Did we find what we were looking for?  If not, flunk it.
180
    if [expr $x == 7] then { pass $testname } else { fail $testname }
181
}
182
 
183
proc do_xc16x_subc {} {
184
    set testname "subc.s: xc16x sub with carry tests"
185
    set x 0
186
 
187
    gas_start "subc.s" "-al"
188
 
189
    # Check each instruction bit pattern to verify it got
190
    # assembled correctly.
191
    while 1 {
192
        expect {
193
            -re " +\[0-9\]+ 0000 3001\[^\n\]*\n"   { set x [expr $x+1] }
194
            -re " +\[0-9\]+ 0002 3809\[^\n\]*\n"   { set x [expr $x+1] }
195
            -re " +\[0-9\]+ 0004 380D\[^\n\]*\n"   { set x [expr $x+1] }
196
            -re " +\[0-9\]+ 0006 3802\[^\n\]*\n"   { set x [expr $x+1] }
197
            -re " +\[0-9\]+ 0008 36F04300\[^\n\]*\n"   { set x [expr $x+1] }
198
            -re " +\[0-9\]+ 000c 32F04376\[^\n\]*\n"   { set x [expr $x+1] }
199
            -re " +\[0-9\]+ 0010 34F04376\[^\n\]*\n"   { set x [expr $x+1] }
200
            timeout                             { perror "timeout\n; break }
201
            eof                                 { break }
202
        }
203
    }
204
 
205
    # This was intended to do any cleanup necessary.  It kinda looks like it
206
    # isn't needed, but just in case, please keep it in for now.
207
    gas_finish
208
 
209
    # Did we find what we were looking for?  If not, flunk it.
210
    if [expr $x == 7] then { pass $testname } else { fail $testname }
211
}
212
 
213
proc do_xc16x_subcb {} {
214
    set testname "subcb.s: xc16x sub byte with carry tests"
215
    set x 0
216
 
217
    gas_start "subcb.s" "-al"
218
 
219
    # Check each instruction bit pattern to verify it got
220
    # assembled correctly.
221
    while 1 {
222
        expect {
223
            -re " +\[0-9\]+ 0000 3102\[^\n\]*\n"   { set x [expr $x+1] }
224
            -re " +\[0-9\]+ 0002 3909\[^\n\]*\n"   { set x [expr $x+1] }
225
            -re " +\[0-9\]+ 0004 390D\[^\n\]*\n"   { set x [expr $x+1] }
226
            -re " +\[0-9\]+ 0006 3902\[^\n\]*\n"   { set x [expr $x+1] }
227
            -re " +\[0-9\]+ 0008 37F04300\[^\n\]*\n"   { set x [expr $x+1] }
228
            -re " +\[0-9\]+ 000c 33F04376\[^\n\]*\n"   { set x [expr $x+1] }
229
            -re " +\[0-9\]+ 0010 35F04376\[^\n\]*\n"   { set x [expr $x+1] }
230
            timeout                             { perror "timeout\n; break }
231
            eof                                 { break }
232
        }
233
    }
234
 
235
    # This was intended to do any cleanup necessary.  It kinda looks like it
236
    # isn't needed, but just in case, please keep it in for now.
237
    gas_finish
238
 
239
    # Did we find what we were looking for?  If not, flunk it.
240
    if [expr $x == 7] then { pass $testname } else { fail $testname }
241
}
242
 
243
proc do_xc16x_and {} {
244
    set testname "and.s: xc16x and tests"
245
    set x 0
246
 
247
    gas_start "and.s" "-al"
248
 
249
    # Check each instruction bit pattern to verify it got
250
    # assembled correctly.
251
    while 1 {
252
        expect {
253
            -re " +\[0-9\]+ 0000 6001\[^\n\]*\n"   { set x [expr $x+1] }
254
            -re " +\[0-9\]+ 0002 6809\[^\n\]*\n"   { set x [expr $x+1] }
255
            -re " +\[0-9\]+ 0004 680D\[^\n\]*\n"   { set x [expr $x+1] }
256
            -re " +\[0-9\]+ 0006 6803\[^\n\]*\n"   { set x [expr $x+1] }
257
            -re " +\[0-9\]+ 0008 66F0BEFC\[^\n\]*\n"   { set x [expr $x+1] }
258
            -re " +\[0-9\]+ 000c 62F03002\[^\n\]*\n"   { set x [expr $x+1] }
259
            -re " +\[0-9\]+ 0010 64F02003\[^\n\]*\n"   { set x [expr $x+1] }
260
            timeout                             { perror "timeout\n; break }
261
            eof                                 { break }
262
        }
263
    }
264
 
265
    # This was intended to do any cleanup necessary.  It kinda looks like it
266
    # isn't needed, but just in case, please keep it in for now.
267
    gas_finish
268
 
269
    # Did we find what we were looking for?  If not, flunk it.
270
    if [expr $x == 7] then { pass $testname } else { fail $testname }
271
}
272
 
273
proc do_xc16x_andb {} {
274
    set testname "andb.s: xc16x and byte tests"
275
    set x 0
276
 
277
    gas_start "andb.s" "-al"
278
 
279
    # Check each instruction bit pattern to verify it got
280
    # assembled correctly.
281
    while 1 {
282
        expect {
283
            -re " +\[0-9\]+ 0000 6102\[^\n\]*\n"   { set x [expr $x+1] }
284
            -re " +\[0-9\]+ 0002 6909\[^\n\]*\n"   { set x [expr $x+1] }
285
            -re " +\[0-9\]+ 0004 690D\[^\n\]*\n"   { set x [expr $x+1] }
286
            -re " +\[0-9\]+ 0006 6903\[^\n\]*\n"   { set x [expr $x+1] }
287
            -re " +\[0-9\]+ 0008 67F0BE00\[^\n\]*\n"   { set x [expr $x+1] }
288
            -re " +\[0-9\]+ 000c 63F03002\[^\n\]*\n"   { set x [expr $x+1] }
289
            -re " +\[0-9\]+ 0010 65F02003\[^\n\]*\n"   { set x [expr $x+1] }
290
            timeout                             { perror "timeout\n; break }
291
            eof                                 { break }
292
        }
293
    }
294
 
295
    # This was intended to do any cleanup necessary.  It kinda looks like it
296
    # isn't needed, but just in case, please keep it in for now.
297
    gas_finish
298
 
299
    # Did we find what we were looking for?  If not, flunk it.
300
    if [expr $x == 7] then { pass $testname } else { fail $testname }
301
}
302
 
303
proc do_xc16x_or {} {
304
    set testname "or.s: xc16x or tests"
305
    set x 0
306
 
307
    gas_start "or.s" "-al"
308
 
309
    # Check each instruction bit pattern to verify it got
310
    # assembled correctly.
311
    while 1 {
312
        expect {
313
            -re " +\[0-9\]+ 0000 7001\[^\n\]*\n"   { set x [expr $x+1] }
314
            -re " +\[0-9\]+ 0002 7809\[^\n\]*\n"   { set x [expr $x+1] }
315
            -re " +\[0-9\]+ 0004 780D\[^\n\]*\n"   { set x [expr $x+1] }
316
            -re " +\[0-9\]+ 0006 7803\[^\n\]*\n"   { set x [expr $x+1] }
317
            -re " +\[0-9\]+ 0008 76F03402\[^\n\]*\n"   { set x [expr $x+1] }
318
            -re " +\[0-9\]+ 000c 72F03645\[^\n\]*\n"   { set x [expr $x+1] }
319
            -re " +\[0-9\]+ 0010 74F03645\[^\n\]*\n"   { set x [expr $x+1] }
320
            timeout                             { perror "timeout\n; break }
321
            eof                                 { break }
322
        }
323
    }
324
 
325
    # This was intended to do any cleanup necessary.  It kinda looks like it
326
    # isn't needed, but just in case, please keep it in for now.
327
    gas_finish
328
 
329
    # Did we find what we were looking for?  If not, flunk it.
330
    if [expr $x == 7] then { pass $testname } else { fail $testname }
331
}
332
 
333
proc do_xc16x_xor {} {
334
    set testname "xor.s: xc16x xor tests"
335
    set x 0
336
 
337
    gas_start "xor.s" "-al"
338
 
339
    # Check each instruction bit pattern to verify it got
340
    # assembled correctly.
341
    while 1 {
342
        expect {
343
            -re " +\[0-9\]+ 0000 5001\[^\n\]*\n"   { set x [expr $x+1] }
344
            -re " +\[0-9\]+ 0002 5809\[^\n\]*\n"   { set x [expr $x+1] }
345
            -re " +\[0-9\]+ 0004 580D\[^\n\]*\n"   { set x [expr $x+1] }
346
            -re " +\[0-9\]+ 0006 5803\[^\n\]*\n"   { set x [expr $x+1] }
347
            -re " +\[0-9\]+ 0008 56F03402\[^\n\]*\n"   { set x [expr $x+1] }
348
            -re " +\[0-9\]+ 000c 52F03402\[^\n\]*\n"   { set x [expr $x+1] }
349
            -re " +\[0-9\]+ 0010 54F03402\[^\n\]*\n"   { set x [expr $x+1] }
350
            timeout                             { perror "timeout\n; break }
351
            eof                                 { break }
352
        }
353
    }
354
 
355
    # This was intended to do any cleanup necessary.  It kinda looks like it
356
    # isn't needed, but just in case, please keep it in for now.
357
    gas_finish
358
 
359
    # Did we find what we were looking for?  If not, flunk it.
360
    if [expr $x == 7] then { pass $testname } else { fail $testname }
361
}
362
 
363
proc do_xc16x_xorb {} {
364
    set testname "xorb.s: xc16x xorb tests"
365
    set x 0
366
 
367
    gas_start "xorb.s" "-al"
368
 
369
    # Check each instruction bit pattern to verify it got
370
    # assembled correctly.
371
    while 1 {
372
        expect {
373
            -re " +\[0-9\]+ 0000 5102\[^\n\]*\n"   { set x [expr $x+1] }
374
            -re " +\[0-9\]+ 0002 5909\[^\n\]*\n"   { set x [expr $x+1] }
375
            -re " +\[0-9\]+ 0004 590D\[^\n\]*\n"   { set x [expr $x+1] }
376
            -re " +\[0-9\]+ 0006 5903\[^\n\]*\n"   { set x [expr $x+1] }
377
            -re " +\[0-9\]+ 0008 57F03400\[^\n\]*\n"   { set x [expr $x+1] }
378
            -re " +\[0-9\]+ 000c 53F00324\[^\n\]*\n"   { set x [expr $x+1] }
379
            -re " +\[0-9\]+ 0010 55F00324\[^\n\]*\n"   { set x [expr $x+1] }
380
            timeout                             { perror "timeout\n; break }
381
            eof                                 { break }
382
        }
383
    }
384
 
385
    # This was intended to do any cleanup necessary.  It kinda looks like it
386
    # isn't needed, but just in case, please keep it in for now.
387
    gas_finish
388
 
389
    # Did we find what we were looking for?  If not, flunk it.
390
    if [expr $x == 7] then { pass $testname } else { fail $testname }
391
 
392
}
393
 
394
proc do_xc16x_mov {} {
395
    set testname "mov.s: xc16x mov tests"
396
    set x 0
397
 
398
    gas_start "mov.s" "-al"
399
 
400
    # Check each instruction bit pattern to verify it got
401
    # assembled correctly.
402
    while 1 {
403
        expect {
404
            -re " +\[0-9\]+ 0000 F001\[^\n\]*\n"   { set x [expr $x+1] }
405
            -re " +\[0-9\]+ 0002 E6F00200\[^\n\]*\n"   { set x [expr $x+1] }
406
            -re " +\[0-9\]+ 0006 E6F0BEFC\[^\n\]*\n"   { set x [expr $x+1] }
407
            -re " +\[0-9\]+ 000a A801\[^\n\]*\n"   { set x [expr $x+1] }
408
            -re " +\[0-9\]+ 000c 9801\[^\n\]*\n"   { set x [expr $x+1] }
409
            -re " +\[0-9\]+ 000e B810\[^\n\]*\n"   { set x [expr $x+1] }
410
            -re " +\[0-9\]+ 0010 8810\[^\n\]*\n"   { set x [expr $x+1] }
411
            -re " +\[0-9\]+ 0012 C801\[^\n\]*\n"   { set x [expr $x+1] }
412
            -re " +\[0-9\]+ 0014 D801\[^\n\]*\n"   { set x [expr $x+1] }
413
            -re " +\[0-9\]+ 0016 E801\[^\n\]*\n"   { set x [expr $x+1] }
414
            -re " +\[0-9\]+ 0018 D400CBFF\[^\n\]*\n"   { set x [expr $x+1] }
415
            -re " +\[0-9\]+ 001c C400CBFF\[^\n\]*\n"   { set x [expr $x+1] }
416
            -re " +\[0-9\]+ 0020 8400CBFF\[^\n\]*\n"   { set x [expr $x+1] }
417
            -re " +\[0-9\]+ 0024 9400CBFF\[^\n\]*\n"   { set x [expr $x+1] }
418
            -re " +\[0-9\]+ 0028 F2F0CBFF\[^\n\]*\n"   { set x [expr $x+1] }
419
            -re " +\[0-9\]+ 002c F6F0CBFF\[^\n\]*\n"   { set x [expr $x+1] }
420
            timeout                             { perror "timeout\n; break }
421
            eof                                 { break }
422
        }
423
    }
424
 
425
    # This was intended to do any cleanup necessary.  It kinda looks like it
426
    # isn't needed, but just in case, please keep it in for now.
427
    gas_finish
428
 
429
    # Did we find what we were looking for?  If not, flunk it.
430
    if [expr $x == 16] then { pass $testname } else { fail $testname }
431
}
432
 
433
proc do_xc16x_movb {} {
434
    set testname "movb.s: xc16x movb tests"
435
    set x 0
436
 
437
    gas_start "movb.s" "-al"
438
 
439
    # Check each instruction bit pattern to verify it got
440
    # assembled correctly.
441
    while 1 {
442
        expect {
443
            -re " +\[0-9\]+ 0000 F3F00000\[^\n\]*\n"   { set x [expr $x+1] }
444
            -re " +\[0-9\]+ 0004 E7F01200\[^\n\]*\n"   { set x [expr $x+1] }
445
            -re " +\[0-9\]+ 0008 B4020000\[^\n\]*\n"   { set x [expr $x+1] }
446
            -re " +\[0-9\]+ 000c 9902\[^\n\]*\n"   { set x [expr $x+1] }
447
            -re " +\[0-9\]+ 000e 8902\[^\n\]*\n"   { set x [expr $x+1] }
448
            -re " +\[0-9\]+ 0010 E932\[^\n\]*\n"   { set x [expr $x+1] }
449
            -re " +\[0-9\]+ 0012 C932\[^\n\]*\n"   { set x [expr $x+1] }
450
            -re " +\[0-9\]+ 0014 D923\[^\n\]*\n"   { set x [expr $x+1] }
451
            -re " +\[0-9\]+ 0016 E923\[^\n\]*\n"   { set x [expr $x+1] }
452
            -re " +\[0-9\]+ 0018 F4033412\[^\n\]*\n"   { set x [expr $x+1] }
453
            -re " +\[0-9\]+ 001c E4033412\[^\n\]*\n"   { set x [expr $x+1] }
454
            -re " +\[0-9\]+ 0020 A4033412\[^\n\]*\n"   { set x [expr $x+1] }
455
            -re " +\[0-9\]+ 0024 A403FFEE\[^\n\]*\n"   { set x [expr $x+1] }
456
            -re " +\[0-9\]+ 0028 B4033412\[^\n\]*\n"   { set x [expr $x+1] }
457
            -re " +\[0-9\]+ 002c F3F01200\[^\n\]*\n"   { set x [expr $x+1] }
458
            -re " +\[0-9\]+ 0030 F7F01200\[^\n\]*\n"   { set x [expr $x+1] }
459
            timeout                             { perror "timeout\n; break }
460
            eof                                 { break }
461
        }
462
    }
463
 
464
    # This was intended to do any cleanup necessary.  It kinda looks like it
465
    # isn't needed, but just in case, please keep it in for now.
466
    gas_finish
467
 
468
    # Did we find what we were looking for?  If not, flunk it.
469
    if [expr $x == 16] then { pass $testname } else { fail $testname }
470
}
471
 
472
proc do_xc16x_movbs {} {
473
    set testname "movbs.s: xc16x mov byte tests"
474
    set x 0
475
 
476
    gas_start "movbs.s" "-al"
477
 
478
    # Check each instruction bit pattern to verify it got
479
    # assembled correctly.
480
    while 1 {
481
        expect {
482
            -re " +\[0-9\]+ 0000 D020\[^\n\]*\n"   { set x [expr $x+1] }
483
            -re " +\[0-9\]+ 0002 D2F0FF00\[^\n\]*\n"   { set x [expr $x+1] }
484
            -re " +\[0-9\]+ 0006 D5F0CBFF\[^\n\]*\n"   { set x [expr $x+1] }
485
            timeout                             { perror "timeout\n; break }
486
            eof                                 { break }
487
        }
488
    }
489
 
490
    # This was intended to do any cleanup necessary.  It kinda looks like it
491
    # isn't needed, but just in case, please keep it in for now.
492
    gas_finish
493
 
494
    # Did we find what we were looking for?  If not, flunk it.
495
    if [expr $x == 3] then { pass $testname } else { fail $testname }
496
}
497
 
498
proc do_xc16x_movbz {} {
499
    set testname "movbz.s: xc16x movbz tests"
500
    set x 0
501
 
502
    gas_start "movbz.s" "-al"
503
 
504
    # Check each instruction bit pattern to verify it got
505
    # assembled correctly.
506
    while 1 {
507
        expect {
508
            -re " +\[0-9\]+ 0000 C002\[^\n\]*\n"   { set x [expr $x+1] }
509
            -re " +\[0-9\]+ 0002 C2F0DD23\[^\n\]*\n"   { set x [expr $x+1] }
510
            -re " +\[0-9\]+ 0006 C5F02300\[^\n\]*\n"   { set x [expr $x+1] }
511
            timeout                             { perror "timeout\n; break }
512
            eof                                 { break }
513
        }
514
    }
515
 
516
    # This was intended to do any cleanup necessary.  It kinda looks like it
517
    # isn't needed, but just in case, please keep it in for now.
518
    gas_finish
519
 
520
    # Did we find what we were looking for?  If not, flunk it.
521
    if [expr $x == 3] then { pass $testname } else { fail $testname }
522
}
523
 
524
proc do_xc16x_pushpop {} {
525
    set testname "pushpop.s: xc16x push/pop tests"
526
    set x 0
527
 
528
    gas_start "pushpop.s" "-al"
529
 
530
    # Check each instruction bit pattern to verify it got
531
    # assembled correctly.
532
    while 1 {
533
        expect {
534
            -re " +\[0-9\]+ 0000 FCF0\[^\n\]*\n"   { set x [expr $x+1] }
535
            -re " +\[0-9\]+ 0002 ECF0\[^\n\]*\n"   { set x [expr $x+1] }
536
            timeout                             { perror "timeout\n; break }
537
            eof                                 { break }
538
        }
539
    }
540
 
541
    # This was intended to do any cleanup necessary.  It kinda looks like it
542
    # isn't needed, but just in case, please keep it in for now.
543
    gas_finish
544
 
545
    # Did we find what we were looking for?  If not, flunk it.
546
    if [expr $x == 2] then { pass $testname } else { fail $testname }
547
}
548
 
549
proc do_xc16x_shlrol {} {
550
    set testname "shlrol.s: xc16x shift and rotate tests"
551
    set x 0
552
 
553
    gas_start "shlrol.s" "-al"
554
 
555
    # Check each instruction bit pattern to verify it got
556
    # assembled correctly.
557
    while 1 {
558
        expect {
559
            -re " +\[0-9\]+ 0000 4C01\[^\n\]*\n"   { set x [expr $x+1] }
560
            -re " +\[0-9\]+ 0002 5C00\[^\n\]*\n"   { set x [expr $x+1] }
561
            -re " +\[0-9\]+ 0004 6C01\[^\n\]*\n"   { set x [expr $x+1] }
562
            -re " +\[0-9\]+ 0006 7C00\[^\n\]*\n"   { set x [expr $x+1] }
563
            -re " +\[0-9\]+ 0008 0C01\[^\n\]*\n"   { set x [expr $x+1] }
564
            -re " +\[0-9\]+ 000a 1C00\[^\n\]*\n"   { set x [expr $x+1] }
565
            -re " +\[0-9\]+ 000c 2C01\[^\n\]*\n"   { set x [expr $x+1] }
566
            -re " +\[0-9\]+ 000e 3C00\[^\n\]*\n"   { set x [expr $x+1] }
567
            -re " +\[0-9\]+ 0010 AC01\[^\n\]*\n"   { set x [expr $x+1] }
568
            -re " +\[0-9\]+ 0012 BC00\[^\n\]*\n"   { set x [expr $x+1] }
569
            timeout                             { perror "timeout\n; break }
570
            eof                                 { break }
571
        }
572
    }
573
 
574
    # This was intended to do any cleanup necessary.  It kinda looks like it
575
    # isn't needed, but just in case, please keep it in for now.
576
    gas_finish
577
 
578
    # Did we find what we were looking for?  If not, flunk it.
579
    if [expr $x == 10] then { pass $testname } else { fail $testname }
580
}
581
 
582
proc do_xc16x_neg {} {
583
    set testname "neg.s: xc16x neg tests"
584
    set x 0
585
 
586
    gas_start "neg.s" "-al"
587
 
588
    # Check each instruction bit pattern to verify it got
589
    # assembled correctly.
590
    while 1 {
591
        expect {
592
            -re " +\[0-9\]+ 0000 8100\[^\n\]*\n"   { set x [expr $x+1] }
593
            -re " +\[0-9\]+ 0002 A100\[^\n\]*\n"   { set x [expr $x+1] }
594
            timeout                             { perror "timeout\n; break }
595
            eof                                 { break }
596
        }
597
    }
598
 
599
    # This was intended to do any cleanup necessary.  It kinda looks like it
600
    # isn't needed, but just in case, please keep it in for now.
601
    gas_finish
602
 
603
    # Did we find what we were looking for?  If not, flunk it.
604
    if [expr $x == 2] then { pass $testname } else { fail $testname }
605
}
606
proc do_xc16x_mul {} {
607
    set testname "mul.s: xc16x multiply tests"
608
    set x 0
609
 
610
    gas_start "mul.s" "-al"
611
 
612
    # Check each instruction bit pattern to verify it got
613
    # assembled correctly.
614
    while 1 {
615
        expect {
616
            -re " +\[0-9\]+ 0000 0B01\[^\n\]*\n"   { set x [expr $x+1] }
617
            -re " +\[0-9\]+ 0002 1B01\[^\n\]*\n"   { set x [expr $x+1] }
618
            timeout                             { perror "timeout\n; break }
619
            eof                                 { break }
620
        }
621
    }
622
 
623
    # This was intended to do any cleanup necessary.  It kinda looks like it
624
    # isn't needed, but just in case, please keep it in for now.
625
    gas_finish
626
 
627
    # Did we find what we were looking for?  If not, flunk it.
628
    if [expr $x == 2] then { pass $testname } else { fail $testname }
629
}
630
 
631
proc do_xc16x_div {} {
632
    set testname "div.s: xc16x division tests"
633
    set x 0
634
 
635
    gas_start "div.s" "-al"
636
 
637
    # Check each instruction bit pattern to verify it got
638
    # assembled correctly.
639
    while 1 {
640
        expect {
641
            -re " +\[0-9\]+ 0000 4B00\[^\n\]*\n"   { set x [expr $x+1] }
642
            -re " +\[0-9\]+ 0002 6B00\[^\n\]*\n"   { set x [expr $x+1] }
643
            -re " +\[0-9\]+ 0004 7B00\[^\n\]*\n"   { set x [expr $x+1] }
644
            -re " +\[0-9\]+ 0006 5B00\[^\n\]*\n"   { set x [expr $x+1] }
645
            timeout                             { perror "timeout\n; break }
646
            eof                                 { break }
647
        }
648
    }
649
 
650
    # This was intended to do any cleanup necessary.  It kinda looks like it
651
    # isn't needed, but just in case, please keep it in for now.
652
    gas_finish
653
 
654
    # Did we find what we were looking for?  If not, flunk it.
655
    if [expr $x == 4] then { pass $testname } else { fail $testname }
656
}
657
 
658
proc do_xc16x_jmpa {} {
659
    set testname "jmpa.s: xc16x jump absolute test"
660
    set x 0
661
 
662
    gas_start "jmpa.s" "-al"
663
 
664
    # Check each instruction bit pattern to verify it got
665
    # assembled correctly.
666
    while 1 {
667
        expect {
668
            -re " +\[0-9\]+ 0000 EA00AAAA\[^\n\]*\n"   { set x [expr $x+1] }
669
            -re " +\[0-9\]+ 0004 EA20AAAA\[^\n\]*\n"   { set x [expr $x+1] }
670
            -re " +\[0-9\]+ 0008 EA30AAAA\[^\n\]*\n"   { set x [expr $x+1] }
671
            -re " +\[0-9\]+ 000c EA40AAAA\[^\n\]*\n"   { set x [expr $x+1] }
672
            -re " +\[0-9\]+ 0010 EA50AAAA\[^\n\]*\n"   { set x [expr $x+1] }
673
            -re " +\[0-9\]+ 0014 EA60AAAA\[^\n\]*\n"   { set x [expr $x+1] }
674
            -re " +\[0-9\]+ 0018 EA70AAAA\[^\n\]*\n"   { set x [expr $x+1] }
675
            -re " +\[0-9\]+ 001c EA80AAAA\[^\n\]*\n"   { set x [expr $x+1] }
676
            -re " +\[0-9\]+ 0020 EA90AAAA\[^\n\]*\n"   { set x [expr $x+1] }
677
            -re " +\[0-9\]+ 0024 EA20AAAA\[^\n\]*\n"   { set x [expr $x+1] }
678
            -re " +\[0-9\]+ 0028 EA30AAAA\[^\n\]*\n"   { set x [expr $x+1] }
679
            -re " +\[0-9\]+ 002c EA80AAAA\[^\n\]*\n"   { set x [expr $x+1] }
680
            -re " +\[0-9\]+ 0030 EAF0AAAA\[^\n\]*\n"   { set x [expr $x+1] }
681
            -re " +\[0-9\]+ 0034 EA90AAAA\[^\n\]*\n"   { set x [expr $x+1] }
682
            -re " +\[0-9\]+ 0038 EAE0AAAA\[^\n\]*\n"   { set x [expr $x+1] }
683
            -re " +\[0-9\]+ 003c EAB0AAAA\[^\n\]*\n"   { set x [expr $x+1] }
684
            -re " +\[0-9\]+ 0040 EAD0AAAA\[^\n\]*\n"   { set x [expr $x+1] }
685
            -re " +\[0-9\]+ 0044 EAA0AAAA\[^\n\]*\n"   { set x [expr $x+1] }
686
            -re " +\[0-9\]+ 0048 EA10AAAA\[^\n\]*\n"   { set x [expr $x+1] }
687
            timeout                             { perror "timeout\n; break }
688
            eof                                 { break }
689
        }
690
    }
691
 
692
    # This was intended to do any cleanup necessary.  It kinda looks like it
693
    # isn't needed, but just in case, please keep it in for now.
694
    gas_finish
695
 
696
    # Did we find what we were looking for?  If not, flunk it.
697
    if [expr $x == 19] then { pass $testname } else { fail $testname }
698
}
699
 
700
proc do_xc16x_jmpi {} {
701
    set testname "jmpi.s: xc16x jmp immidiate tests "
702
    set x 0
703
 
704
    gas_start "jmpi.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 9C07\[^\n\]*\n"   { set x [expr $x+1] }
711
            -re " +\[0-9\]+ 0002 9C27\[^\n\]*\n"   { set x [expr $x+1] }
712
            -re " +\[0-9\]+ 0004 9C37\[^\n\]*\n"   { set x [expr $x+1] }
713
            -re " +\[0-9\]+ 0006 9C47\[^\n\]*\n"   { set x [expr $x+1] }
714
            -re " +\[0-9\]+ 0008 9C57\[^\n\]*\n"   { set x [expr $x+1] }
715
            -re " +\[0-9\]+ 000a 9C67\[^\n\]*\n"   { set x [expr $x+1] }
716
            -re " +\[0-9\]+ 000c 9C77\[^\n\]*\n"   { set x [expr $x+1] }
717
            -re " +\[0-9\]+ 000e 9C87\[^\n\]*\n"   { set x [expr $x+1] }
718
            -re " +\[0-9\]+ 0010 9C97\[^\n\]*\n"   { set x [expr $x+1] }
719
            -re " +\[0-9\]+ 0012 9C27\[^\n\]*\n"   { set x [expr $x+1] }
720
            -re " +\[0-9\]+ 0014 9C37\[^\n\]*\n"   { set x [expr $x+1] }
721
            -re " +\[0-9\]+ 0016 9C87\[^\n\]*\n"   { set x [expr $x+1] }
722
            -re " +\[0-9\]+ 0018 9CF7\[^\n\]*\n"   { set x [expr $x+1] }
723
            -re " +\[0-9\]+ 001a 9C97\[^\n\]*\n"   { set x [expr $x+1] }
724
            -re " +\[0-9\]+ 001c 9CE7\[^\n\]*\n"   { set x [expr $x+1] }
725
            -re " +\[0-9\]+ 001e 9CB7\[^\n\]*\n"   { set x [expr $x+1] }
726
            -re " +\[0-9\]+ 0020 9CD7\[^\n\]*\n"   { set x [expr $x+1] }
727
            -re " +\[0-9\]+ 0022 9CA7\[^\n\]*\n"   { set x [expr $x+1] }
728
            -re " +\[0-9\]+ 0024 9C17\[^\n\]*\n"   { set x [expr $x+1] }
729
            timeout                             { perror "timeout\n; break }
730
            eof                                 { break }
731
        }
732
    }
733
 
734
    # This was intended to do any cleanup necessary.  It kinda looks like it
735
    # isn't needed, but just in case, please keep it in for now.
736
    gas_finish
737
 
738
    # Did we find what we were looking for?  If not, flunk it.
739
    if [expr $x == 19] then { pass $testname } else { fail $testname }
740
}
741
 
742
 
743
proc do_xc16x_jmpr {} {
744
    set testname "jmpr.s: xc16x jump relative tests"
745
    set x 0
746
 
747
    gas_start "jmpr.s" "-al"
748
 
749
    # Check each instruction bit pattern to verify it got
750
    # assembled correctly.
751
    while 1 {
752
        expect {
753
            -re " +\[0-9\]+ 0000 0DFF\[^\n\]*\n"   { set x [expr $x+1] }
754
            -re " +\[0-9\]+ 0002 2DFE\[^\n\]*\n"   { set x [expr $x+1] }
755
            -re " +\[0-9\]+ 0004 3DFD\[^\n\]*\n"   { set x [expr $x+1] }
756
            -re " +\[0-9\]+ 0006 4DFC\[^\n\]*\n"   { set x [expr $x+1] }
757
            -re " +\[0-9\]+ 0008 5DFB\[^\n\]*\n"   { set x [expr $x+1] }
758
            -re " +\[0-9\]+ 000a 6DFA\[^\n\]*\n"   { set x [expr $x+1] }
759
            -re " +\[0-9\]+ 000c 7DF9\[^\n\]*\n"   { set x [expr $x+1] }
760
            -re " +\[0-9\]+ 000e 8DF8\[^\n\]*\n"   { set x [expr $x+1] }
761
            -re " +\[0-9\]+ 0010 9DF7\[^\n\]*\n"   { set x [expr $x+1] }
762
            -re " +\[0-9\]+ 0012 2DF6\[^\n\]*\n"   { set x [expr $x+1] }
763
            -re " +\[0-9\]+ 0014 3DF5\[^\n\]*\n"   { set x [expr $x+1] }
764
            -re " +\[0-9\]+ 0016 8DF4\[^\n\]*\n"   { set x [expr $x+1] }
765
            -re " +\[0-9\]+ 0018 FDF3\[^\n\]*\n"   { set x [expr $x+1] }
766
            -re " +\[0-9\]+ 001a 9DF2\[^\n\]*\n"   { set x [expr $x+1] }
767
            -re " +\[0-9\]+ 001c EDF1\[^\n\]*\n"   { set x [expr $x+1] }
768
            -re " +\[0-9\]+ 001e BDF0\[^\n\]*\n"   { set x [expr $x+1] }
769
            -re " +\[0-9\]+ 0020 DDEF\[^\n\]*\n"   { set x [expr $x+1] }
770
            -re " +\[0-9\]+ 0022 ADEE\[^\n\]*\n"   { set x [expr $x+1] }
771
            -re " +\[0-9\]+ 0024 1DED\[^\n\]*\n"   { set x [expr $x+1] }
772
            -re " +\[0-9\]+ 0026 CDEC\[^\n\]*\n"   { set x [expr $x+1] }
773
            timeout                             { perror "timeout\n; break }
774
            eof                                 { break }
775
        }
776
    }
777
 
778
    # This was intended to do any cleanup necessary.  It kinda looks like it
779
    # isn't needed, but just in case, please keep it in for now.
780
    gas_finish
781
 
782
    # Did we find what we were looking for?  If not, flunk it.
783
    if [expr $x == 20] then { pass $testname } else { fail $testname }
784
}
785
 
786
proc do_xc16x_syscontrol1 {} {
787
    set testname "syscontrol1.s: xc16x system control insrutions tests"
788
    set x 0
789
 
790
    gas_start "syscontrol1.s" "-al"
791
 
792
    # Check each instruction bit pattern to verify it got
793
    # assembled correctly.
794
    while 1 {
795
        expect {
796
            -re " +\[0-9\]+ 0000 B748B7B7\[^\n\]*\n"   { set x [expr $x+1] }
797
            -re " +\[0-9\]+ 0004 8C00\[^\n\]*\n"   { set x [expr $x+1] }
798
            -re " +\[0-9\]+ 0006 87788787\[^\n\]*\n"   { set x [expr $x+1] }
799
            -re " +\[0-9\]+ 000a 97689797\[^\n\]*\n"   { set x [expr $x+1] }
800
            -re " +\[0-9\]+ 000e A758A7A7\[^\n\]*\n"   { set x [expr $x+1] }
801
            -re " +\[0-9\]+ 0012 A55AA5A5\[^\n\]*\n"   { set x [expr $x+1] }
802
            -re " +\[0-9\]+ 0016 857A8585\[^\n\]*\n"   { set x [expr $x+1] }
803
            -re " +\[0-9\]+ 001a B54AB5B5\[^\n\]*\n"   { set x [expr $x+1] }
804
            timeout                             { perror "timeout\n; break }
805
            eof                                 { break }
806
        }
807
    }
808
 
809
    # This was intended to do any cleanup necessary.  It kinda looks like it
810
    # isn't needed, but just in case, please keep it in for now.
811
    gas_finish
812
 
813
    # Did we find what we were looking for?  If not, flunk it.
814
    if [expr $x == 8] then { pass $testname } else { fail $testname }
815
}
816
 
817
proc do_xc16x_syscontrol2 {} {
818
    set testname "syscontrol2.s: xc16x syscontrol2 tests"
819
    set x 0
820
 
821
    gas_start "syscontrol2.s" "-al"
822
 
823
    # Check each instruction bit pattern to verify it got
824
    # assembled correctly.
825
    while 1 {
826
        expect {
827
            -re " +\[0-9\]+ 0000 D1B0\[^\n\]*\n"   { set x [expr $x+1] }
828
            -re " +\[0-9\]+ 0002 D1A0\[^\n\]*\n"   { set x [expr $x+1] }
829
            -re " +\[0-9\]+ 0004 D190\[^\n\]*\n"   { set x [expr $x+1] }
830
            -re " +\[0-9\]+ 0006 D180\[^\n\]*\n"   { set x [expr $x+1] }
831
            -re " +\[0-9\]+ 0008 D130\[^\n\]*\n"   { set x [expr $x+1] }
832
            -re " +\[0-9\]+ 000a D120\[^\n\]*\n"   { set x [expr $x+1] }
833
            -re " +\[0-9\]+ 000c D110\[^\n\]*\n"   { set x [expr $x+1] }
834
            -re " +\[0-9\]+ 000e D100\[^\n\]*\n"   { set x [expr $x+1] }
835
            -re " +\[0-9\]+ 0010 DC75\[^\n\]*\n"   { set x [expr $x+1] }
836
            -re " +\[0-9\]+ 0012 D770FF03\[^\n\]*\n"   { set x [expr $x+1] }
837
            -re " +\[0-9\]+ 0016 DCF5\[^\n\]*\n"   { set x [expr $x+1] }
838
            -re " +\[0-9\]+ 0018 D7F0FF03\[^\n\]*\n"   { set x [expr $x+1] }
839
            -re " +\[0-9\]+ 001c DC35\[^\n\]*\n"   { set x [expr $x+1] }
840
            -re " +\[0-9\]+ 001e D7300100\[^\n\]*\n"   { set x [expr $x+1] }
841
            -re " +\[0-9\]+ 0022 DCB5\[^\n\]*\n"   { set x [expr $x+1] }
842
            -re " +\[0-9\]+ 0024 D7B00100\[^\n\]*\n"   { set x [expr $x+1] }
843
            timeout                             { perror "timeout\n; break }
844
            eof                                 { break }
845
        }
846
    }
847
 
848
    # This was intended to do any cleanup necessary.  It kinda looks like it
849
    # isn't needed, but just in case, please keep it in for now.
850
    gas_finish
851
 
852
    # Did we find what we were looking for?  If not, flunk it.
853
    if [expr $x == 16] then { pass $testname } else { fail $testname }
854
}
855
 
856
proc do_xc16x_cpl {} {
857
    set testname "cpl.s: xc16x compliment tests"
858
    set x 0
859
 
860
    gas_start "cpl.s" "-al"
861
 
862
    # Check each instruction bit pattern to verify it got
863
    # assembled correctly.
864
    while 1 {
865
        expect {
866
            -re " +\[0-9\]+ 0000 9100\[^\n\]*\n"   { set x [expr $x+1] }
867
            -re " +\[0-9\]+ 0002 B100\[^\n\]*\n"   { set x [expr $x+1] }
868
            timeout                             { perror "timeout\n; break }
869
            eof                                 { break }
870
        }
871
    }
872
 
873
    # This was intended to do any cleanup necessary.  It kinda looks like it
874
    # isn't needed, but just in case, please keep it in for now.
875
    gas_finish
876
 
877
    # Did we find what we were looking for?  If not, flunk it.
878
    if [expr $x == 2] then { pass $testname } else { fail $testname }
879
}
880
 
881
proc do_xc16x_cmp {} {
882
    set testname "cmp.s: xc16x misc tests"
883
    set x 0
884
 
885
    gas_start "cmp.s" "-al"
886
 
887
    # Check each instruction bit pattern to verify it got
888
    # assembled correctly.
889
    while 1 {
890
        expect {
891
            -re " +\[0-9\]+ 0000 4001\[^\n\]*\n"   { set x [expr $x+1] }
892
            -re " +\[0-9\]+ 0002 4809\[^\n\]*\n"   { set x [expr $x+1] }
893
            -re " +\[0-9\]+ 0004 480D\[^\n\]*\n"   { set x [expr $x+1] }
894
            -re " +\[0-9\]+ 0006 4803\[^\n\]*\n"   { set x [expr $x+1] }
895
            -re " +\[0-9\]+ 0008 46F03402\[^\n\]*\n"   { set x [expr $x+1] }
896
            -re " +\[0-9\]+ 000c 42F05234\[^\n\]*\n"   { set x [expr $x+1] }
897
            timeout                             { perror "timeout\n; break }
898
            eof                                 { break }
899
        }
900
    }
901
 
902
    # This was intended to do any cleanup necessary.  It kinda looks like it
903
    # isn't needed, but just in case, please keep it in for now.
904
    gas_finish
905
 
906
    # Did we find what we were looking for?  If not, flunk it.
907
    if [expr $x == 6] then { pass $testname } else { fail $testname }
908
}
909
 
910
proc do_xc16x_cmpb {} {
911
    set testname "cmpb.s: xc16x cmp byte tests"
912
    set x 0
913
 
914
    gas_start "cmpb.s" "-al"
915
 
916
    # Check each instruction bit pattern to verify it got
917
    # assembled correctly.
918
    while 1 {
919
        expect {
920
            -re " +\[0-9\]+ 0000 4102\[^\n\]*\n"   { set x [expr $x+1] }
921
            -re " +\[0-9\]+ 0002 4909\[^\n\]*\n"   { set x [expr $x+1] }
922
            -re " +\[0-9\]+ 0004 490D\[^\n\]*\n"   { set x [expr $x+1] }
923
            -re " +\[0-9\]+ 0006 4903\[^\n\]*\n"   { set x [expr $x+1] }
924
            -re " +\[0-9\]+ 0008 47F02200\[^\n\]*\n"   { set x [expr $x+1] }
925
            -re " +\[0-9\]+ 000c 43F03402\[^\n\]*\n"   { set x [expr $x+1] }
926
            timeout                             { perror "timeout\n; break }
927
            eof                                 { break }
928
        }
929
    }
930
 
931
    # This was intended to do any cleanup necessary.  It kinda looks like it
932
    # isn't needed, but just in case, please keep it in for now.
933
    gas_finish
934
 
935
    # Did we find what we were looking for?  If not, flunk it.
936
    if [expr $x == 6] then { pass $testname } else { fail $testname }
937
}
938
 
939
proc do_xc16x_cmpi {} {
940
    set testname "cmpi.s: xc16x cmpi tests"
941
    set x 0
942
 
943
    gas_start "cmpi.s" "-al"
944
 
945
    # Check each instruction bit pattern to verify it got
946
    # assembled correctly.
947
    while 1 {
948
        expect {
949
            -re " +\[0-9\]+ 0000 A0F0\[^\n\]*\n"   { set x [expr $x+1] }
950
            -re " +\[0-9\]+ 0002 A6F0CBFC\[^\n\]*\n"   { set x [expr $x+1] }
951
            -re " +\[0-9\]+ 0006 A2F0CBFF\[^\n\]*\n"   { set x [expr $x+1] }
952
            -re " +\[0-9\]+ 000a B0F0\[^\n\]*\n"   { set x [expr $x+1] }
953
            -re " +\[0-9\]+ 000c B6F0CBFC\[^\n\]*\n"   { set x [expr $x+1] }
954
            -re " +\[0-9\]+ 0010 B2F0CBFF\[^\n\]*\n"   { set x [expr $x+1] }
955
            -re " +\[0-9\]+ 0014 80F0\[^\n\]*\n"   { set x [expr $x+1] }
956
            -re " +\[0-9\]+ 0016 86F0CBFC\[^\n\]*\n"   { set x [expr $x+1] }
957
            -re " +\[0-9\]+ 001a 82F0CBFF\[^\n\]*\n"   { set x [expr $x+1] }
958
            -re " +\[0-9\]+ 001e 90F0\[^\n\]*\n"   { set x [expr $x+1] }
959
            -re " +\[0-9\]+ 0020 96F0CBFC\[^\n\]*\n"   { set x [expr $x+1] }
960
            -re " +\[0-9\]+ 0024 92F0CBFF\[^\n\]*\n"   { set x [expr $x+1] }
961
            timeout                             { perror "timeout\n; break }
962
            eof                                 { break }
963
        }
964
    }
965
 
966
    # This was intended to do any cleanup necessary.  It kinda looks like it
967
    # isn't needed, but just in case, please keep it in for now.
968
    gas_finish
969
 
970
    # Did we find what we were looking for?  If not, flunk it.
971
    if [expr $x == 12] then { pass $testname } else { fail $testname }
972
}
973
 
974
proc do_xc16x_calli {} {
975
    set testname "calli.s: xc16x call tests"
976
    set x 0
977
 
978
    gas_start "calli.s" "-al"
979
 
980
    # Check each instruction bit pattern to verify it got
981
    # assembled correctly.
982
    while 1 {
983
        expect {
984
            -re " +\[0-9\]+ 0000 AB01\[^\n\]*\n"   { set x [expr $x+1] }
985
            -re " +\[0-9\]+ 0002 AB21\[^\n\]*\n"   { set x [expr $x+1] }
986
            -re " +\[0-9\]+ 0004 AB31\[^\n\]*\n"   { set x [expr $x+1] }
987
            -re " +\[0-9\]+ 0006 AB41\[^\n\]*\n"   { set x [expr $x+1] }
988
            -re " +\[0-9\]+ 0008 AB51\[^\n\]*\n"   { set x [expr $x+1] }
989
            -re " +\[0-9\]+ 000a AB61\[^\n\]*\n"   { set x [expr $x+1] }
990
            -re " +\[0-9\]+ 000c AB71\[^\n\]*\n"   { set x [expr $x+1] }
991
            -re " +\[0-9\]+ 000e AB81\[^\n\]*\n"   { set x [expr $x+1] }
992
            -re " +\[0-9\]+ 0010 AB91\[^\n\]*\n"   { set x [expr $x+1] }
993
            -re " +\[0-9\]+ 0012 AB21\[^\n\]*\n"   { set x [expr $x+1] }
994
            -re " +\[0-9\]+ 0014 AB31\[^\n\]*\n"   { set x [expr $x+1] }
995
            -re " +\[0-9\]+ 0016 AB81\[^\n\]*\n"   { set x [expr $x+1] }
996
            -re " +\[0-9\]+ 0018 ABF1\[^\n\]*\n"   { set x [expr $x+1] }
997
            -re " +\[0-9\]+ 001a AB91\[^\n\]*\n"   { set x [expr $x+1] }
998
            -re " +\[0-9\]+ 001c ABE1\[^\n\]*\n"   { set x [expr $x+1] }
999
            -re " +\[0-9\]+ 001e ABB1\[^\n\]*\n"   { set x [expr $x+1] }
1000
            -re " +\[0-9\]+ 0020 ABD1\[^\n\]*\n"   { set x [expr $x+1] }
1001
            -re " +\[0-9\]+ 0022 AB11\[^\n\]*\n"   { set x [expr $x+1] }
1002
            -re " +\[0-9\]+ 0024 ABC1\[^\n\]*\n"   { set x [expr $x+1] }
1003
            timeout                             { perror "timeout\n; break }
1004
            eof                                 { break }
1005
        }
1006
    }
1007
 
1008
    # This was intended to do any cleanup necessary.  It kinda looks like it
1009
    # isn't needed, but just in case, please keep it in for now.
1010
    gas_finish
1011
 
1012
    # Did we find what we were looking for?  If not, flunk it.
1013
    if [expr $x == 19] then { pass $testname } else { fail $testname }
1014
}
1015
 
1016
proc do_xc16x_calla {} {
1017
    set testname "calla.s: xc16x call tests"
1018
    set x 0
1019
 
1020
    gas_start "calla.s" "-al"
1021
 
1022
    # Check each instruction bit pattern to verify it got
1023
    # assembled correctly.
1024
    while 1 {
1025
        expect {
1026
            -re " +\[0-9\]+ 0000 CA00AAAA\[^\n\]*\n"   { set x [expr $x+1] }
1027
            -re " +\[0-9\]+ 0004 CA20AAAA\[^\n\]*\n"   { set x [expr $x+1] }
1028
            -re " +\[0-9\]+ 0008 CA30AAAA\[^\n\]*\n"   { set x [expr $x+1] }
1029
            -re " +\[0-9\]+ 000c CA40AAAA\[^\n\]*\n"   { set x [expr $x+1] }
1030
            -re " +\[0-9\]+ 0010 CA50AAAA\[^\n\]*\n"   { set x [expr $x+1] }
1031
            -re " +\[0-9\]+ 0014 CA60AAAA\[^\n\]*\n"   { set x [expr $x+1] }
1032
            -re " +\[0-9\]+ 0018 CA70AAAA\[^\n\]*\n"   { set x [expr $x+1] }
1033
            -re " +\[0-9\]+ 001c CA80AAAA\[^\n\]*\n"   { set x [expr $x+1] }
1034
            -re " +\[0-9\]+ 0020 CA90AAAA\[^\n\]*\n"   { set x [expr $x+1] }
1035
            -re " +\[0-9\]+ 0024 CA20AAAA\[^\n\]*\n"   { set x [expr $x+1] }
1036
            -re " +\[0-9\]+ 0028 CA30AAAA\[^\n\]*\n"   { set x [expr $x+1] }
1037
            -re " +\[0-9\]+ 002c CA80AAAA\[^\n\]*\n"   { set x [expr $x+1] }
1038
            -re " +\[0-9\]+ 0030 CAF0AAAA\[^\n\]*\n"   { set x [expr $x+1] }
1039
            -re " +\[0-9\]+ 0034 CA90AAAA\[^\n\]*\n"   { set x [expr $x+1] }
1040
            -re " +\[0-9\]+ 0038 CAE0AAAA\[^\n\]*\n"   { set x [expr $x+1] }
1041
            -re " +\[0-9\]+ 003c CAB0AAAA\[^\n\]*\n"   { set x [expr $x+1] }
1042
            -re " +\[0-9\]+ 0040 CAD0AAAA\[^\n\]*\n"   { set x [expr $x+1] }
1043
            -re " +\[0-9\]+ 0044 CAA0AAAA\[^\n\]*\n"   { set x [expr $x+1] }
1044
            -re " +\[0-9\]+ 0048 CA10AAAA\[^\n\]*\n"   { set x [expr $x+1] }
1045
            -re " +\[0-9\]+ 004c CAC0AAAA\[^\n\]*\n"   { set x [expr $x+1] }
1046
            timeout                             { perror "timeout\n; break }
1047
            eof                                 { break }
1048
        }
1049
    }
1050
 
1051
    # This was intended to do any cleanup necessary.  It kinda looks like it
1052
    # isn't needed, but just in case, please keep it in for now.
1053
    gas_finish
1054
 
1055
    # Did we find what we were looking for?  If not, flunk it.
1056
    if [expr $x == 20] then { pass $testname } else { fail $testname }
1057
}
1058
 
1059
 
1060
proc do_xc16x_bit {} {
1061
    set testname "bit.s: xc16x bit manipulation tests"
1062
    set x 0
1063
 
1064
    gas_start "bit.s" "-al"
1065
 
1066
    # Check each instruction bit pattern to verify it got
1067
    # assembled correctly.
1068
    while 1 {
1069
        expect {
1070
            -re " +\[0-9\]+ 0000 1EF0\[^\n\]*\n"   { set x [expr $x+1] }
1071
            -re " +\[0-9\]+ 0002 1FF0\[^\n\]*\n"   { set x [expr $x+1] }
1072
            -re " +\[0-9\]+ 0004 4AF0F012\[^\n\]*\n"   { set x [expr $x+1] }
1073
            -re " +\[0-9\]+ 0008 3AF0F023\[^\n\]*\n"   { set x [expr $x+1] }
1074
            -re " +\[0-9\]+ 000c 6AF0F041\[^\n\]*\n"   { set x [expr $x+1] }
1075
            -re " +\[0-9\]+ 0010 5AF0F021\[^\n\]*\n"   { set x [expr $x+1] }
1076
            -re " +\[0-9\]+ 0014 7AF0F021\[^\n\]*\n"   { set x [expr $x+1] }
1077
            -re " +\[0-9\]+ 0018 2AF0F021\[^\n\]*\n"   { set x [expr $x+1] }
1078
            timeout                             { perror "timeout\n; break }
1079
            eof                                 { break }
1080
        }
1081
    }
1082
 
1083
    # This was intended to do any cleanup necessary.  It kinda looks like it
1084
    # isn't needed, but just in case, please keep it in for now.
1085
    gas_finish
1086
 
1087
    # Did we find what we were looking for?  If not, flunk it.
1088
    if [expr $x == 8] then { pass $testname } else { fail $testname }
1089
}
1090
 
1091
proc do_xc16x_bfldl {} {
1092
    set testname "bfldl.s: xc16x bitwise modify masked data tests"
1093
    set x 0
1094
 
1095
    gas_start "bfldl.s" "-al"
1096
 
1097
    # Check each instruction bit pattern to verify it got
1098
    # assembled correctly.
1099
    while 1 {
1100
        expect {
1101
            -re " +\[0-9\]+ 0000 0AF0870E\[^\n\]*\n"   { set x [expr $x+1] }
1102
            -re " +\[0-9\]+ 0004 1AF00EFF\[^\n\]*\n"   { set x [expr $x+1] }
1103
            timeout                             { perror "timeout\n; break }
1104
            eof                                 { break }
1105
        }
1106
    }
1107
 
1108
    # This was intended to do any cleanup necessary.  It kinda looks like it
1109
    # isn't needed, but just in case, please keep it in for now.
1110
    gas_finish
1111
 
1112
    # Did we find what we were looking for?  If not, flunk it.
1113
    if [expr $x == 2] then { pass $testname } else { fail $testname }
1114
}
1115
 
1116
proc do_xc16x_ret {} {
1117
    set testname "ret.s: xc16x ret tests"
1118
    set x 0
1119
 
1120
    gas_start "ret.s" "-al"
1121
 
1122
    # Check each instruction bit pattern to verify it got
1123
    # assembled correctly.
1124
    while 1 {
1125
        expect {
1126
            -re " +\[0-9\]+ 0000 CB00\[^\n\]*\n"   { set x [expr $x+1] }
1127
            -re " +\[0-9\]+ 0002 FB88\[^\n\]*\n"   { set x [expr $x+1] }
1128
            -re " +\[0-9\]+ 0004 DB00\[^\n\]*\n"   { set x [expr $x+1] }
1129
            -re " +\[0-9\]+ 0006 EBF5\[^\n\]*\n"   { set x [expr $x+1] }
1130
            timeout                             { perror "timeout\n; break }
1131
            eof                                 { break }
1132
        }
1133
    }
1134
 
1135
    # This was intended to do any cleanup necessary.  It kinda looks like it
1136
    # isn't needed, but just in case, please keep it in for now.
1137
    gas_finish
1138
 
1139
    # Did we find what we were looking for?  If not, flunk it.
1140
    if [expr $x == 4] then { pass $testname } else { fail $testname }
1141
}
1142
 
1143
proc do_xc16x_trap {} {
1144
    set testname "trap.s: xc16x add/sub tests"
1145
    set x 0
1146
 
1147
    gas_start "trap.s" "-al"
1148
 
1149
    # Check each instruction bit pattern to verify it got
1150
    # assembled correctly.
1151
    while 1 {
1152
        expect {
1153
            -re " +\[0-9\]+ 0000 9B04\[^\n\]*\n"   { set x [expr $x+1] }
1154
            timeout                             { perror "timeout\n; break }
1155
            eof                                 { break }
1156
        }
1157
    }
1158
 
1159
    # This was intended to do any cleanup necessary.  It kinda looks like it
1160
    # isn't needed, but just in case, please keep it in for now.
1161
    gas_finish
1162
 
1163
    # Did we find what we were looking for?  If not, flunk it.
1164
    if [expr $x == 1] then { pass $testname } else { fail $testname }
1165
}
1166
 
1167
proc do_xc16x_orb {} {
1168
    set testname "orb.s: xc16x or byte instructions tests"
1169
    set x 0
1170
 
1171
    gas_start "orb.s" "-al"
1172
 
1173
    # Check each instruction bit pattern to verify it got
1174
    # assembled correctly.
1175
    while 1 {
1176
        expect {
1177
            -re " +\[0-9\]+ 0000 7102\[^\n\]*\n"   { set x [expr $x+1] }
1178
            -re " +\[0-9\]+ 0002 7909\[^\n\]*\n"   { set x [expr $x+1] }
1179
            -re " +\[0-9\]+ 0004 790D\[^\n\]*\n"   { set x [expr $x+1] }
1180
            -re " +\[0-9\]+ 0006 7903\[^\n\]*\n"   { set x [expr $x+1] }
1181
            -re " +\[0-9\]+ 0008 77F02300\[^\n\]*\n"   { set x [expr $x+1] }
1182
            -re " +\[0-9\]+ 000c 73F03402\[^\n\]*\n"   { set x [expr $x+1] }
1183
            -re " +\[0-9\]+ 0010 75F03402\[^\n\]*\n"   { set x [expr $x+1] }
1184
            timeout                             { perror "timeout\n; break }
1185
            eof                                 { break }
1186
        }
1187
    }
1188
 
1189
    # This was intended to do any cleanup necessary.  It kinda looks like it
1190
    # isn't needed, but just in case, please keep it in for now.
1191
    gas_finish
1192
 
1193
    # Did we find what we were looking for?  If not, flunk it.
1194
    if [expr $x == 7] then { pass $testname } else { fail $testname }
1195
}
1196
 
1197
 
1198
proc do_xc16x_prior {} {
1199
    set testname "prior.s: Determine no shift cycles tests"
1200
    set x 0
1201
 
1202
    gas_start "prior.s" "-al"
1203
 
1204
    # Check each instruction bit pattern to verify it got
1205
    # assembled correctly.
1206
    while 1 {
1207
        expect {
1208
            -re " +\[0-9\]+ 0000 2B01\[^\n\]*\n"   { set x [expr $x+1] }
1209
            timeout                             { perror "timeout\n; break }
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 == 1] then { pass $testname } else { fail $testname }
1220
}
1221
 
1222
proc do_xc16x_nop {} {
1223
    set testname "nop.s: no operation nop tests"
1224
    set x 0
1225
 
1226
    gas_start "nop.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 CC00\[^\n\]*\n"   { set x [expr $x+1] }
1233
            -re " +\[0-9\]+ 0002 CC00\[^\n\]*\n"   { set x [expr $x+1] }
1234
            timeout                             { perror "timeout\n; break }
1235
            eof                                 { break }
1236
        }
1237
    }
1238
 
1239
    # This was intended to do any cleanup necessary.  It kinda looks like it
1240
    # isn't needed, but just in case, please keep it in for now.
1241
    gas_finish
1242
 
1243
    # Did we find what we were looking for?  If not, flunk it.
1244
    if [expr $x == 2] then { pass $testname } else { fail $testname }
1245
}
1246
 
1247
 
1248
proc do_xc16x_scxt {} {
1249
    set testname "scxt.s: push direct word to system stack tests"
1250
    set x 0
1251
 
1252
    gas_start "scxt.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 C6F0FFFF\[^\n\]*\n"   { set x [expr $x+1] }
1259
            -re " +\[0-9\]+ 0004 D6F0FFFF\[^\n\]*\n"   { set x [expr $x+1] }
1260
            timeout                             { perror "timeout\n; break }
1261
            eof                                 { break }
1262
        }
1263
    }
1264
 
1265
    # This was intended to do any cleanup necessary.  It kinda looks like it
1266
    # isn't needed, but just in case, please keep it in for now.
1267
    gas_finish
1268
 
1269
    # Did we find what we were looking for?  If not, flunk it.
1270
    if [expr $x == 2] then { pass $testname } else { fail $testname }
1271
}
1272
 
1273
 
1274
if [istarget xc16x*-*-*] then {
1275
    # Test the basic xc16x instruction parser
1276
    do_xc16x_add
1277
    do_xc16x_addb
1278
    do_xc16x_addc
1279
    do_xc16x_addcb
1280
    do_xc16x_sub
1281
    do_xc16x_subb
1282
    do_xc16x_subc
1283
    do_xc16x_subcb
1284
    do_xc16x_and
1285
    do_xc16x_andb
1286
    do_xc16x_or
1287
    do_xc16x_xor
1288
    do_xc16x_xorb
1289
    do_xc16x_mov
1290
    do_xc16x_movb
1291
    do_xc16x_movbs
1292
    do_xc16x_movbz
1293
    do_xc16x_shlrol
1294
    do_xc16x_neg
1295
    do_xc16x_mul
1296
    do_xc16x_div
1297
    do_xc16x_jmpa
1298
    do_xc16x_jmpi
1299
    do_xc16x_jmpr
1300
    do_xc16x_syscontrol1
1301
    do_xc16x_syscontrol2
1302
    do_xc16x_cpl
1303
    do_xc16x_cmp
1304
    do_xc16x_cmpb
1305
    do_xc16x_cmpi
1306
    do_xc16x_calla
1307
    do_xc16x_calli
1308
    do_xc16x_bit
1309
    do_xc16x_bfldl
1310
    do_xc16x_ret
1311
    do_xc16x_trap
1312
    do_xc16x_orb
1313
    do_xc16x_prior
1314
    do_xc16x_nop
1315
    do_xc16x_scxt
1316
 
1317
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.