OSDN Git Service

Copyright year update in most files of the GDB Project.
[pf3gnuchains/pf3gnuchains4x.git] / gdb / testsuite / gdb.disasm / hppa.exp
1
2 # Copyright 1992-1997, 2007-2012 Free Software Foundation, Inc.
3
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17 # This file was written by Jeff Law. (law@cs.utah.edu)
18
19 if $tracelevel then {
20         strace $tracelevel
21 }
22
23 if ![istarget "hppa*-*-*"] {
24     verbose "Tests ignored for all but hppa based targets."
25     return
26 }
27
28
29
30 set testfile "hppa"
31 set srcfile ${srcdir}/${subdir}/${testfile}.s
32 set binfile ${objdir}/${subdir}/${testfile}
33 set comp_output [gdb_compile "${srcfile}" "${binfile}" executable ""];
34 if  { $comp_output != "" } {
35     if [ regexp "Opcode not defined - DIAG" $comp_output] {
36         warning "HP assembler in use--skipping disasm tests"
37         return
38     } else {
39         perror "Couldn't compile ${srcfile}"
40         return -1
41     }
42 }
43
44 proc all_integer_memory_tests { } {
45     global gdb_prompt
46     global hex
47     global decimal
48
49     send_gdb "x/8i integer_memory_tests\n"
50     gdb_expect {
51         -re "
52 .*ldw 0\\(sr0,r4\\),r26.*
53 .*ldh 0\\(sr0,r4\\),r26.*
54 .*ldb 0\\(sr0,r4\\),r26.*
55 .*stw r26,0\\(sr0,r4\\).*
56 .*sth r26,0\\(sr0,r4\\).*
57 .*stb r26,0\\(sr0,r4\\).*
58 .*ldwm 0\\(sr0,r4\\),r26.*
59 .*stwm r26,0\\(sr0,r4\\).*
60 .*$gdb_prompt $" { pass "integer_memory_tests" }
61         -re "$gdb_prompt $" { fail "integer_memory_tests" }
62         timeout { fail "(timeout) integer memory_tests" }
63     }
64
65     send_gdb "x/20i integer_indexing_load\n"
66     gdb_expect {
67         -re "
68 .*ldwx r5\\(sr0,r4\\),r26.*
69 .*ldwx,s r5\\(sr0,r4\\),r26.*
70 .*ldwx,m r5\\(sr0,r4\\),r26.*
71 .*ldwx,sm r5\\(sr0,r4\\),r26.*
72 .*ldhx r5\\(sr0,r4\\),r26.*
73 .*ldhx,s r5\\(sr0,r4\\),r26.*
74 .*ldhx,m r5\\(sr0,r4\\),r26.*
75 .*ldhx,sm r5\\(sr0,r4\\),r26.*
76 .*ldbx r5\\(sr0,r4\\),r26.*
77 .*ldbx,s r5\\(sr0,r4\\),r26.*
78 .*ldbx,m r5\\(sr0,r4\\),r26.*
79 .*ldbx,sm r5\\(sr0,r4\\),r26.*
80 .*ldwax r5\\(r4\\),r26.*
81 .*ldwax,s r5\\(r4\\),r26.*
82 .*ldwax,m r5\\(r4\\),r26.*
83 .*ldwax,sm r5\\(r4\\),r26.*
84 .*ldcwx r5\\(sr0,r4\\),r26.*
85 .*ldcwx,s r5\\(sr0,r4\\),r26.*
86 .*ldcwx,m r5\\(sr0,r4\\),r26.*
87 .*ldcwx,sm r5\\(sr0,r4\\),r26.*
88 .*$gdb_prompt $" { pass "integer_indexing_load" }
89         -re "$gdb_prompt $" { fail "integer_indexing_load" }
90         timeout { fail "(timeout) integer_indexing" }
91     }
92
93     send_gdb "x/15i integer_load_short_memory\n"
94     gdb_expect {
95         -re "
96 .*ldws 0\\(sr0,r4\\),r26.*
97 .*ldws,mb 0\\(sr0,r4\\),r26.*
98 .*ldws,ma 0\\(sr0,r4\\),r26.*
99 .*ldhs 0\\(sr0,r4\\),r26.*
100 .*ldhs,mb 0\\(sr0,r4\\),r26.*
101 .*ldhs,ma 0\\(sr0,r4\\),r26.*
102 .*ldbs 0\\(sr0,r4\\),r26.*
103 .*ldbs,mb 0\\(sr0,r4\\),r26.*
104 .*ldbs,ma 0\\(sr0,r4\\),r26.*
105 .*ldwas 0\\(r4\\),r26.*
106 .*ldwas,mb 0\\(r4\\),r26.*
107 .*ldwas,ma 0\\(r4\\),r26.*
108 .*ldcws 0\\(sr0,r4\\),r26.*
109 .*ldcws,mb 0\\(sr0,r4\\),r26.*
110 .*ldcws,ma 0\\(sr0,r4\\),r26.*
111 .*$gdb_prompt $" { pass "integer_load_short_memory" }
112         -re "$gdb_prompt $" { fail "integer_load_short_memory" }
113         timeout { fail "(timeout) integer_load_short_memory " }
114     }
115
116
117     send_gdb "x/17i integer_store_short_memory\n"
118     gdb_expect {
119         -re "
120 .*stws r26,0\\(sr0,r4\\).*
121 .*stws,mb r26,0\\(sr0,r4\\).*
122 .*stws,ma r26,0\\(sr0,r4\\).*
123 .*sths r26,0\\(sr0,r4\\).*
124 .*sths,mb r26,0\\(sr0,r4\\).*
125 .*sths,ma r26,0\\(sr0,r4\\).*
126 .*stbs r26,0\\(sr0,r4\\).*
127 .*stbs,mb r26,0\\(sr0,r4\\).*
128 .*stbs,ma r26,0\\(sr0,r4\\).*
129 .*stwas r26,0\\(r4\\).*
130 .*stwas,mb r26,0\\(r4\\).*
131 .*stwas,ma r26,0\\(r4\\).*
132 .*stbys r26,0\\(sr0,r4\\).*
133 .*stbys r26,0\\(sr0,r4\\).*
134 .*stbys,e r26,0\\(sr0,r4\\).*
135 .*stbys,b,m r26,0\\(sr0,r4\\).*
136 .*stbys,e,m r26,0\\(sr0,r4\\).*
137 .*$gdb_prompt $" { pass "integer_store_short_memory" }
138         -re "$gdb_prompt $" { fail "integer_store_short_memory" }
139         timeout { fail "(timeout) integer_short_memory " }
140     }
141 }
142
143 proc all_immediate_tests { } {
144     global gdb_prompt
145     global hex
146     global decimal
147
148     send_gdb "x/3i immediate_tests\n"
149     gdb_expect {
150         -re "
151 .*ldo 5\\(r26\\),r26.*
152 .*ldil -21524800,r26.*
153 .*addil -21524800,r5.*
154 .*$gdb_prompt $" { pass "immedate_tests" }
155         -re "$gdb_prompt $" { fail "immedate_tests" }
156         timeout { fail "(timeout) immedate_tests " }
157     }
158 }
159
160 proc all_branch_tests { } {
161     global gdb_prompt
162     global hex
163     global decimal
164
165     send_gdb "x/10i branch_tests_1\n"
166     gdb_expect {
167         -re "
168 .*bl.*,rp.*
169 .*bl,n.*,rp.*
170 .*b.*
171 .*b,n.*
172 .*gate.*,rp.*
173 .*gate,n.*,rp.*
174 .*blr r4,rp.*
175 .*blr,n r4,rp.*
176 .*blr r4,r0.*
177 .*blr,n r4,r0.*
178 .*$gdb_prompt $" { pass "branch_tests_1" }
179         -re "$gdb_prompt $" { fail "branch_tests_1" }
180         timeout { fail "(timeout) branch_tests_1" }
181     }
182
183     send_gdb "x/6i branch_tests_2\n"
184     gdb_expect {
185         -re "
186 .*bv r0\\(rp\\).*
187 .*bv,n r0\\(rp\\).*
188 .*be 1234\\(sr1,rp\\).*
189 .*be,n 1234\\(sr1,rp\\).*
190 .*ble 1234\\(sr1,rp\\).*
191 .*ble,n 1234\\(sr1,rp\\).*
192 .*$gdb_prompt $" { pass "branch_tests_2" }
193         -re "$gdb_prompt $" { fail "branch_tests_2" }
194         timeout { fail "(timeout) branch_tests_2" }
195     }
196
197
198     send_gdb "x/8i movb_tests\n"
199     gdb_expect {
200         -re "
201 .*movb r4,r26,.* <movb_tests>.*
202 .*movb,= r4,r26,.* <movb_tests>.*
203 .*movb,< r4,r26,.* <movb_tests>.*
204 .*movb,od r4,r26,.* <movb_tests>.*
205 .*movb,tr r4,r26,.* <movb_tests>.*
206 .*movb,<> r4,r26,.* <movb_tests>.*
207 .*movb,>= r4,r26,.* <movb_tests>.*
208 .*movb,ev r4,r26,.* <movb_tests>.*
209 .*$gdb_prompt $" { pass "movb_tests" }
210         -re "$gdb_prompt $" { fail "movb_tests" }
211         timeout { fail "(timeout) movb_tests " }
212     }
213
214     send_gdb "x/8i movb_nullified_tests\n"
215     gdb_expect {
216         -re "
217 .*movb,n.*r4,r26,.* <movb_tests>.*
218 .*movb,=,n.*r4,r26,.* <movb_tests>.*
219 .*movb,<,n.*r4,r26,.* <movb_tests>.*
220 .*movb,od,n.*r4,r26,.* <movb_tests>.*
221 .*movb,tr,n.*r4,r26,.* <movb_tests>.*
222 .*movb,<>,n.*r4,r26,.* <movb_tests>.*
223 .*movb,>=,n.*r4,r26,.* <movb_tests>.*
224 .*movb,ev,n.*r4,r26,.* <movb_tests>.*
225 .*$gdb_prompt $" { pass "movb_nullified_tests" }
226         -re "$gdb_prompt $" { fail "movb_nullified_tests" }
227         timeout { fail "(timeout) movb_nullified_tests " }
228     }
229
230     send_gdb "x/8i movib_tests\n"
231     gdb_expect {
232         -re "
233 .*movib 5,r26,.* <movib_tests>.*
234 .*movib,= 5,r26,.* <movib_tests>.*
235 .*movib,< 5,r26,.* <movib_tests>.*
236 .*movib,od 5,r26,.* <movib_tests>.*
237 .*movib,tr 5,r26,.* <movib_tests>.*
238 .*movib,<> 5,r26,.* <movib_tests>.*
239 .*movib,>= 5,r26,.* <movib_tests>.*
240 .*movib,ev 5,r26,.* <movib_tests>.*
241 .*$gdb_prompt $" { pass "movib_tests" }
242         -re "$gdb_prompt $" { fail "movib_tests" }
243         timeout { fail "(timeout) movib_tests " }
244     }
245
246     send_gdb "x/8i movib_nullified_tests\n"
247     gdb_expect {
248         -re "
249 .*movib,n.*5,r26,.* <movib_tests>.*
250 .*movib,=,n.*5,r26,.* <movib_tests>.*
251 .*movib,<,n.*5,r26,.* <movib_tests>.*
252 .*movib,od,n.*5,r26,.* <movib_tests>.*
253 .*movib,tr,n.*5,r26,.* <movib_tests>.*
254 .*movib,<>,n.*5,r26,.* <movib_tests>.*
255 .*movib,>=,n.*5,r26,.* <movib_tests>.*
256 .*movib,ev,n.*5,r26,.* <movib_tests>.*
257 .*$gdb_prompt $" { pass "movib_nullified_tests" }
258         -re "$gdb_prompt $" { fail "movib_nullified_tests" }
259         timeout { fail "(timeout) movib_nullified_tests " }
260     }
261
262     send_gdb "x/8i comb_tests_1\n"
263     gdb_expect {
264         -re "
265 .*comb r0,r4,.* <comb_tests_1>.*
266 .*comb,= r0,r4,.* <comb_tests_1>.*
267 .*comb,< r0,r4,.* <comb_tests_1>.*
268 .*comb,<= r0,r4,.* <comb_tests_1>.*
269 .*comb,<< r0,r4,.* <comb_tests_1>.*
270 .*comb,<<= r0,r4,.* <comb_tests_1>.*
271 .*comb,sv r0,r4,.* <comb_tests_1>.*
272 .*comb,od r0,r4,.* <comb_tests_1>.*
273 .*$gdb_prompt $" { pass "comb_tests_1" }
274         -re "$gdb_prompt $" { fail "comb_tests_1" }
275         timeout { fail "(timeout) comb_tests_1" }
276     }
277
278     send_gdb "x/8i comb_tests_2\n"
279     gdb_expect {
280         -re "
281 .*combf r0,r4,.* <comb_tests_2>.*
282 .*combf,= r0,r4,.* <comb_tests_2>.*
283 .*combf,< r0,r4,.* <comb_tests_2>.*
284 .*combf,<= r0,r4,.* <comb_tests_2>.*
285 .*combf,<< r0,r4,.* <comb_tests_2>.*
286 .*combf,<<= r0,r4,.* <comb_tests_2>.*
287 .*combf,sv r0,r4,.* <comb_tests_2>.*
288 .*combf,od r0,r4,.* <comb_tests_2>.*
289 .*$gdb_prompt $" { pass "comb_tests_2" }
290         -re "$gdb_prompt $" { fail "comb_tests_2" }
291         timeout { fail "(timeout) comb_tests_2" }
292     }
293
294     send_gdb "x/8i comb_nullified_tests_1\n"
295     gdb_expect {
296         -re "
297 .*comb,n r0,r4,.* <comb_tests_1>.*
298 .*comb,=,n r0,r4,.* <comb_tests_1>.*
299 .*comb,<,n r0,r4,.* <comb_tests_1>.*
300 .*comb,<=,n r0,r4,.* <comb_tests_1>.*
301 .*comb,<<,n r0,r4,.* <comb_tests_1>.*
302 .*comb,<<=,n r0,r4,.* <comb_tests_1>.*
303 .*comb,sv,n r0,r4,.* <comb_tests_1>.*
304 .*comb,od,n r0,r4,.* <comb_tests_1>.*
305 .*$gdb_prompt $" { pass "comb_nullified_tests_1" }
306         -re "$gdb_prompt $" { fail "comb_nullified_tests_1" }
307         timeout { fail "(timeout) comb_nullified_tests_1" }
308     }
309
310     send_gdb "x/8i comb_nullified_tests_2\n"
311     gdb_expect {
312         -re "
313 .*combf,n r0,r4,.* <comb_tests_2>.*
314 .*combf,=,n r0,r4,.* <comb_tests_2>.*
315 .*combf,<,n r0,r4,.* <comb_tests_2>.*
316 .*combf,<=,n r0,r4,.* <comb_tests_2>.*
317 .*combf,<<,n r0,r4,.* <comb_tests_2>.*
318 .*combf,<<=,n r0,r4,.* <comb_tests_2>.*
319 .*combf,sv,n r0,r4,.* <comb_tests_2>.*
320 .*combf,od,n r0,r4,.* <comb_tests_2>.*
321 .*$gdb_prompt $" { pass "comb_nullified_tests_2" }
322         -re "$gdb_prompt $" { fail "comb_nullified_tests_2" }
323         timeout { fail "(timeout) comb_nullified_tests_2" }
324     }
325
326     send_gdb "x/8i comib_tests_1\n"
327     gdb_expect {
328         -re "
329 .*comib 0,r4,.* <comib_tests_1>.*
330 .*comib,= 0,r4,.* <comib_tests_1>.*
331 .*comib,< 0,r4,.* <comib_tests_1>.*
332 .*comib,<= 0,r4,.* <comib_tests_1>.*
333 .*comib,<< 0,r4,.* <comib_tests_1>.*
334 .*comib,<<= 0,r4,.* <comib_tests_1>.*
335 .*comib,sv 0,r4,.* <comib_tests_1>.*
336 .*comib,od 0,r4,.* <comib_tests_1>.*
337 .*$gdb_prompt $" { pass "comib_tests_1" }
338         -re "$gdb_prompt $" { fail "comib_tests_1" }
339         timeout { fail "(timeout) comib_tests_1" }
340     }
341
342     send_gdb "x/8i comib_tests_2\n"
343     gdb_expect {
344         -re "
345 .*comibf 0,r4,.* <comib_tests_2>.*
346 .*comibf,= 0,r4,.* <comib_tests_2>.*
347 .*comibf,< 0,r4,.* <comib_tests_2>.*
348 .*comibf,<= 0,r4,.* <comib_tests_2>.*
349 .*comibf,<< 0,r4,.* <comib_tests_2>.*
350 .*comibf,<<= 0,r4,.* <comib_tests_2>.*
351 .*comibf,sv 0,r4,.* <comib_tests_2>.*
352 .*comibf,od 0,r4,.* <comib_tests_2>.*
353 .*$gdb_prompt $" { pass "comib_tests_2" }
354         -re "$gdb_prompt $" { fail "comib_tests_2" }
355         timeout { fail "(timeout) comib_tests_2" }
356     }
357
358     send_gdb "x/8i comib_nullified_tests_1\n"
359     gdb_expect {
360         -re "
361 .*comib,n 0,r4,.* <comib_tests_1>.*
362 .*comib,=,n 0,r4,.* <comib_tests_1>.*
363 .*comib,<,n 0,r4,.* <comib_tests_1>.*
364 .*comib,<=,n 0,r4,.* <comib_tests_1>.*
365 .*comib,<<,n 0,r4,.* <comib_tests_1>.*
366 .*comib,<<=,n 0,r4,.* <comib_tests_1>.*
367 .*comib,sv,n 0,r4,.* <comib_tests_1>.*
368 .*comib,od,n 0,r4,.* <comib_tests_1>.*
369 .*$gdb_prompt $" { pass "comib_nullified_tests_1" }
370         -re "$gdb_prompt $" { fail "comib_nullified_tests_1" }
371         timeout { fail "(timeout) comib_nullified_tests_1" }
372     }
373
374     send_gdb "x/8i comib_nullified_tests_2\n"
375     gdb_expect {
376         -re "
377 .*comibf,n 0,r4,.* <comib_tests_2>.*
378 .*comibf,=,n 0,r4,.* <comib_tests_2>.*
379 .*comibf,<,n 0,r4,.* <comib_tests_2>.*
380 .*comibf,<=,n 0,r4,.* <comib_tests_2>.*
381 .*comibf,<<,n 0,r4,.* <comib_tests_2>.*
382 .*comibf,<<=,n 0,r4,.* <comib_tests_2>.*
383 .*comibf,sv,n 0,r4,.* <comib_tests_2>.*
384 .*comibf,od,n 0,r4,.* <comib_tests_2>.*
385 .*$gdb_prompt $" { pass "comib_nullified_tests_2" }
386         -re "$gdb_prompt $" { fail "comib_nullified_tests_2" }
387         timeout { fail "(timeout) comib_nullified_tests_2" }
388     }
389
390     send_gdb "x/8i addb_tests_1\n"
391     gdb_expect {
392         -re "
393 .*addb r1,r4,.* <addb_tests_1>.*
394 .*addb,= r1,r4,.* <addb_tests_1>.*
395 .*addb,< r1,r4,.* <addb_tests_1>.*
396 .*addb,<= r1,r4,.* <addb_tests_1>.*
397 .*addb,nuv r1,r4,.* <addb_tests_1>.*
398 .*addb,znv r1,r4,.* <addb_tests_1>.*
399 .*addb,sv r1,r4,.* <addb_tests_1>.*
400 .*addb,od r1,r4,.* <addb_tests_1>.*
401 .*$gdb_prompt $" { pass "addb_tests_1" }
402         -re "$gdb_prompt $" { fail "addb_tests_1" }
403         timeout { fail "(timeout) addb_tests_1" }
404     }
405
406     send_gdb "x/8i addb_tests_2\n"
407     gdb_expect {
408         -re "
409 .*addbf r1,r4,.* <addb_tests_2>.*
410 .*addbf,= r1,r4,.* <addb_tests_2>.*
411 .*addbf,< r1,r4,.* <addb_tests_2>.*
412 .*addbf,<= r1,r4,.* <addb_tests_2>.*
413 .*addbf,nuv r1,r4,.* <addb_tests_2>.*
414 .*addbf,znv r1,r4,.* <addb_tests_2>.*
415 .*addbf,sv r1,r4,.* <addb_tests_2>.*
416 .*addbf,od r1,r4,.* <addb_tests_2>.*
417 .*$gdb_prompt $" { pass "addb_tests_2" }
418         -re "$gdb_prompt $" { fail "addb_tests_2" }
419         timeout { fail "(timeout) addb_tests_2" }
420     }
421
422     send_gdb "x/8i addb_nullified_tests_1\n"
423     gdb_expect {
424         -re "
425 .*addb,n r1,r4,.* <addb_tests_1>.*
426 .*addb,=,n r1,r4,.* <addb_tests_1>.*
427 .*addb,<,n r1,r4,.* <addb_tests_1>.*
428 .*addb,<=,n r1,r4,.* <addb_tests_1>.*
429 .*addb,nuv,n r1,r4,.* <addb_tests_1>.*
430 .*addb,znv,n r1,r4,.* <addb_tests_1>.*
431 .*addb,sv,n r1,r4,.* <addb_tests_1>.*
432 .*addb,od,n r1,r4,.* <addb_tests_1>.*
433 .*$gdb_prompt $" { pass "addb_nullified_tests_1" }
434         -re "$gdb_prompt $" { fail "addb_nullified_tests_1" }
435         timeout { fail "(timeout) addb_nullified_tests_1" }
436     }
437
438     send_gdb "x/8i addb_nullified_tests_2\n"
439     gdb_expect {
440         -re "
441 .*addbf,n r1,r4,.* <addb_tests_2>.*
442 .*addbf,=,n r1,r4,.* <addb_tests_2>.*
443 .*addbf,<,n r1,r4,.* <addb_tests_2>.*
444 .*addbf,<=,n r1,r4,.* <addb_tests_2>.*
445 .*addbf,nuv,n r1,r4,.* <addb_tests_2>.*
446 .*addbf,znv,n r1,r4,.* <addb_tests_2>.*
447 .*addbf,sv,n r1,r4,.* <addb_tests_2>.*
448 .*addbf,od,n r1,r4,.* <addb_tests_2>.*
449 .*$gdb_prompt $" { pass "addb_nullified_tests_2" }
450         -re "$gdb_prompt $" { fail "addb_nullified_tests_2" }
451         timeout { fail "(timeout) addb_nullified_tests_2" }
452     }
453
454     send_gdb "x/8i addib_tests_1\n"
455     gdb_expect {
456         -re "
457 .*addib -1,r4,.* <addib_tests_1>.*
458 .*addib,= -1,r4,.* <addib_tests_1>.*
459 .*addib,< -1,r4,.* <addib_tests_1>.*
460 .*addib,<= -1,r4,.* <addib_tests_1>.*
461 .*addib,nuv -1,r4,.* <addib_tests_1>.*
462 .*addib,znv -1,r4,.* <addib_tests_1>.*
463 .*addib,sv -1,r4,.* <addib_tests_1>.*
464 .*addib,od -1,r4,.* <addib_tests_1>.*
465 .*$gdb_prompt $" { pass "addib_tests_1" }
466         -re "$gdb_prompt $" { fail "addib_tests_1" }
467         timeout { fail "(timeout) addib_tests_1" }
468     }
469
470     send_gdb "x/8i addib_tests_2\n"
471     gdb_expect {
472         -re "
473 .*addibf -1,r4,.* <addib_tests_2>.*
474 .*addibf,= -1,r4,.* <addib_tests_2>.*
475 .*addibf,< -1,r4,.* <addib_tests_2>.*
476 .*addibf,<= -1,r4,.* <addib_tests_2>.*
477 .*addibf,nuv -1,r4,.* <addib_tests_2>.*
478 .*addibf,znv -1,r4,.* <addib_tests_2>.*
479 .*addibf,sv -1,r4,.* <addib_tests_2>.*
480 .*addibf,od -1,r4,.* <addib_tests_2>.*
481 .*$gdb_prompt $" { pass "addib_tests_2" }
482         -re "$gdb_prompt $" { fail "addib_tests_2" }
483         timeout { fail "(timeout) addib_tests_2" }
484     }
485
486     send_gdb "x/8i addib_nullified_tests_1\n"
487     gdb_expect {
488         -re "
489 .*addib,n -1,r4,.* <addib_tests_1>.*
490 .*addib,=,n -1,r4,.* <addib_tests_1>.*
491 .*addib,<,n -1,r4,.* <addib_tests_1>.*
492 .*addib,<=,n -1,r4,.* <addib_tests_1>.*
493 .*addib,nuv,n -1,r4,.* <addib_tests_1>.*
494 .*addib,znv,n -1,r4,.* <addib_tests_1>.*
495 .*addib,sv,n -1,r4,.* <addib_tests_1>.*
496 .*addib,od,n -1,r4,.* <addib_tests_1>.*
497 .*$gdb_prompt $" { pass "addb_nullified_tests_1" }
498         -re "$gdb_prompt $" { fail "addb_nullified_tests_1" }
499         timeout { fail "(timeout) addb_nullified_tests_1" }
500     }
501
502     send_gdb "x/8i addib_nullified_tests_2\n"
503     gdb_expect {
504         -re "
505 .*addibf,n -1,r4,.* <addib_tests_2>.*
506 .*addibf,=,n -1,r4,.* <addib_tests_2>.*
507 .*addibf,<,n -1,r4,.* <addib_tests_2>.*
508 .*addibf,<=,n -1,r4,.* <addib_tests_2>.*
509 .*addibf,nuv,n -1,r4,.* <addib_tests_2>.*
510 .*addibf,znv,n -1,r4,.* <addib_tests_2>.*
511 .*addibf,sv,n -1,r4,.* <addib_tests_2>.*
512 .*addibf,od,n -1,r4,.* <addib_tests_2>.*
513 .*$gdb_prompt $" { pass "addb_nullified_tests_2" }
514         -re "$gdb_prompt $" { fail "addb_nullified_tests_2" }
515         timeout { fail "(timeout) addb_nullified_tests_2" }
516     }
517
518     send_gdb "x/8i bb_tests\n"
519     gdb_expect {
520         -re "
521 .*bvb,< r4,.* <bb_tests>.*
522 .*bvb,>= r4,.* <bb_tests>.*
523 .*bvb,<,n r4,.* <bb_tests>.*
524 .*bvb,>=,n r4,.* <bb_tests>.*
525 .*bb,< r4,5,.* <bb_tests>.*
526 .*bb,>= r4,5,.* <bb_tests>.*
527 .*bb,<,n r4,5,.* <bb_tests>.*
528 .*bb,>=,n r4,5,.* <bb_tests>.*
529 .*$gdb_prompt $" { pass "bb_tests" }
530         -re "$gdb_prompt $" { fail "bb_tests" }
531         timeout { fail "(timeout) bb_tests " }
532     }
533 }
534
535 proc all_integer_computational_tests { } {
536     global gdb_prompt
537     global hex
538     global decimal
539
540     set add_insns [list {add} {addl} {addo} {addc} {addco} \
541                         {sh1add} {sh1addl} {sh1addo} \
542                         {sh2add} {sh2addl} {sh2addo} \
543                         {sh3add} {sh3addl} {sh3addo} ]
544
545     foreach i $add_insns {
546         send_gdb "x/16i $i"; send_gdb "_tests\n"
547         gdb_expect {
548             -re "
549 .*$i r4,r5,r6.*
550 .*$i,= r4,r5,r6.*
551 .*$i,< r4,r5,r6.*
552 .*$i,<= r4,r5,r6.*
553 .*$i,nuv r4,r5,r6.*
554 .*$i,znv r4,r5,r6.*
555 .*$i,sv r4,r5,r6.*
556 .*$i,od r4,r5,r6.*
557 .*$i,tr r4,r5,r6.*
558 .*$i,<> r4,r5,r6.*
559 .*$i,>= r4,r5,r6.*
560 .*$i,> r4,r5,r6.*
561 .*$i,uv r4,r5,r6.*
562 .*$i,vnz r4,r5,r6.*
563 .*$i,nsv r4,r5,r6.*
564 .*$i,ev r4,r5,r6.*
565 .*$gdb_prompt $" { pass "$i tests" }
566             -re "$gdb_prompt $" { fail "$i tests" }
567             timeout { fail "(timeout) $i tests" }
568         }
569     }
570
571     set sub_insns [list {sub} {subo} {subb} {subbo} {subt} {subto} \
572                         {ds} {comclr} ]
573
574     foreach i $sub_insns {
575         send_gdb "x/16i $i"; send_gdb "_tests\n"
576         gdb_expect {
577             -re "
578 .*$i r4,r5,r6.*
579 .*$i,= r4,r5,r6.*
580 .*$i,< r4,r5,r6.*
581 .*$i,<= r4,r5,r6.*
582 .*$i,<< r4,r5,r6.*
583 .*$i,<<= r4,r5,r6.*
584 .*$i,sv r4,r5,r6.*
585 .*$i,od r4,r5,r6.*
586 .*$i,tr r4,r5,r6.*
587 .*$i,<> r4,r5,r6.*
588 .*$i,>= r4,r5,r6.*
589 .*$i,> r4,r5,r6.*
590 .*$i,>>= r4,r5,r6.*
591 .*$i,>> r4,r5,r6.*
592 .*$i,nsv r4,r5,r6.*
593 .*$i,ev r4,r5,r6.*
594 .*$gdb_prompt $" { pass "$i tests" }
595             -re "$gdb_prompt $" { fail "$i tests" }
596             timeout { fail "(timeout) $i tests" }
597         }
598     }
599
600     set logical_insns [list {or} {xor} {and} {andcm} ]
601
602     foreach i $logical_insns {
603         send_gdb "x/10i $i"; send_gdb "_tests\n"
604         gdb_expect {
605             -re "
606 .*$i r4,r5,r6.*
607 .*$i,= r4,r5,r6.*
608 .*$i,< r4,r5,r6.*
609 .*$i,<= r4,r5,r6.*
610 .*$i,od r4,r5,r6.*
611 .*$i,tr r4,r5,r6.*
612 .*$i,<> r4,r5,r6.*
613 .*$i,>= r4,r5,r6.*
614 .*$i,> r4,r5,r6.*
615 .*$i,ev r4,r5,r6.*
616 .*$gdb_prompt $" { pass "$i tests" }
617             -re "$gdb_prompt $" { fail "$i tests" }
618             timeout { fail "(timeout) $i tests" }
619         }
620     }
621
622     set unit_insns1 [list {uxor} {uaddcm} {uaddcmt} ]
623
624     foreach i $unit_insns1 {
625         send_gdb "x/12i $i"; send_gdb "_tests\n"
626         gdb_expect {
627             -re "
628 .*$i r4,r5,r6.*
629 .*$i,sbz r4,r5,r6.*
630 .*$i,shz r4,r5,r6.*
631 .*$i,sdc r4,r5,r6.*
632 .*$i,sbc r4,r5,r6.*
633 .*$i,shc r4,r5,r6.*
634 .*$i,tr r4,r5,r6.*
635 .*$i,nbz r4,r5,r6.*
636 .*$i,nhz r4,r5,r6.*
637 .*$i,ndc r4,r5,r6.*
638 .*$i,nbc r4,r5,r6.*
639 .*$i,nhc r4,r5,r6.*
640 .*$gdb_prompt $" { pass "$i tests" }
641             -re "$gdb_prompt $" { fail "$i tests" }
642             timeout { fail "(timeout) $i tests" }
643         }
644     }
645
646     set unit_insns2 [list {dcor} {idcor} ]
647
648     foreach i $unit_insns2 {
649         send_gdb "x/12i $i"; send_gdb "_tests\n"
650         gdb_expect {
651             -re "
652 .*$i r4,r5.*
653 .*$i,sbz r4,r5.*
654 .*$i,shz r4,r5.*
655 .*$i,sdc r4,r5.*
656 .*$i,sbc r4,r5.*
657 .*$i,shc r4,r5.*
658 .*$i,tr r4,r5.*
659 .*$i,nbz r4,r5.*
660 .*$i,nhz r4,r5.*
661 .*$i,ndc r4,r5.*
662 .*$i,nbc r4,r5.*
663 .*$i,nhc r4,r5.*
664 .*$gdb_prompt $" { pass "$i tests" }
665             -re "$gdb_prompt $" { fail "$i tests" }
666             timeout { fail "(timeout) $i tests" }
667         }
668     }
669
670     set addi_insns [list {addi} {addio} {addit} {addito} ]
671
672     foreach i $addi_insns {
673         send_gdb "x/16i $i"; send_gdb "_tests\n"
674         gdb_expect {
675             -re "
676 .*$i 7b,r5,r6.*
677 .*$i,= 7b,r5,r6.*
678 .*$i,< 7b,r5,r6.*
679 .*$i,<= 7b,r5,r6.*
680 .*$i,nuv 7b,r5,r6.*
681 .*$i,znv 7b,r5,r6.*
682 .*$i,sv 7b,r5,r6.*
683 .*$i,od 7b,r5,r6.*
684 .*$i,tr 7b,r5,r6.*
685 .*$i,<> 7b,r5,r6.*
686 .*$i,>= 7b,r5,r6.*
687 .*$i,> 7b,r5,r6.*
688 .*$i,uv 7b,r5,r6.*
689 .*$i,vnz 7b,r5,r6.*
690 .*$i,nsv 7b,r5,r6.*
691 .*$i,ev 7b,r5,r6.*
692 .*$gdb_prompt $" { pass "$i tests" }
693             -re "$gdb_prompt $" { fail "$i tests" }
694             timeout { fail "(timeout) $i tests" }
695         }
696     }
697
698     set subi_insns [list {subi} {subio} {comiclr} ] 
699
700     foreach i $subi_insns {
701         send_gdb "x/16i $i"; send_gdb "_tests\n"
702         gdb_expect {
703             -re "
704 .*$i 7b,r5,r6.*
705 .*$i,= 7b,r5,r6.*
706 .*$i,< 7b,r5,r6.*
707 .*$i,<= 7b,r5,r6.*
708 .*$i,<< 7b,r5,r6.*
709 .*$i,<<= 7b,r5,r6.*
710 .*$i,sv 7b,r5,r6.*
711 .*$i,od 7b,r5,r6.*
712 .*$i,tr 7b,r5,r6.*
713 .*$i,<> 7b,r5,r6.*
714 .*$i,>= 7b,r5,r6.*
715 .*$i,> 7b,r5,r6.*
716 .*$i,>>= 7b,r5,r6.*
717 .*$i,>> 7b,r5,r6.*
718 .*$i,nsv 7b,r5,r6.*
719 .*$i,ev 7b,r5,r6.*
720 .*$gdb_prompt $" { pass "$i tests" }
721             -re "$gdb_prompt $" { fail "$i tests" }
722             timeout { fail "(timeout) $i tests" }
723         }
724     }
725
726     send_gdb "x/8i vshd_tests\n"
727     gdb_expect {
728         -re "
729 .*vshd r4,r5,r6.*
730 .*vshd,= r4,r5,r6.*
731 .*vshd,< r4,r5,r6.*
732 .*vshd,od r4,r5,r6.*
733 .*vshd,tr r4,r5,r6.*
734 .*vshd,<> r4,r5,r6.*
735 .*vshd,>= r4,r5,r6.*
736 .*vshd,ev r4,r5,r6.*
737 .*$gdb_prompt $" { pass "vshd tests" }
738             -re "$gdb_prompt $" { fail "vshd tests" }
739             timeout { fail "(timeout) "vshd tests" }
740         }
741
742     send_gdb "x/8i shd_tests\n"
743     gdb_expect {
744         -re "
745 .*shd r4,r5,5,r6.*
746 .*shd,= r4,r5,5,r6.*
747 .*shd,< r4,r5,5,r6.*
748 .*shd,od r4,r5,5,r6.*
749 .*shd,tr r4,r5,5,r6.*
750 .*shd,<> r4,r5,5,r6.*
751 .*shd,>= r4,r5,5,r6.*
752 .*shd,ev r4,r5,5,r6.*
753 .*$gdb_prompt $" { pass "shd tests" }
754             -re "$gdb_prompt $" { fail "shd tests" }
755             timeout { fail "(timeout) "shd tests" }
756         }
757
758     set extract_insns1 [list {extru} {extrs} {zdep} {dep} ] 
759
760     foreach i $extract_insns1 {
761         send_gdb "x/8i $i"; send_gdb "_tests\n"
762         gdb_expect {
763             -re "
764 .*$i r4,5,10,r6.*
765 .*$i,= r4,5,10,r6.*
766 .*$i,< r4,5,10,r6.*
767 .*$i,od r4,5,10,r6.*
768 .*$i,tr r4,5,10,r6.*
769 .*$i,<> r4,5,10,r6.*
770 .*$i,>= r4,5,10,r6.*
771 .*$i,ev r4,5,10,r6.*
772 .*$gdb_prompt $" { pass "$i tests" }
773             -re "$gdb_prompt $" { fail "$i tests" }
774             timeout { fail "(timeout) $i tests" }
775         }
776     }
777
778     set extract_insns2 [list {vextru} {vextrs} {zvdep} {vdep} ] 
779
780     foreach i $extract_insns2 {
781         send_gdb "x/8i $i"; send_gdb "_tests\n"
782         gdb_expect {
783             -re "
784 .*$i r4,5,r6.*
785 .*$i,= r4,5,r6.*
786 .*$i,< r4,5,r6.*
787 .*$i,od r4,5,r6.*
788 .*$i,tr r4,5,r6.*
789 .*$i,<> r4,5,r6.*
790 .*$i,>= r4,5,r6.*
791 .*$i,ev r4,5,r6.*
792 .*$gdb_prompt $" { pass "$i tests" }
793             -re "$gdb_prompt $" { fail "$i tests" }
794             timeout { fail "(timeout) $i tests" }
795         }
796     }
797
798     set extract_insns3 [list {vdepi} {zvdepi} ] 
799
800     foreach i $extract_insns3 {
801         send_gdb "x/8i $i"; send_gdb "_tests\n"
802         gdb_expect {
803             -re "
804 .*$i -1,5,r6.*
805 .*$i,= -1,5,r6.*
806 .*$i,< -1,5,r6.*
807 .*$i,od -1,5,r6.*
808 .*$i,tr -1,5,r6.*
809 .*$i,<> -1,5,r6.*
810 .*$i,>= -1,5,r6.*
811 .*$i,ev -1,5,r6.*
812 .*$gdb_prompt $" { pass "$i tests" }
813             -re "$gdb_prompt $" { fail "$i tests" }
814             timeout { fail "(timeout) $i tests" }
815         }
816     }
817
818     set extract_insns4 [list {depi} {zdepi} ] 
819
820     foreach i $extract_insns4 {
821         send_gdb "x/8i $i"; send_gdb "_tests\n"
822         gdb_expect {
823             -re "
824 .*$i -1,4,10,r6.*
825 .*$i,= -1,4,10,r6.*
826 .*$i,< -1,4,10,r6.*
827 .*$i,od -1,4,10,r6.*
828 .*$i,tr -1,4,10,r6.*
829 .*$i,<> -1,4,10,r6.*
830 .*$i,>= -1,4,10,r6.*
831 .*$i,ev -1,4,10,r6.*
832 .*$gdb_prompt $" { pass "$i tests" }
833             -re "$gdb_prompt $" { fail "$i tests" }
834             timeout { fail "(timeout) $i tests" }
835         }
836     }
837 }
838
839 proc all_system_control_tests { } {
840     global gdb_prompt
841     global hex
842     global decimal
843
844     send_gdb "x/14i system_control_tests\n"
845     gdb_expect {
846         -re "
847 .*break 5,c.*
848 .*rfi.*
849 .*rfir.*
850 .*ssm 5,r4.*
851 .*rsm 5,r4.*
852 .*mtsm r4.*
853 .*ldsid \\(sr0,r5\\),r4.*
854 .*mtsp r4,sr0.*
855 .*mtctl r4,ccr.*
856 .*mfsp sr0,r4.*
857 .*mfctl ccr,r4.*
858 .*sync.*
859 .*syncdma.*
860 .*diag 4d2.*
861 .*$gdb_prompt $" { pass "system_constrol_tests" }
862         -re "$gdb_prompt $" { fail "system_control_tests" }
863         timeout { file "(timeout) system_control_tests" }
864     }
865
866     send_gdb "x/4i probe_tests\n"
867     gdb_expect {
868         -re "
869 .*prober \\(sr0,r5\\),r6,r7.*
870 .*proberi \\(sr0,r5\\),1,r7.*
871 .*probew \\(sr0,r5\\),r6,r7.*
872 .*probewi \\(sr0,r5\\),1,r7.*
873 .*$gdb_prompt $" { pass "probe_tests" }
874         -re "$gdb_prompt $" { fail "probe_tests" }
875         timeout { file "(timeout) probe_tests" }
876     }
877
878     # lci uses the same bit pattern as lha, so accept lha.
879     send_gdb "x/5i lpa_tests\n"
880     gdb_expect {
881         -re "
882 .*lpa r4\\(sr0,r5\\),r6.*
883 .*lpa,m r4\\(sr0,r5\\),r6.*
884 .*lha r4\\(sr0,r5\\),r6.*
885 .*lha,m r4\\(sr0,r5\\),r6.*
886 .*lha r4\\(sr0,r5\\),r6.*
887 .*$gdb_prompt $" { pass "lpa_tests" }
888         -re "$gdb_prompt $" { fail "lpa_tests" }
889         timeout { file "(timeout) lpa_tests" }
890     }
891
892     send_gdb "x/18i purge_tests\n"
893     gdb_expect {
894         -re "
895 .*pdtlb r4\\(sr0,r5\\).*
896 .*pdtlb,m r4\\(sr0,r5\\).*
897 .*pitlb r4\\(sr0,r5\\).*
898 .*pitlb,m r4\\(sr0,r5\\).*
899 .*pdtlbe r4\\(sr0,r5\\).*
900 .*pdtlbe,m r4\\(sr0,r5\\).*
901 .*pitlbe r4\\(sr0,r5\\).*
902 .*pitlbe,m r4\\(sr0,r5\\).*
903 .*pdc r4\\(sr0,r5\\).*
904 .*pdc,m r4\\(sr0,r5\\).*
905 .*fdc r4\\(sr0,r5\\).*
906 .*fdc,m r4\\(sr0,r5\\).*
907 .*fic r4\\(sr0,r5\\).*
908 .*fic,m r4\\(sr0,r5\\).*
909 .*fdce r4\\(sr0,r5\\).*
910 .*fdce,m r4\\(sr0,r5\\).*
911 .*fice r4\\(sr0,r5\\).*
912 .*fice,m r4\\(sr0,r5\\).*
913 .*$gdb_prompt $" { pass "purge_tests" }
914         -re "$gdb_prompt $" { fail "purge_tests" }
915         timeout { file "(timeout) purge_tests" }
916     }
917
918     send_gdb "x/4i insert_tests\n"
919     gdb_expect {
920         -re "
921 .*idtlba r4,\\(sr0,r5\\).*
922 .*iitlba r4,\\(sr0,r5\\).*
923 .*idtlbp r4,\\(sr0,r5\\).*
924 .*iitlbp r4,\\(sr0,r5\\).*
925 .*$gdb_prompt $" { pass "insert_tests" }
926         -re "$gdb_prompt $" { fail "insert_tests" }
927         timeout { file "(timeout) insert_tests" }
928     }
929
930 }
931
932 proc all_fpu_memory_tests { } {
933     global gdb_prompt
934     global hex
935     global decimal
936
937     send_gdb "x/20i fpu_memory_indexing_tests\n"
938     gdb_expect {
939         -re "
940 .*fldwx r4\\(sr0,r5\\),fr6.*
941 .*fldwx,s r4\\(sr0,r5\\),fr6.*
942 .*fldwx,m r4\\(sr0,r5\\),fr6.*
943 .*fldwx,sm r4\\(sr0,r5\\),fr6.*
944 .*flddx r4\\(sr0,r5\\),fr6.*
945 .*flddx,s r4\\(sr0,r5\\),fr6.*
946 .*flddx,m r4\\(sr0,r5\\),fr6.*
947 .*flddx,sm r4\\(sr0,r5\\),fr6.*
948 .*fstwx fr6,r4\\(sr0,r5\\).*
949 .*fstwx,s fr6,r4\\(sr0,r5\\).*
950 .*fstwx,m fr6,r4\\(sr0,r5\\).*
951 .*fstwx,sm fr6,r4\\(sr0,r5\\).*
952 .*fstdx fr6,r4\\(sr0,r5\\).*
953 .*fstdx,s fr6,r4\\(sr0,r5\\).*
954 .*fstdx,m fr6,r4\\(sr0,r5\\).*
955 .*fstdx,sm fr6,r4\\(sr0,r5\\).*
956 .*fstqx fr6,r4\\(sr0,r5\\).*
957 .*fstqx,s fr6,r4\\(sr0,r5\\).*
958 .*fstqx,m fr6,r4\\(sr0,r5\\).*
959 .*fstqx,sm fr6,r4\\(sr0,r5\\).*
960 .*$gdb_prompt $" { pass "fpu_memory_indexing_tests" }
961         -re "$gdb_prompt $" { fail "fpu_memory_indexing_tests" }
962         timeout { file "(timeout) fpu_memory_indexing_tests" }
963     }
964
965     send_gdb "x/15i fpu_short_memory_tests\n"
966     gdb_expect {
967         -re "
968 .*fldws 0\\(sr0,r5\\),fr6.*
969 .*fldws,mb 0\\(sr0,r5\\),fr6.*
970 .*fldws,ma 0\\(sr0,r5\\),fr6.*
971 .*fldds 0\\(sr0,r5\\),fr6.*
972 .*fldds,mb 0\\(sr0,r5\\),fr6.*
973 .*fldds,ma 0\\(sr0,r5\\),fr6.*
974 .*fstws fr6,0\\(sr0,r5\\).*
975 .*fstws,mb fr6,0\\(sr0,r5\\).*
976 .*fstws,ma fr6,0\\(sr0,r5\\).*
977 .*fstds fr6,0\\(sr0,r5\\).*
978 .*fstds,mb fr6,0\\(sr0,r5\\).*
979 .*fstds,ma fr6,0\\(sr0,r5\\).*
980 .*fstqs fr6,0\\(sr0,r5\\).*
981 .*fstqs,mb fr6,0\\(sr0,r5\\).*
982 .*fstqs,ma fr6,0\\(sr0,r5\\).*
983 .*$gdb_prompt $" { pass "fpu_short_memory_tests" }
984         -re "$gdb_prompt $" { fail "fpu_short_memory_tests" }
985         timeout { file "(timeout) fpu_short_memory_tests" }
986     }
987
988 }
989
990 proc all_fpu_computational_tests { } {
991     global gdb_prompt
992     global hex
993     global decimal
994
995     send_gdb "x/1i fpu_misc_tests\n"
996     gdb_expect {
997         -re "
998 .*ftest.*
999 .*$gdb_prompt $" { pass "fpu_misc_tests" }
1000         -re "$gdb_prompt $" { fail "fpu_misc_tests" }
1001         timeout { file "(timeout) fpu_misc_tests" }
1002     }
1003
1004     set fpu_two_op_insns [list {fcpy} {fabs} {fsqrt} {frnd} ]
1005
1006     foreach i $fpu_two_op_insns {
1007         send_gdb "x/5i $i"; send_gdb "_tests\n"
1008         gdb_expect {
1009             -re "
1010 .*$i,sgl fr5,fr10.*
1011 .*$i,dbl fr5,fr10.*
1012 .*$i,quad fr5,fr10.*
1013 .*$i,sgl fr20,fr24.*
1014 .*$i,dbl fr20,fr24.*
1015 .*$gdb_prompt $" { pass "$i tests" }
1016             -re "$gdb_prompt $" { fail "$i tests" }
1017             timeout { fail "(timeout) $i tests" }
1018         }
1019     }
1020
1021     set fpu_conversions [list {fcnvff} {fcnvxf} {fcnvfx} {fcnvfxt} ]
1022
1023     foreach i $fpu_conversions {
1024         send_gdb "x/18i $i"; send_gdb "_tests\n"
1025         gdb_expect {
1026             -re "
1027 .*$i,sgl,sgl fr5,fr10.*
1028 .*$i,sgl,dbl fr5,fr10.*
1029 .*$i,sgl,quad fr5,fr10.*
1030 .*$i,dbl,sgl fr5,fr10.*
1031 .*$i,dbl,dbl fr5,fr10.*
1032 .*$i,dbl,quad fr5,fr10.*
1033 .*$i,quad,sgl fr5,fr10.*
1034 .*$i,quad,dbl fr5,fr10.*
1035 .*$i,quad,quad fr5,fr10.*
1036 .*$i,sgl,sgl fr20,fr24.*
1037 .*$i,sgl,dbl fr20,fr24.*
1038 .*$i,sgl,quad fr20,fr24.*
1039 .*$i,dbl,sgl fr20,fr24.*
1040 .*$i,dbl,dbl fr20,fr24.*
1041 .*$i,dbl,quad fr20,fr24.*
1042 .*$i,quad,sgl fr20,fr24.*
1043 .*$i,quad,dbl fr20,fr24.*
1044 .*$i,quad,quad fr20,fr24.*
1045 .*$gdb_prompt $" { pass "$i tests" }
1046             -re "$gdb_prompt $" { fail "$i tests" }
1047             timeout { fail "(timeout) $i tests" }
1048         }
1049     }
1050
1051     set fpu_three_op_insns [list {fadd} {fsub} {fmpy} {fdiv} {frem} ]
1052
1053     foreach i $fpu_three_op_insns {
1054         send_gdb "x/6i $i"; send_gdb "_tests\n"
1055         gdb_expect {
1056             -re "
1057 .*$i,sgl fr4,fr8,fr12.*
1058 .*$i,dbl fr4,fr8,fr12.*
1059 .*$i,quad fr4,fr8,fr12.*
1060 .*$i,sgl fr20,fr24,fr28.*
1061 .*$i,dbl fr20,fr24,fr28.*
1062 .*$i,quad fr20,fr24,fr28.*
1063 .*$gdb_prompt $" { pass "$i tests" }
1064             -re "$gdb_prompt $" { fail "$i tests" }
1065             timeout { fail "(timeout) $i tests" }
1066         }
1067     }
1068
1069     send_gdb "x/4i fmpy_addsub_tests\n"
1070     gdb_expect {
1071         -re "
1072 .*fmpyadd,sgl fr16,fr17,fr18,fr19,fr20.*
1073 .*fmpyadd,dbl fr16,fr17,fr18,fr19,fr20.*
1074 .*fmpysub,sgl fr16,fr17,fr18,fr19,fr20.*
1075 .*fmpysub,dbl fr16,fr17,fr18,fr19,fr20.*
1076 .*$gdb_prompt $" { pass "fmpy_addsub_tests" }
1077         -re "$gdb_prompt $" { fail "fmpy_addsub_tests" }
1078         timeout { fail "(timeout) fmpy_addsub_tests" }
1079     }
1080
1081     send_gdb "x/i xmpyu_tests\n"
1082     gdb_expect {
1083         -re "
1084 .*xmpyu fr4,fr5,fr6.*
1085 .*$gdb_prompt $" {pass "xmpyu_tests" }
1086         -re "$gdb_prompt $" {fail "xmpyu_tests" }
1087         timeout { fail "(timeout) xmpyu_tests" }
1088     }
1089
1090 }
1091
1092 proc all_fpu_comparison_tests { } {
1093     global gdb_prompt
1094     global hex
1095     global decimal
1096
1097     set fpu_comparison_formats [list {sgl} {dbl} {quad} ]
1098
1099     foreach i $fpu_comparison_formats {
1100         send_gdb "x/8i fcmp_$i"; send_gdb "_tests_1\n"
1101         gdb_expect {
1102             -re "
1103 .*fcmp,$i,false\\? fr4,fr5.*
1104 .*fcmp,$i,false fr4,fr5.*
1105 .*fcmp,$i,\\? fr4,fr5.*
1106 .*fcmp,$i,!<=> fr4,fr5.*
1107 .*fcmp,$i,= fr4,fr5.*
1108 .*fcmp,$i,=t fr4,fr5.*
1109 .*fcmp,$i,\\?= fr4,fr5.*
1110 .*fcmp,$i,!<> fr4,fr5.*
1111 .*$gdb_prompt $" { pass "$i tests (part1) " }
1112             -re "$gdb_prompt $" { fail "fcmp_$i tests (part1) " }
1113             timeout { fail "(timeout) fcmp_$i tests (part1) " }
1114         }
1115
1116         send_gdb "x/8i fcmp_$i"; send_gdb "_tests_2\n"
1117         gdb_expect {
1118             -re "
1119 .*fcmp,$i,!\\?>= fr4,fr5.*
1120 .*fcmp,$i,< fr4,fr5.*
1121 .*fcmp,$i,\\?< fr4,fr5.*
1122 .*fcmp,$i,!>= fr4,fr5.*
1123 .*fcmp,$i,!\\?> fr4,fr5.*
1124 .*fcmp,$i,<= fr4,fr5.*
1125 .*fcmp,$i,\\?<= fr4,fr5.*
1126 .*fcmp,$i,!> fr4,fr5.*
1127 .*$gdb_prompt $" { pass "$i tests (part2) " }
1128             -re "$gdb_prompt $" { fail "fcmp_$i tests (part2) " }
1129             timeout { fail "(timeout) fcmp_$i tests (part2) " }
1130         }
1131
1132         send_gdb "x/8i fcmp_$i"; send_gdb "_tests_3\n"
1133         gdb_expect {
1134             -re "
1135 .*fcmp,$i,!\\?<= fr4,fr5.*
1136 .*fcmp,$i,> fr4,fr5.*
1137 .*fcmp,$i,\\?> fr4,fr5.*
1138 .*fcmp,$i,!<= fr4,fr5.*
1139 .*fcmp,$i,!\\?< fr4,fr5.*
1140 .*fcmp,$i,>= fr4,fr5.*
1141 .*fcmp,$i,\\?>= fr4,fr5.*
1142 .*fcmp,$i,!< fr4,fr5.*
1143 .*$gdb_prompt $" { pass "$i tests (part3) " }
1144             -re "$gdb_prompt $" { fail "fcmp_$i tests (part3) " }
1145             timeout { fail "(timeout) fcmp_$i tests (part3) " }
1146         }
1147
1148         send_gdb "x/8i fcmp_$i"; send_gdb "_tests_4\n"
1149         gdb_expect {
1150             -re "
1151 .*fcmp,$i,!\\?= fr4,fr5.*
1152 .*fcmp,$i,<> fr4,fr5.*
1153 .*fcmp,$i,!= fr4,fr5.*
1154 .*fcmp,$i,!=t fr4,fr5.*
1155 .*fcmp,$i,!\\? fr4,fr5.*
1156 .*fcmp,$i,<=> fr4,fr5.*
1157 .*fcmp,$i,true\\? fr4,fr5.*
1158 .*fcmp,$i,true fr4,fr5.*
1159 .*$gdb_prompt $" { pass "$i tests (part4) " }
1160             -re "$gdb_prompt $" { fail "fcmp_$i tests (part4) " }
1161             timeout { fail "(timeout) fcmp_$i tests (part4) " }
1162         }
1163     }
1164 }
1165
1166 proc all_special_tests { } {
1167     global gdb_prompt
1168     global hex
1169     global decimal
1170
1171     send_gdb "x/4i special_tests\n"
1172     gdb_expect {
1173         -re "
1174 .*gfw r4\\(sr0,r5\\).*
1175 .*gfw,m r4\\(sr0,r5\\).*
1176 .*gfr r4\\(sr0,r5\\).*
1177 .*gfr,m r4\\(sr0,r5\\).*
1178 .*$gdb_prompt $" { pass "special tests" }
1179         -re "$gdb_prompt $" { fail "special tests" }
1180         timeout { fail "(timeout) special tests " }
1181     }
1182
1183 }
1184
1185 proc all_sfu_tests { } {
1186     global gdb_prompt
1187     global hex
1188     global decimal
1189
1190     send_gdb "x/16i sfu_tests\n"
1191     gdb_expect {
1192         -re "
1193 .*spop0,4,5.*
1194 .*spop0,4,73.*
1195 .*spop0,4,5,n.*
1196 .*spop0,4,73,n.*
1197 .*spop1,4,5 r5.*
1198 .*spop1,4,73 r5.*
1199 .*spop1,4,5,n r5.*
1200 .*spop1,4,73,n r5.*
1201 .*spop2,4,5 r5.*
1202 .*spop2,4,73 r5.*
1203 .*spop2,4,5,n r5.*
1204 .*spop2,4,73,n r5.*
1205 .*spop3,4,5 r5,r6.*
1206 .*spop3,4,73 r5,r6.*
1207 .*spop3,4,5,n r5,r6.*
1208 .*spop3,4,73,n r5,r6.*
1209 .*$gdb_prompt $" { pass "sfu tests" }
1210         -re "$gdb_prompt $" { fail "sfu tests" }
1211         timeout { fail "(timeout) sfu tests " }
1212     }
1213 }
1214
1215 proc all_copr_tests { } {
1216     global gdb_prompt
1217     global hex
1218     global decimal
1219
1220     send_gdb "x/4i copr_tests\n"
1221     gdb_expect {
1222         -re "
1223 .*copr,4,5.*
1224 .*copr,4,73.*
1225 .*copr,4,5,n.*
1226 .*copr,4,73,n.*
1227 .*$gdb_prompt $" { pass "copr tests" }
1228         -re "$gdb_prompt $" { fail "copr tests" }
1229         timeout { fail "(timeout) copr tests " }
1230     }
1231 }
1232
1233 proc all_copr_mem_tests { } {
1234     global gdb_prompt
1235     global hex
1236     global decimal
1237
1238     send_gdb "x/8i copr_indexing_load\n"
1239     gdb_expect {
1240         -re "
1241 .*cldwx,4 r5\\(sr0,r4\\),r26.*
1242 .*cldwx,4,s r5\\(sr0,r4\\),r26.*
1243 .*cldwx,4,m r5\\(sr0,r4\\),r26.*
1244 .*cldwx,4,sm r5\\(sr0,r4\\),r26.*
1245 .*clddx,4 r5\\(sr0,r4\\),r26.*
1246 .*clddx,4,s r5\\(sr0,r4\\),r26.*
1247 .*clddx,4,m r5\\(sr0,r4\\),r26.*
1248 .*clddx,4,sm r5\\(sr0,r4\\),r26.*
1249 .*$gdb_prompt $" { pass "copr indexed load tests" }
1250         -re "$gdb_prompt $" { fail "copr indexed load tests" }
1251         timeout { fail "(timeout) copr indexed load tests " }
1252     }
1253
1254     send_gdb "x/8i copr_indexing_store\n"
1255     gdb_expect {
1256         -re "
1257 .*cstwx,4 r26,r5\\(sr0,r4\\).*
1258 .*cstwx,4,s r26,r5\\(sr0,r4\\).*
1259 .*cstwx,4,m r26,r5\\(sr0,r4\\).*
1260 .*cstwx,4,sm r26,r5\\(sr0,r4\\).*
1261 .*cstdx,4 r26,r5\\(sr0,r4\\).*
1262 .*cstdx,4,s r26,r5\\(sr0,r4\\).*
1263 .*cstdx,4,m r26,r5\\(sr0,r4\\).*
1264 .*cstdx,4,sm r26,r5\\(sr0,r4\\).*
1265 .*$gdb_prompt $" { pass "copr indexed store tests" }
1266         -re "$gdb_prompt $" { fail "copr indexed store tests" }
1267         timeout { fail "(timeout) copr indexed load tests " }
1268     }
1269
1270     send_gdb "x/12i copr_short_memory\n"
1271     gdb_expect {
1272         -re "
1273 .*cldws,4 0\\(sr0,r4\\),r26.*
1274 .*cldws,4,mb 0\\(sr0,r4\\),r26.*
1275 .*cldws,4,ma 0\\(sr0,r4\\),r26.*
1276 .*cldds,4 0\\(sr0,r4\\),r26.*
1277 .*cldds,4,mb 0\\(sr0,r4\\),r26.*
1278 .*cldds,4,ma 0\\(sr0,r4\\),r26.*
1279 .*cstws,4 r26,0\\(sr0,r4\\).*
1280 .*cstws,4,mb r26,0\\(sr0,r4\\).*
1281 .*cstws,4,ma r26,0\\(sr0,r4\\).*
1282 .*cstds,4 r26,0\\(sr0,r4\\).*
1283 .*cstds,4,mb r26,0\\(sr0,r4\\).*
1284 .*cstds,4,ma r26,0\\(sr0,r4\\).*
1285 .*$gdb_prompt $" { pass "copr short memory tests" }
1286         -re "$gdb_prompt $" { fail "copr short memory tests" }
1287         timeout { fail "(timeout) copr short memory tests " }
1288     }
1289 }
1290
1291 proc fmemLRbug_tests { } {
1292     global gdb_prompt
1293     global hex
1294     global decimal
1295
1296     send_gdb "x/12i fmemLRbug_tests_1\n"
1297     gdb_expect {
1298         -re "
1299 .*fstws fr6R,0\\(sr0,r26\\).*
1300 .*fstws fr6,4\\(sr0,r26\\).*
1301 .*fstws fr6,8\\(sr0,r26\\).*
1302 .*fstds fr6,0\\(sr0,r26\\).*
1303 .*fstds fr6,4\\(sr0,r26\\).*
1304 .*fstds fr6,8\\(sr0,r26\\).*
1305 .*fldws 0\\(sr0,r26\\),fr6R.*
1306 .*fldws 4\\(sr0,r26\\),fr6.*
1307 .*fldws 8\\(sr0,r26\\),fr6.*
1308 .*fldds 0\\(sr0,r26\\),fr6.*
1309 .*fldds 4\\(sr0,r26\\),fr6.*
1310 .*fldds 8\\(sr0,r26\\),fr6.*
1311 .*$gdb_prompt $" { pass "fmem LR register selector tests (part1)" }
1312         -re "$gdb_prompt $" { fail "fmem LR register selector tests (part1)" }
1313         timeout { fail "(timeout) fmem LR register selector tests  (part1)" }
1314     }
1315
1316     send_gdb "x/12i fmemLRbug_tests_2\n"
1317     gdb_expect {
1318         -re "
1319 .*fstws fr6R,0\\(sr0,r26\\).*
1320 .*fstws fr6,4\\(sr0,r26\\).*
1321 .*fstws fr6,8\\(sr0,r26\\).*
1322 .*fstds fr6,0\\(sr0,r26\\).*
1323 .*fstds fr6,4\\(sr0,r26\\).*
1324 .*fstds fr6,8\\(sr0,r26\\).*
1325 .*fldws 0\\(sr0,r26\\),fr6R.*
1326 .*fldws 4\\(sr0,r26\\),fr6.*
1327 .*fldws 8\\(sr0,r26\\),fr6.*
1328 .*fldds 0\\(sr0,r26\\),fr6.*
1329 .*fldds 4\\(sr0,r26\\),fr6.*
1330 .*fldds 8\\(sr0,r26\\),fr6.*
1331 .*$gdb_prompt $" { pass "fmem LR register selector tests (part2)" }
1332         -re "$gdb_prompt $" { fail "fmem LR register selector tests (part2)" }
1333         timeout { fail "(timeout) fmem LR register selector tests  (part2)" }
1334     }
1335
1336     send_gdb "x/12i fmemLRbug_tests_3\n"
1337     gdb_expect {
1338         -re "
1339 .*fstwx fr6R,r25\\(sr0,r26\\).*
1340 .*fstwx fr6,r25\\(sr0,r26\\).*
1341 .*fstwx fr6,r25\\(sr0,r26\\).*
1342 .*fstdx fr6,r25\\(sr0,r26\\).*
1343 .*fstdx fr6,r25\\(sr0,r26\\).*
1344 .*fstdx fr6,r25\\(sr0,r26\\).*
1345 .*fldwx r25\\(sr0,r26\\),fr6R.*
1346 .*fldwx r25\\(sr0,r26\\),fr6.*
1347 .*fldwx r25\\(sr0,r26\\),fr6.*
1348 .*flddx r25\\(sr0,r26\\),fr6.*
1349 .*flddx r25\\(sr0,r26\\),fr6.*
1350 .*flddx r25\\(sr0,r26\\),fr6.*
1351 .*$gdb_prompt $" { pass "fmem LR register selector tests (part3)" }
1352         -re "$gdb_prompt $" { fail "fmem LR register selector tests (part3)" }
1353         timeout { fail "(timeout) fmem LR register selector tests  (part3)" }
1354     }
1355
1356     send_gdb "x/12i fmemLRbug_tests_4\n"
1357     gdb_expect {
1358         -re "
1359 .*fstwx fr6R,r25\\(sr0,r26\\).*
1360 .*fstwx fr6,r25\\(sr0,r26\\).*
1361 .*fstwx fr6,r25\\(sr0,r26\\).*
1362 .*fstdx fr6,r25\\(sr0,r26\\).*
1363 .*fstdx fr6,r25\\(sr0,r26\\).*
1364 .*fstdx fr6,r25\\(sr0,r26\\).*
1365 .*fldwx r25\\(sr0,r26\\),fr6R.*
1366 .*fldwx r25\\(sr0,r26\\),fr6.*
1367 .*fldwx r25\\(sr0,r26\\),fr6.*
1368 .*flddx r25\\(sr0,r26\\),fr6.*
1369 .*flddx r25\\(sr0,r26\\),fr6.*
1370 .*flddx r25\\(sr0,r26\\),fr6.*
1371 .*$gdb_prompt $" { pass "fmem LR register selector tests (part4)" }
1372         -re "$gdb_prompt $" { fail "fmem LR register selector tests (part4)" }
1373         timeout { fail "(timeout) fmem LR register selector tests  (part4)" }
1374     }
1375 }
1376
1377 # Start with a fresh gdb.
1378
1379 gdb_exit
1380 gdb_start
1381 gdb_reinitialize_dir $srcdir/$subdir
1382 gdb_load $binfile
1383
1384 all_integer_memory_tests
1385 all_immediate_tests
1386 all_branch_tests
1387 all_integer_computational_tests
1388 all_system_control_tests
1389 all_fpu_memory_tests
1390 all_fpu_computational_tests
1391 all_fpu_comparison_tests
1392 all_special_tests
1393 all_sfu_tests
1394 all_copr_tests
1395 all_copr_mem_tests
1396
1397 # Regression test for a bug Tege found.
1398 fmemLRbug_tests