OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [binutils-2.18.50/] [gas/] [testsuite/] [gas/] [h8300/] [h8300-coff.exp] - Blame information for rev 856

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 38 julius
#
2
# Some H8/300 coff tests
3
#
4
proc do_h8300_cbranch {} {
5
    set testname "cbranch.s: h8300 conditional branch tests"
6
    set x 0
7
 
8
    gas_start "cbranch.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 4000\[^\n\]*\n"   { set x [expr $x+1] }
15
            -re " +\[0-9\]+ 0002 4000\[^\n\]*\n"   { set x [expr $x+1] }
16
            -re " +\[0-9\]+ 0004 4100\[^\n\]*\n"   { set x [expr $x+1] }
17
            -re " +\[0-9\]+ 0006 4100\[^\n\]*\n"   { set x [expr $x+1] }
18
            -re " +\[0-9\]+ 0008 4200\[^\n\]*\n"   { set x [expr $x+1] }
19
            -re " +\[0-9\]+ 000a 4300\[^\n\]*\n"   { set x [expr $x+1] }
20
            -re " +\[0-9\]+ 000c 4400\[^\n\]*\n"   { set x [expr $x+1] }
21
            -re " +\[0-9\]+ 000e 4400\[^\n\]*\n"   { set x [expr $x+1] }
22
            -re " +\[0-9\]+ 0010 4500\[^\n\]*\n"   { set x [expr $x+1] }
23
            -re " +\[0-9\]+ 0012 4500\[^\n\]*\n"   { set x [expr $x+1] }
24
            -re " +\[0-9\]+ 0014 4600\[^\n\]*\n"   { set x [expr $x+1] }
25
            -re " +\[0-9\]+ 0016 4700\[^\n\]*\n"   { set x [expr $x+1] }
26
            -re " +\[0-9\]+ 0018 4800\[^\n\]*\n"   { set x [expr $x+1] }
27
            -re " +\[0-9\]+ 001a 4900\[^\n\]*\n"   { set x [expr $x+1] }
28
            -re " +\[0-9\]+ 001c 4A00\[^\n\]*\n"   { set x [expr $x+1] }
29
            -re " +\[0-9\]+ 001e 4B00\[^\n\]*\n"   { set x [expr $x+1] }
30
            -re " +\[0-9\]+ 0020 4C00\[^\n\]*\n"   { set x [expr $x+1] }
31
            -re " +\[0-9\]+ 0022 4D00\[^\n\]*\n"   { set x [expr $x+1] }
32
            -re " +\[0-9\]+ 0024 4E00\[^\n\]*\n"   { set x [expr $x+1] }
33
            -re " +\[0-9\]+ 0026 4F00\[^\n\]*\n"   { set x [expr $x+1] }
34
            timeout                             { perror "timeout\n; break }
35
            eof                                 { break }
36
        }
37
    }
38
 
39
    # This was intended to do any cleanup necessary.  It kinda looks like it
40
    # isn't needed, but just in case, please keep it in for now.
41
    gas_finish
42
 
43
    # Did we find what we were looking for?  If not, flunk it.
44
    if [expr $x == 20] then { pass $testname } else { fail $testname }
45
}
46
 
47
proc do_h8300_branch {} {
48
    set testname "branch.s: h8300 branch tests"
49
    set x 0
50
 
51
    gas_start "branch-coff.s" "-al"
52
 
53
    # Check each instruction bit pattern to verify it got
54
    # assembled correctly.
55
    while 1 {
56
        expect {
57
            -re " +\[0-9\]+ 0000 5500\[^\n\]*\n"   { set x [expr $x+1] }
58
            -re " +\[0-9\]+ 0002 5A000000\[^\n\]*\n"   { set x [expr $x+1] }
59
            -re " +\[0-9\]+ 0006 5900\[^\n\]*\n"   { set x [expr $x+1] }
60
            -re " +\[0-9\]+ 0008 5B00\[^\n\]*\n"   { set x [expr $x+1] }
61
            -re " +\[0-9\]+ 000a 5E000000\[^\n\]*\n"   { set x [expr $x+1] }
62
            -re " +\[0-9\]+ 000e 5D00\[^\n\]*\n"   { set x [expr $x+1] }
63
            -re " +\[0-9\]+ 0010 5F00\[^\n\]*\n"   { set x [expr $x+1] }
64
            timeout                             { perror "timeout\n; break }
65
            eof                                 { break }
66
        }
67
    }
68
 
69
    # This was intended to do any cleanup necessary.  It kinda looks like it
70
    # isn't needed, but just in case, please keep it in for now.
71
    gas_finish
72
 
73
    # Did we find what we were looking for?  If not, flunk it.
74
    if [expr $x == 7] then { pass $testname } else { fail $testname }
75
}
76
 
77
proc do_h8300h_cbranch {} {
78
    set testname "cbranchh.s: h8300h conditional branch tests"
79
    set x 0
80
 
81
    gas_start "cbranchh.s" "-al"
82
 
83
    # Check each instruction bit pattern to verify it got
84
    # assembled correctly.
85
    while 1 {
86
        expect {
87
            -re " +\[0-9\]+ 0000 4000\[^\n\]*\n"   { set x [expr $x+1] }
88
            -re " +\[0-9\]+ 0002 4000\[^\n\]*\n"   { set x [expr $x+1] }
89
            -re " +\[0-9\]+ 0004 4100\[^\n\]*\n"   { set x [expr $x+1] }
90
            -re " +\[0-9\]+ 0006 4100\[^\n\]*\n"   { set x [expr $x+1] }
91
            -re " +\[0-9\]+ 0008 4200\[^\n\]*\n"   { set x [expr $x+1] }
92
            -re " +\[0-9\]+ 000a 4300\[^\n\]*\n"   { set x [expr $x+1] }
93
            -re " +\[0-9\]+ 000c 4400\[^\n\]*\n"   { set x [expr $x+1] }
94
            -re " +\[0-9\]+ 000e 4400\[^\n\]*\n"   { set x [expr $x+1] }
95
            -re " +\[0-9\]+ 0010 4500\[^\n\]*\n"   { set x [expr $x+1] }
96
            -re " +\[0-9\]+ 0012 4500\[^\n\]*\n"   { set x [expr $x+1] }
97
            -re " +\[0-9\]+ 0014 4600\[^\n\]*\n"   { set x [expr $x+1] }
98
            -re " +\[0-9\]+ 0016 4700\[^\n\]*\n"   { set x [expr $x+1] }
99
            -re " +\[0-9\]+ 0018 4800\[^\n\]*\n"   { set x [expr $x+1] }
100
            -re " +\[0-9\]+ 001a 4900\[^\n\]*\n"   { set x [expr $x+1] }
101
            -re " +\[0-9\]+ 001c 4A00\[^\n\]*\n"   { set x [expr $x+1] }
102
            -re " +\[0-9\]+ 001e 4B00\[^\n\]*\n"   { set x [expr $x+1] }
103
            -re " +\[0-9\]+ 0020 4C00\[^\n\]*\n"   { set x [expr $x+1] }
104
            -re " +\[0-9\]+ 0022 4D00\[^\n\]*\n"   { set x [expr $x+1] }
105
            -re " +\[0-9\]+ 0024 4E00\[^\n\]*\n"   { set x [expr $x+1] }
106
            -re " +\[0-9\]+ 0026 4F00\[^\n\]*\n"   { set x [expr $x+1] }
107
            -re " +\[0-9\]+ 0028 58000000\[^\n\]*\n"   { set x [expr $x+1] }
108
            -re " +\[0-9\]+ 002c 58000000\[^\n\]*\n"   { set x [expr $x+1] }
109
            -re " +\[0-9\]+ 0030 58100000\[^\n\]*\n"   { set x [expr $x+1] }
110
            -re " +\[0-9\]+ 0034 58100000\[^\n\]*\n"   { set x [expr $x+1] }
111
            -re " +\[0-9\]+ 0038 58200000\[^\n\]*\n"   { set x [expr $x+1] }
112
            -re " +\[0-9\]+ 003c 58300000\[^\n\]*\n"   { set x [expr $x+1] }
113
            -re " +\[0-9\]+ 0040 58400000\[^\n\]*\n"   { set x [expr $x+1] }
114
            -re " +\[0-9\]+ 0044 58400000\[^\n\]*\n"   { set x [expr $x+1] }
115
            -re " +\[0-9\]+ 0048 58500000\[^\n\]*\n"   { set x [expr $x+1] }
116
            -re " +\[0-9\]+ 004c 58500000\[^\n\]*\n"   { set x [expr $x+1] }
117
            -re " +\[0-9\]+ 0050 58600000\[^\n\]*\n"   { set x [expr $x+1] }
118
            -re " +\[0-9\]+ 0054 58700000\[^\n\]*\n"   { set x [expr $x+1] }
119
            -re " +\[0-9\]+ 0058 58800000\[^\n\]*\n"   { set x [expr $x+1] }
120
            -re " +\[0-9\]+ 005c 58900000\[^\n\]*\n"   { set x [expr $x+1] }
121
            -re " +\[0-9\]+ 0060 58A00000\[^\n\]*\n"   { set x [expr $x+1] }
122
            -re " +\[0-9\]+ 0064 58B00000\[^\n\]*\n"   { set x [expr $x+1] }
123
            -re " +\[0-9\]+ 0068 58C00000\[^\n\]*\n"   { set x [expr $x+1] }
124
            -re " +\[0-9\]+ 006c 58D00000\[^\n\]*\n"   { set x [expr $x+1] }
125
            -re " +\[0-9\]+ 0070 58E00000\[^\n\]*\n"   { set x [expr $x+1] }
126
            -re " +\[0-9\]+ 0074 58F00000\[^\n\]*\n"   { set x [expr $x+1] }
127
            timeout                             { perror "timeout\n; break }
128
            eof                                 { break }
129
        }
130
    }
131
 
132
    # This was intended to do any cleanup necessary.  It kinda looks like it
133
    # isn't needed, but just in case, please keep it in for now.
134
    gas_finish
135
 
136
    # Did we find what we were looking for?  If not, flunk it.
137
    if [expr $x == 40] then { pass $testname } else { fail $testname }
138
}
139
 
140
proc do_h8300h_branch {} {
141
    set testname "branchh.s: h8300h branch tests"
142
    set x 0
143
 
144
    gas_start "branchh-coff.s" "-al"
145
 
146
    # Check each instruction bit pattern to verify it got
147
    # assembled correctly.
148
    while 1 {
149
        expect {
150
            -re " +\[0-9\]+ 0000 5500\[^\n\]*\n"   { set x [expr $x+1] }
151
            -re " +\[0-9\]+ 0002 5C000000\[^\n\]*\n"   { set x [expr $x+1] }
152
            -re " +\[0-9\]+ 0006 5A000000\[^\n\]*\n"   { set x [expr $x+1] }
153
            -re " +\[0-9\]+ 000a 5900\[^\n\]*\n"   { set x [expr $x+1] }
154
            -re " +\[0-9\]+ 000c 5B00\[^\n\]*\n"   { set x [expr $x+1] }
155
            -re " +\[0-9\]+ 000e 5E000000\[^\n\]*\n"   { set x [expr $x+1] }
156
            -re " +\[0-9\]+ 0012 5D00\[^\n\]*\n"   { set x [expr $x+1] }
157
            -re " +\[0-9\]+ 0014 5F00\[^\n\]*\n"   { set x [expr $x+1] }
158
            timeout                             { perror "timeout\n; break }
159
            eof                                 { break }
160
        }
161
    }
162
 
163
    # This was intended to do any cleanup necessary.  It kinda looks like it
164
    # isn't needed, but just in case, please keep it in for now.
165
    gas_finish
166
 
167
    # Did we find what we were looking for?  If not, flunk it.
168
    if [expr $x == 8] then { pass $testname } else { fail $testname }
169
}
170
 
171
proc do_h8300s_cbranch {} {
172
    set testname "cbranchs.s: h8300s conditional branch tests"
173
    set x 0
174
 
175
    gas_start "cbranchs.s" "-al"
176
 
177
    # Check each instruction bit pattern to verify it got
178
    # assembled correctly.
179
    while 1 {
180
        expect {
181
            -re " +\[0-9\]+ 0000 4000\[^\n\]*\n"   { set x [expr $x+1] }
182
            -re " +\[0-9\]+ 0002 4000\[^\n\]*\n"   { set x [expr $x+1] }
183
            -re " +\[0-9\]+ 0004 4100\[^\n\]*\n"   { set x [expr $x+1] }
184
            -re " +\[0-9\]+ 0006 4100\[^\n\]*\n"   { set x [expr $x+1] }
185
            -re " +\[0-9\]+ 0008 4200\[^\n\]*\n"   { set x [expr $x+1] }
186
            -re " +\[0-9\]+ 000a 4300\[^\n\]*\n"   { set x [expr $x+1] }
187
            -re " +\[0-9\]+ 000c 4400\[^\n\]*\n"   { set x [expr $x+1] }
188
            -re " +\[0-9\]+ 000e 4400\[^\n\]*\n"   { set x [expr $x+1] }
189
            -re " +\[0-9\]+ 0010 4500\[^\n\]*\n"   { set x [expr $x+1] }
190
            -re " +\[0-9\]+ 0012 4500\[^\n\]*\n"   { set x [expr $x+1] }
191
            -re " +\[0-9\]+ 0014 4600\[^\n\]*\n"   { set x [expr $x+1] }
192
            -re " +\[0-9\]+ 0016 4700\[^\n\]*\n"   { set x [expr $x+1] }
193
            -re " +\[0-9\]+ 0018 4800\[^\n\]*\n"   { set x [expr $x+1] }
194
            -re " +\[0-9\]+ 001a 4900\[^\n\]*\n"   { set x [expr $x+1] }
195
            -re " +\[0-9\]+ 001c 4A00\[^\n\]*\n"   { set x [expr $x+1] }
196
            -re " +\[0-9\]+ 001e 4B00\[^\n\]*\n"   { set x [expr $x+1] }
197
            -re " +\[0-9\]+ 0020 4C00\[^\n\]*\n"   { set x [expr $x+1] }
198
            -re " +\[0-9\]+ 0022 4D00\[^\n\]*\n"   { set x [expr $x+1] }
199
            -re " +\[0-9\]+ 0024 4E00\[^\n\]*\n"   { set x [expr $x+1] }
200
            -re " +\[0-9\]+ 0026 4F00\[^\n\]*\n"   { set x [expr $x+1] }
201
            -re " +\[0-9\]+ 0028 58000000\[^\n\]*\n"   { set x [expr $x+1] }
202
            -re " +\[0-9\]+ 002c 58000000\[^\n\]*\n"   { set x [expr $x+1] }
203
            -re " +\[0-9\]+ 0030 58100000\[^\n\]*\n"   { set x [expr $x+1] }
204
            -re " +\[0-9\]+ 0034 58100000\[^\n\]*\n"   { set x [expr $x+1] }
205
            -re " +\[0-9\]+ 0038 58200000\[^\n\]*\n"   { set x [expr $x+1] }
206
            -re " +\[0-9\]+ 003c 58300000\[^\n\]*\n"   { set x [expr $x+1] }
207
            -re " +\[0-9\]+ 0040 58400000\[^\n\]*\n"   { set x [expr $x+1] }
208
            -re " +\[0-9\]+ 0044 58400000\[^\n\]*\n"   { set x [expr $x+1] }
209
            -re " +\[0-9\]+ 0048 58500000\[^\n\]*\n"   { set x [expr $x+1] }
210
            -re " +\[0-9\]+ 004c 58500000\[^\n\]*\n"   { set x [expr $x+1] }
211
            -re " +\[0-9\]+ 0050 58600000\[^\n\]*\n"   { set x [expr $x+1] }
212
            -re " +\[0-9\]+ 0054 58700000\[^\n\]*\n"   { set x [expr $x+1] }
213
            -re " +\[0-9\]+ 0058 58800000\[^\n\]*\n"   { set x [expr $x+1] }
214
            -re " +\[0-9\]+ 005c 58900000\[^\n\]*\n"   { set x [expr $x+1] }
215
            -re " +\[0-9\]+ 0060 58A00000\[^\n\]*\n"   { set x [expr $x+1] }
216
            -re " +\[0-9\]+ 0064 58B00000\[^\n\]*\n"   { set x [expr $x+1] }
217
            -re " +\[0-9\]+ 0068 58C00000\[^\n\]*\n"   { set x [expr $x+1] }
218
            -re " +\[0-9\]+ 006c 58D00000\[^\n\]*\n"   { set x [expr $x+1] }
219
            -re " +\[0-9\]+ 0070 58E00000\[^\n\]*\n"   { set x [expr $x+1] }
220
            -re " +\[0-9\]+ 0074 58F00000\[^\n\]*\n"   { set x [expr $x+1] }
221
            timeout                             { perror "timeout\n; break }
222
            eof                                 { break }
223
        }
224
    }
225
 
226
    # This was intended to do any cleanup necessary.  It kinda looks like it
227
    # isn't needed, but just in case, please keep it in for now.
228
    gas_finish
229
 
230
    # Did we find what we were looking for?  If not, flunk it.
231
    if [expr $x == 40] then { pass $testname } else { fail $testname }
232
}
233
 
234
proc do_h8300s_branch {} {
235
    set testname "branchs.s: h8300s branch tests"
236
    set x 0
237
 
238
    gas_start "branchs-coff.s" "-al"
239
 
240
    # Check each instruction bit pattern to verify it got
241
    # assembled correctly.
242
    while 1 {
243
        expect {
244
            -re " +\[0-9\]+ 0000 5500\[^\n\]*\n"   { set x [expr $x+1] }
245
            -re " +\[0-9\]+ 0002 5C000000\[^\n\]*\n"   { set x [expr $x+1] }
246
            -re " +\[0-9\]+ 0006 5A000000\[^\n\]*\n"   { set x [expr $x+1] }
247
            -re " +\[0-9\]+ 000a 5900\[^\n\]*\n"   { set x [expr $x+1] }
248
            -re " +\[0-9\]+ 000c 5B00\[^\n\]*\n"   { set x [expr $x+1] }
249
            -re " +\[0-9\]+ 000e 5E000000\[^\n\]*\n"   { set x [expr $x+1] }
250
            -re " +\[0-9\]+ 0012 5D00\[^\n\]*\n"   { set x [expr $x+1] }
251
            -re " +\[0-9\]+ 0014 5F00\[^\n\]*\n"   { set x [expr $x+1] }
252
            timeout                             { perror "timeout\n; break }
253
            eof                                 { break }
254
        }
255
    }
256
 
257
    # This was intended to do any cleanup necessary.  It kinda looks like it
258
    # isn't needed, but just in case, please keep it in for now.
259
    gas_finish
260
 
261
    # Did we find what we were looking for?  If not, flunk it.
262
    if [expr $x == 8] then { pass $testname } else { fail $testname }
263
}
264
 
265
if {   [istarget h8300*-*-coff]
266
    || [istarget h8300*-*-hms*]
267
    || [istarget h8300*-*-rtemscoff*] } then {
268
 
269
    # Test the basic h8300 instruction parser
270
    do_h8300_cbranch
271
    do_h8300_branch
272
 
273
    # Now test the h8300h instruction parser
274
    do_h8300h_cbranch
275
    do_h8300h_branch
276
 
277
    # Now test the h8300s instruction parser
278
    do_h8300s_cbranch
279
    do_h8300s_branch
280
 
281
    # Now some random tests
282
    run_dump_test "ffxx1-coff"
283
}

powered by: WebSVN 2.1.0

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