]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.disasm/t13_otr.exp
Fix for PR gdb/1543.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.disasm / t13_otr.exp
CommitLineData
9b254dd1 1# Copyright (C) 2003, 2007, 2008 Free Software Foundation, Inc.
57ba3b85
MS
2
3# This program is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by
e22f8b7c 5# the Free Software Foundation; either version 3 of the License, or
57ba3b85 6# (at your option) any later version.
e22f8b7c 7#
57ba3b85
MS
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11# GNU General Public License for more details.
e22f8b7c 12#
57ba3b85 13# You should have received a copy of the GNU General Public License
e22f8b7c 14# along with this program. If not, see <http://www.gnu.org/licenses/>.
57ba3b85 15
57ba3b85
MS
16# This file was written by Michael Snyder (msnyder@redhat.com)
17
18if $tracelevel then {
19 strace $tracelevel
20}
21
22if ![istarget "h8300*-*-*"] {
23 verbose "Tests ignored for all but h8300s based targets."
24 return
25}
26
27set prms_id 0
28set bug_id 0
29
30set testfile "t13_otr"
31set srcfile ${srcdir}/${subdir}/${testfile}.s
32set objfile ${objdir}/${subdir}/${testfile}.o
33set binfile ${objdir}/${subdir}/${testfile}.x
34
35set asm-flags "";
36set link-flags "-m h8300sxelf";
37
38
39if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} then {
b60f0898
JB
40 untested t13_otr.exp
41 return -1
57ba3b85
MS
42}
43
44if {[target_link $objfile $binfile "${link-flags}"] != ""} then {
b60f0898
JB
45 untested t13_otr.exp
46 return -1
57ba3b85
MS
47}
48
49gdb_start
50gdb_reinitialize_dir $srcdir/$subdir
51gdb_load $binfile
52
53global hex
54
55gdb_test "x /i _start" "bra\t.\\+18 \\($hex\\)" \
56 "bra .+18"
57gdb_test "x" "brn\t.\\+18 \\($hex\\)" \
58 "brn .+18"
59gdb_test "x" "bhi\t.\\+18 \\($hex\\)" \
60 "bhi .+18"
61gdb_test "x" "bls\t.\\+18 \\($hex\\)" \
62 "bls .+18"
63gdb_test "x" "bcc\t.\\+18 \\($hex\\)" \
64 "bcc .+18"
65gdb_test "x" "bcs\t.\\+18 \\($hex\\)" \
66 "bcs .+18"
67gdb_test "x" "bne\t.\\+18 \\($hex\\)" \
68 "bne .+18"
69gdb_test "x" "beq\t.\\+18 \\($hex\\)" \
70 "beq .+18"
71gdb_test "x" "bvc\t.\\+18 \\($hex\\)" \
72 "bvc .+18"
73gdb_test "x" "bvs\t.\\+18 \\($hex\\)" \
74 "bvs .+18"
75gdb_test "x" "bpl\t.\\+18 \\($hex\\)" \
76 "bpl .+18"
77gdb_test "x" "bmi\t.\\+18 \\($hex\\)" \
78 "bmi .+18"
79gdb_test "x" "bge\t.\\+18 \\($hex\\)" \
80 "bge .+18"
81gdb_test "x" "blt\t.\\+18 \\($hex\\)" \
82 "blt .+18"
83gdb_test "x" "bgt\t.\\+18 \\($hex\\)" \
84 "bgt .+18"
85gdb_test "x" "ble\t.\\+18 \\($hex\\)" \
86 "ble .+18"
87gdb_test "x" "bra\t.\\+4660 \\($hex\\)" \
88 "bra .+4660"
89gdb_test "x" "brn\t.\\+4660 \\($hex\\)" \
90 "brn .+4660"
91gdb_test "x" "bhi\t.\\+4660 \\($hex\\)" \
92 "bhi .+4660"
93gdb_test "x" "bls\t.\\+4660 \\($hex\\)" \
94 "bls .+4660"
95gdb_test "x" "bcc\t.\\+4660 \\($hex\\)" \
96 "bcc .+4660"
97gdb_test "x" "bcs\t.\\+4660 \\($hex\\)" \
98 "bcs .+4660"
99gdb_test "x" "bne\t.\\+4660 \\($hex\\)" \
100 "bne .+4660"
101gdb_test "x" "beq\t.\\+4660 \\($hex\\)" \
102 "beq .+4660"
103gdb_test "x" "bvc\t.\\+4660 \\($hex\\)" \
104 "bvc .+4660"
105gdb_test "x" "bvs\t.\\+4660 \\($hex\\)" \
106 "bvs .+4660"
107gdb_test "x" "bpl\t.\\+4660 \\($hex\\)" \
108 "bpl .+4660"
109gdb_test "x" "bmi\t.\\+4660 \\($hex\\)" \
110 "bmi .+4660"
111gdb_test "x" "bge\t.\\+4660 \\($hex\\)" \
112 "bge .+4660"
113gdb_test "x" "blt\t.\\+4660 \\($hex\\)" \
114 "blt .+4660"
115gdb_test "x" "bgt\t.\\+4660 \\($hex\\)" \
116 "bgt .+4660"
117gdb_test "x" "ble\t.\\+4660 \\($hex\\)" \
118 "ble .+4660"
119gdb_test "x" "bra/s\t.\\+18 \\($hex\\)" \
120 "bra/s .+18"
121gdb_test "x" "nop\[ \t\]*" \
122 "nop"
123gdb_test "x" "bra/bc\t#0x7,@er2,.\\+18 \\($hex\\)" \
124 "bra/bc #0x7,@er2,.+18"
125gdb_test "x" "bra/bc\t#0x7,@0x9a(:8|),.\\+18 \\($hex\\)" \
126 "bra/bc #0x7,@0x9a:8,.+18"
127gdb_test "x" "bra/bc\t#0x7,@0x1234(:16|),.\\+18 \\($hex\\)" \
128 "bra/bc #0x7,@0x1234:16,.+18"
129gdb_test "x" "bra/bc\t#0x7,@0x12345678(:32|),.\\+18 \\($hex\\)" \
130 "bra/bc #0x7,@0x12345678:32,.+18"
131gdb_test "x" "bra/bc\t#0x7,@er2,.\\+4660 \\($hex\\)" \
132 "bra/bc #0x7,@er2,.+4660"
133gdb_test "x" "bra/bc\t#0x7,@0x12(:8|),.\\+4660 \\($hex\\)" \
134 "bra/bc #0x7,@0x12:8,.+4660"
135gdb_test "x" "bra/bc\t#0x7,@0x9abc(:16|),.\\+4660 \\($hex\\)" \
136 "bra/bc #0x7,@0x9abc:16,.+4660"
137gdb_test "x" "bra/bc\t#0x7,@0x12345678(:32|),.\\+4660 \\($hex\\)" \
138 "bra/bc #0x7,@0x12345678:32,.+4660"
139gdb_test "x" "bra/bs\t#0x7,@er2,.\\+18 \\($hex\\)" \
140 "bra/bs #0x7,@er2,.+18"
141gdb_test "x" "bra/bs\t#0x7,@0x9a(:8|),.\\+18 \\($hex\\)" \
142 "bra/bs #0x7,@0x9a:8,.+18"
143gdb_test "x" "bra/bs\t#0x7,@0x1234(:16|),.\\+18 \\($hex\\)" \
144 "bra/bs #0x7,@0x1234:16,.+18"
145gdb_test "x" "bra/bs\t#0x7,@0x12345678(:32|),.\\+18 \\($hex\\)" \
146 "bra/bs #0x7,@0x12345678:32,.+18"
147gdb_test "x" "bra/bs\t#0x7,@er2,.\\+4660 \\($hex\\)" \
148 "bra/bs #0x7,@er2,.+4660"
149gdb_test "x" "bra/bs\t#0x7,@0x12(:8|),.\\+4660 \\($hex\\)" \
150 "bra/bs #0x7,@0x12:8,.+4660"
151gdb_test "x" "bra/bs\t#0x7,@0x9abc(:16|),.\\+4660 \\($hex\\)" \
152 "bra/bs #0x7,@0x9abc:16,.+4660"
153gdb_test "x" "bra/bs\t#0x7,@0x12345678(:32|),.\\+4660 \\($hex\\)" \
154 "bra/bs #0x7,@0x12345678:32,.+4660"
155gdb_test "x" "bsr/bc\t#0x7,@er2,.\\+4660 \\($hex\\)" \
156 "bsr/bc #0x7,@er2,.+4660"
157gdb_test "x" "bsr/bc\t#0x7,@0x12(:8|),.\\+4660 \\($hex\\)" \
158 "bsr/bc #0x7,@0x12:8,.+4660"
159gdb_test "x" "bsr/bc\t#0x7,@0x9abc(:16|),.\\+4660 \\($hex\\)" \
160 "bsr/bc #0x7,@0x9abc:16,.+4660"
161gdb_test "x" "bsr/bc\t#0x7,@0x12345678(:32|),.\\+4660 \\($hex\\)" \
162 "bsr/bc #0x7,@0x12345678:32,.+4660"
163gdb_test "x" "bsr/bs\t#0x7,@er2,.\\+4660 \\($hex\\)" \
164 "bsr/bs #0x7,@er2,.+4660"
165gdb_test "x" "bsr/bs\t#0x7,@0x12(:8|),.\\+4660 \\($hex\\)" \
166 "bsr/bs #0x7,@0x12:8,.+4660"
167gdb_test "x" "bsr/bs\t#0x7,@0x9abc(:16|),.\\+4660 \\($hex\\)" \
168 "bsr/bs #0x7,@0x9abc:16,.+4660"
169gdb_test "x" "bsr/bs\t#0x7,@0x12345678(:32|),.\\+4660 \\($hex\\)" \
170 "bsr/bs #0x7,@0x12345678:32,.+4660"
171gdb_test "x" "bra\tr2l.b" \
172 "bra r2l.b"
173gdb_test "x" "bra\tr2.w" \
174 "bra r2.w"
175gdb_test "x" "bra\ter2(.l|)" \
176 "bra er2.l"
177gdb_test "x" "bsr\t.\\+18 \\($hex\\)" \
178 "bsr .+18"
179gdb_test "x" "bsr\t.\\+4660 \\($hex\\)" \
180 "bsr .+4660"
181gdb_test "x" "bsr\tr2l.b" \
182 "bsr r2l.b"
183gdb_test "x" "bsr\tr2.w" \
184 "bsr r2.w"
185gdb_test "x" "bsr\ter2(.l|)" \
186 "bsr er2.l"
187gdb_test "x" "jmp\t@er2" \
188 "jmp @er2"
189gdb_test "x" "jmp\t@0x123456(:24|)" \
190 "jmp @0x123456:24"
191gdb_test "x" "jmp\t@0x12345678(:32|)" \
192 "jmp @0x12345678:32"
193gdb_test "x" "jmp\t@@18 \\(0x12\\)" \
194 "jmp @@18 (0x12)"
195gdb_test "x" "jmp\t@@564 \\(0x234\\)" \
196 "jmp @@564 (0x234)"
197gdb_test "x" "jsr\t@er2" \
198 "jsr @er2"
199gdb_test "x" "jsr\t@0x123456(:24|)" \
200 "jsr @0x123456:24"
201gdb_test "x" "jsr\t@0x12345678(:32|)" \
202 "jsr @0x12345678:32"
203gdb_test "x" "jsr\t@@18 \\(0x12\\)" \
204 "jsr @@18 (0x12)"
205gdb_test "x" "jsr\t@@564 \\(0x234\\)" \
206 "jsr @@564 (0x234)"
207gdb_test "x" "rts\[ \t\]*" \
208 "rts"
209gdb_test "x" "rts/l\ter3" \
210 "rts/l er3"
211gdb_test "x" "rts/l\ter1-er2" \
212 "rts/l er1-er2"
213gdb_test "x" "rts/l\ter2-er4" \
214 "rts/l er2-er4"
215gdb_test "x" "rts/l\ter3-er6" \
216 "rts/l er3-er6"
217gdb_test "x" "trapa\t#0x3" \
218 "trapa #0x3"
219gdb_test "x" "rte\[ \t\]*" \
220 "rte"
221gdb_test "x" "rte/l\ter3" \
222 "rte/l er3"
223gdb_test "x" "rte/l\ter1-er2" \
224 "rte/l er1-er2"
225gdb_test "x" "rte/l\ter2-er4" \
226 "rte/l er2-er4"
227gdb_test "x" "rte/l\ter3-er6" \
228 "rte/l er3-er6"
229gdb_test "x" "ldc(.b|)\t#0x12(:8|),ccr" \
230 "ldc.b #0x12:8,ccr"
231gdb_test "x" "ldc(.b|)\tr3h,ccr" \
232 "ldc.b r3h,ccr"
233gdb_test "x" "ldc(.w|)\t@er3,ccr" \
234 "ldc.w @er3,ccr"
235gdb_test "x" "ldc(.w|)\t@er3\\+,ccr" \
236 "ldc.w @er3+,ccr"
237gdb_test "x" "ldc(.w|)\t@\\(0x1234(:16|),er3\\),ccr" \
238 "ldc.w @(0x1234:16,er3),ccr"
239gdb_test "x" "ldc(.w|)\t@\\(0x12345678(:32|),er3\\),ccr" \
240 "ldc.w @(0x12345678:32,er3),ccr"
241gdb_test "x" "ldc(.w|)\t@0x1234(:16|),ccr" \
242 "ldc.w @0x1234:16,ccr"
243gdb_test "x" "ldc(.w|)\t@0x12345678(:32|),ccr" \
244 "ldc.w @0x12345678:32,ccr"
245gdb_test "x" "ldc(.b|)\t#0x12(:8|),exr" \
246 "ldc.b #0x12:8,exr"
247gdb_test "x" "ldc(.b|)\tr3h,exr" \
248 "ldc.b r3h,exr"
249gdb_test "x" "ldc(.w|)\t@er3,exr" \
250 "ldc.w @er3,exr"
251gdb_test "x" "ldc(.w|)\t@er3\\+,exr" \
252 "ldc.w @er3+,exr"
253gdb_test "x" "ldc(.w|)\t@\\(0x1234(:16|),er3\\),exr" \
254 "ldc.w @(0x1234:16,er3),exr"
255gdb_test "x" "ldc(.w|)\t@\\(0x12345678(:32|),er3\\),exr" \
256 "ldc.w @(0x12345678:32,er3),exr"
257gdb_test "x" "ldc(.w|)\t@0x1234(:16|),exr" \
258 "ldc.w @0x1234:16,exr"
259gdb_test "x" "ldc(.w|)\t@0x12345678(:32|),exr" \
260 "ldc.w @0x12345678:32,exr"
261gdb_test "x" "stc(.b|)\tccr,r1h" \
262 "stc.b ccr,r1h"
263gdb_test "x" "stc(.w|)\tccr,@er1" \
264 "stc.w ccr,@er1"
265gdb_test "x" "stc(.w|)\tccr,@-er1" \
266 "stc.w ccr,@-er1"
267gdb_test "x" "stc(.w|)\tccr,@\\(0x1234(:16|),er1\\)" \
268 "stc.w ccr,@(0x1234:16,er1)"
269gdb_test "x" "stc(.w|)\tccr,@\\(0x12345678(:32|),er1\\)" \
270 "stc.w ccr,@(0x12345678:32,er1)"
271gdb_test "x" "stc(.w|)\tccr,@0x1234(:16|)" \
272 "stc.w ccr,@0x1234:16"
273gdb_test "x" "stc(.w|)\tccr,@0x12345678(:32|)" \
274 "stc.w ccr,@0x12345678:32"
275gdb_test "x" "stc(.b|)\texr,r1h" \
276 "stc.b exr,r1h"
277gdb_test "x" "stc(.w|)\texr,@er1" \
278 "stc.w exr,@er1"
279gdb_test "x" "stc(.w|)\texr,@-er1" \
280 "stc.w exr,@-er1"
281gdb_test "x" "stc(.w|)\texr,@\\(0x1234(:16|),er1\\)" \
282 "stc.w exr,@(0x1234:16,er1)"
283gdb_test "x" "stc(.w|)\texr,@\\(0x12345678(:32|),er1\\)" \
284 "stc.w exr,@(0x12345678:32,er1)"
285gdb_test "x" "stc(.w|)\texr,@0x1234(:16|)" \
286 "stc.w exr,@0x1234:16"
287gdb_test "x" "stc(.w|)\texr,@0x12345678(:32|)" \
288 "stc.w exr,@0x12345678:32"
289gdb_test "x" "orc(.b|)\t#0x12(:8|),ccr" \
290 "orc.b #0x12:8,ccr"
291gdb_test "x" "orc(.b|)\t#0x12(:8|),exr" \
292 "orc.b #0x12:8,exr"
293gdb_test "x" "xorc(.b|)\t#0x12(:8|),ccr" \
294 "xorc.b #0x12:8,ccr"
295gdb_test "x" "xorc(.b|)\t#0x12(:8|),exr" \
296 "xorc.b #0x12:8,exr"
297gdb_test "x" "andc(.b|)\t#0x12(:8|),ccr" \
298 "andc.b #0x12:8,ccr"
299gdb_test "x" "andc(.b|)\t#0x12(:8|),exr" \
300 "andc.b #0x12:8,exr"
301gdb_test "x" "sleep\[ \t\]*" \
302 "sleep"
303gdb_test "x" "nop\[ \t\]*" \
304 "nop"