]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.disasm/t13_otr.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.disasm / t13_otr.exp
CommitLineData
1d506c26 1# Copyright (C) 2003-2024 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
73c06197 18require {istarget "h8300*-*-*"}
57ba3b85 19
57ba3b85
MS
20
21set testfile "t13_otr"
22set srcfile ${srcdir}/${subdir}/${testfile}.s
23set objfile ${objdir}/${subdir}/${testfile}.o
24set binfile ${objdir}/${subdir}/${testfile}.x
25
4ec70201
PA
26set asm-flags ""
27set link-flags "-m h8300sxelf"
57ba3b85
MS
28
29
6ca2ea06 30if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} {
5b362f04 31 untested "failed to assemble"
b60f0898 32 return -1
57ba3b85
MS
33}
34
6ca2ea06 35if {[target_link $objfile $binfile "${link-flags}"] != ""} {
5b362f04 36 untested "failed to link"
b60f0898 37 return -1
57ba3b85
MS
38}
39
40gdb_start
41gdb_reinitialize_dir $srcdir/$subdir
42gdb_load $binfile
43
44global hex
45
df0f4836 46gdb_test "x /i start" "bra\t.\\+18 \\($hex\\)" \
57ba3b85
MS
47 "bra .+18"
48gdb_test "x" "brn\t.\\+18 \\($hex\\)" \
49 "brn .+18"
50gdb_test "x" "bhi\t.\\+18 \\($hex\\)" \
51 "bhi .+18"
52gdb_test "x" "bls\t.\\+18 \\($hex\\)" \
53 "bls .+18"
54gdb_test "x" "bcc\t.\\+18 \\($hex\\)" \
55 "bcc .+18"
56gdb_test "x" "bcs\t.\\+18 \\($hex\\)" \
57 "bcs .+18"
58gdb_test "x" "bne\t.\\+18 \\($hex\\)" \
59 "bne .+18"
60gdb_test "x" "beq\t.\\+18 \\($hex\\)" \
61 "beq .+18"
62gdb_test "x" "bvc\t.\\+18 \\($hex\\)" \
63 "bvc .+18"
64gdb_test "x" "bvs\t.\\+18 \\($hex\\)" \
65 "bvs .+18"
66gdb_test "x" "bpl\t.\\+18 \\($hex\\)" \
67 "bpl .+18"
68gdb_test "x" "bmi\t.\\+18 \\($hex\\)" \
69 "bmi .+18"
70gdb_test "x" "bge\t.\\+18 \\($hex\\)" \
71 "bge .+18"
72gdb_test "x" "blt\t.\\+18 \\($hex\\)" \
73 "blt .+18"
74gdb_test "x" "bgt\t.\\+18 \\($hex\\)" \
75 "bgt .+18"
76gdb_test "x" "ble\t.\\+18 \\($hex\\)" \
77 "ble .+18"
78gdb_test "x" "bra\t.\\+4660 \\($hex\\)" \
79 "bra .+4660"
80gdb_test "x" "brn\t.\\+4660 \\($hex\\)" \
81 "brn .+4660"
82gdb_test "x" "bhi\t.\\+4660 \\($hex\\)" \
83 "bhi .+4660"
84gdb_test "x" "bls\t.\\+4660 \\($hex\\)" \
85 "bls .+4660"
86gdb_test "x" "bcc\t.\\+4660 \\($hex\\)" \
87 "bcc .+4660"
88gdb_test "x" "bcs\t.\\+4660 \\($hex\\)" \
89 "bcs .+4660"
90gdb_test "x" "bne\t.\\+4660 \\($hex\\)" \
91 "bne .+4660"
92gdb_test "x" "beq\t.\\+4660 \\($hex\\)" \
93 "beq .+4660"
94gdb_test "x" "bvc\t.\\+4660 \\($hex\\)" \
95 "bvc .+4660"
96gdb_test "x" "bvs\t.\\+4660 \\($hex\\)" \
97 "bvs .+4660"
98gdb_test "x" "bpl\t.\\+4660 \\($hex\\)" \
99 "bpl .+4660"
100gdb_test "x" "bmi\t.\\+4660 \\($hex\\)" \
101 "bmi .+4660"
102gdb_test "x" "bge\t.\\+4660 \\($hex\\)" \
103 "bge .+4660"
104gdb_test "x" "blt\t.\\+4660 \\($hex\\)" \
105 "blt .+4660"
106gdb_test "x" "bgt\t.\\+4660 \\($hex\\)" \
107 "bgt .+4660"
108gdb_test "x" "ble\t.\\+4660 \\($hex\\)" \
109 "ble .+4660"
110gdb_test "x" "bra/s\t.\\+18 \\($hex\\)" \
111 "bra/s .+18"
112gdb_test "x" "nop\[ \t\]*" \
113 "nop"
114gdb_test "x" "bra/bc\t#0x7,@er2,.\\+18 \\($hex\\)" \
115 "bra/bc #0x7,@er2,.+18"
116gdb_test "x" "bra/bc\t#0x7,@0x9a(:8|),.\\+18 \\($hex\\)" \
117 "bra/bc #0x7,@0x9a:8,.+18"
118gdb_test "x" "bra/bc\t#0x7,@0x1234(:16|),.\\+18 \\($hex\\)" \
119 "bra/bc #0x7,@0x1234:16,.+18"
120gdb_test "x" "bra/bc\t#0x7,@0x12345678(:32|),.\\+18 \\($hex\\)" \
121 "bra/bc #0x7,@0x12345678:32,.+18"
122gdb_test "x" "bra/bc\t#0x7,@er2,.\\+4660 \\($hex\\)" \
123 "bra/bc #0x7,@er2,.+4660"
124gdb_test "x" "bra/bc\t#0x7,@0x12(:8|),.\\+4660 \\($hex\\)" \
125 "bra/bc #0x7,@0x12:8,.+4660"
126gdb_test "x" "bra/bc\t#0x7,@0x9abc(:16|),.\\+4660 \\($hex\\)" \
127 "bra/bc #0x7,@0x9abc:16,.+4660"
128gdb_test "x" "bra/bc\t#0x7,@0x12345678(:32|),.\\+4660 \\($hex\\)" \
129 "bra/bc #0x7,@0x12345678:32,.+4660"
130gdb_test "x" "bra/bs\t#0x7,@er2,.\\+18 \\($hex\\)" \
131 "bra/bs #0x7,@er2,.+18"
132gdb_test "x" "bra/bs\t#0x7,@0x9a(:8|),.\\+18 \\($hex\\)" \
133 "bra/bs #0x7,@0x9a:8,.+18"
134gdb_test "x" "bra/bs\t#0x7,@0x1234(:16|),.\\+18 \\($hex\\)" \
135 "bra/bs #0x7,@0x1234:16,.+18"
136gdb_test "x" "bra/bs\t#0x7,@0x12345678(:32|),.\\+18 \\($hex\\)" \
137 "bra/bs #0x7,@0x12345678:32,.+18"
138gdb_test "x" "bra/bs\t#0x7,@er2,.\\+4660 \\($hex\\)" \
139 "bra/bs #0x7,@er2,.+4660"
140gdb_test "x" "bra/bs\t#0x7,@0x12(:8|),.\\+4660 \\($hex\\)" \
141 "bra/bs #0x7,@0x12:8,.+4660"
142gdb_test "x" "bra/bs\t#0x7,@0x9abc(:16|),.\\+4660 \\($hex\\)" \
143 "bra/bs #0x7,@0x9abc:16,.+4660"
144gdb_test "x" "bra/bs\t#0x7,@0x12345678(:32|),.\\+4660 \\($hex\\)" \
145 "bra/bs #0x7,@0x12345678:32,.+4660"
146gdb_test "x" "bsr/bc\t#0x7,@er2,.\\+4660 \\($hex\\)" \
147 "bsr/bc #0x7,@er2,.+4660"
148gdb_test "x" "bsr/bc\t#0x7,@0x12(:8|),.\\+4660 \\($hex\\)" \
149 "bsr/bc #0x7,@0x12:8,.+4660"
150gdb_test "x" "bsr/bc\t#0x7,@0x9abc(:16|),.\\+4660 \\($hex\\)" \
151 "bsr/bc #0x7,@0x9abc:16,.+4660"
152gdb_test "x" "bsr/bc\t#0x7,@0x12345678(:32|),.\\+4660 \\($hex\\)" \
153 "bsr/bc #0x7,@0x12345678:32,.+4660"
154gdb_test "x" "bsr/bs\t#0x7,@er2,.\\+4660 \\($hex\\)" \
155 "bsr/bs #0x7,@er2,.+4660"
156gdb_test "x" "bsr/bs\t#0x7,@0x12(:8|),.\\+4660 \\($hex\\)" \
157 "bsr/bs #0x7,@0x12:8,.+4660"
158gdb_test "x" "bsr/bs\t#0x7,@0x9abc(:16|),.\\+4660 \\($hex\\)" \
159 "bsr/bs #0x7,@0x9abc:16,.+4660"
160gdb_test "x" "bsr/bs\t#0x7,@0x12345678(:32|),.\\+4660 \\($hex\\)" \
161 "bsr/bs #0x7,@0x12345678:32,.+4660"
162gdb_test "x" "bra\tr2l.b" \
163 "bra r2l.b"
164gdb_test "x" "bra\tr2.w" \
165 "bra r2.w"
166gdb_test "x" "bra\ter2(.l|)" \
167 "bra er2.l"
168gdb_test "x" "bsr\t.\\+18 \\($hex\\)" \
169 "bsr .+18"
170gdb_test "x" "bsr\t.\\+4660 \\($hex\\)" \
171 "bsr .+4660"
172gdb_test "x" "bsr\tr2l.b" \
173 "bsr r2l.b"
174gdb_test "x" "bsr\tr2.w" \
175 "bsr r2.w"
176gdb_test "x" "bsr\ter2(.l|)" \
177 "bsr er2.l"
178gdb_test "x" "jmp\t@er2" \
179 "jmp @er2"
180gdb_test "x" "jmp\t@0x123456(:24|)" \
181 "jmp @0x123456:24"
182gdb_test "x" "jmp\t@0x12345678(:32|)" \
183 "jmp @0x12345678:32"
184gdb_test "x" "jmp\t@@18 \\(0x12\\)" \
185 "jmp @@18 (0x12)"
186gdb_test "x" "jmp\t@@564 \\(0x234\\)" \
187 "jmp @@564 (0x234)"
188gdb_test "x" "jsr\t@er2" \
189 "jsr @er2"
190gdb_test "x" "jsr\t@0x123456(:24|)" \
191 "jsr @0x123456:24"
192gdb_test "x" "jsr\t@0x12345678(:32|)" \
193 "jsr @0x12345678:32"
194gdb_test "x" "jsr\t@@18 \\(0x12\\)" \
195 "jsr @@18 (0x12)"
196gdb_test "x" "jsr\t@@564 \\(0x234\\)" \
197 "jsr @@564 (0x234)"
198gdb_test "x" "rts\[ \t\]*" \
199 "rts"
200gdb_test "x" "rts/l\ter3" \
201 "rts/l er3"
202gdb_test "x" "rts/l\ter1-er2" \
203 "rts/l er1-er2"
204gdb_test "x" "rts/l\ter2-er4" \
205 "rts/l er2-er4"
206gdb_test "x" "rts/l\ter3-er6" \
207 "rts/l er3-er6"
208gdb_test "x" "trapa\t#0x3" \
209 "trapa #0x3"
210gdb_test "x" "rte\[ \t\]*" \
211 "rte"
212gdb_test "x" "rte/l\ter3" \
213 "rte/l er3"
214gdb_test "x" "rte/l\ter1-er2" \
215 "rte/l er1-er2"
216gdb_test "x" "rte/l\ter2-er4" \
217 "rte/l er2-er4"
218gdb_test "x" "rte/l\ter3-er6" \
219 "rte/l er3-er6"
220gdb_test "x" "ldc(.b|)\t#0x12(:8|),ccr" \
221 "ldc.b #0x12:8,ccr"
222gdb_test "x" "ldc(.b|)\tr3h,ccr" \
223 "ldc.b r3h,ccr"
224gdb_test "x" "ldc(.w|)\t@er3,ccr" \
225 "ldc.w @er3,ccr"
226gdb_test "x" "ldc(.w|)\t@er3\\+,ccr" \
227 "ldc.w @er3+,ccr"
228gdb_test "x" "ldc(.w|)\t@\\(0x1234(:16|),er3\\),ccr" \
229 "ldc.w @(0x1234:16,er3),ccr"
230gdb_test "x" "ldc(.w|)\t@\\(0x12345678(:32|),er3\\),ccr" \
231 "ldc.w @(0x12345678:32,er3),ccr"
232gdb_test "x" "ldc(.w|)\t@0x1234(:16|),ccr" \
233 "ldc.w @0x1234:16,ccr"
234gdb_test "x" "ldc(.w|)\t@0x12345678(:32|),ccr" \
235 "ldc.w @0x12345678:32,ccr"
236gdb_test "x" "ldc(.b|)\t#0x12(:8|),exr" \
237 "ldc.b #0x12:8,exr"
238gdb_test "x" "ldc(.b|)\tr3h,exr" \
239 "ldc.b r3h,exr"
240gdb_test "x" "ldc(.w|)\t@er3,exr" \
241 "ldc.w @er3,exr"
242gdb_test "x" "ldc(.w|)\t@er3\\+,exr" \
243 "ldc.w @er3+,exr"
244gdb_test "x" "ldc(.w|)\t@\\(0x1234(:16|),er3\\),exr" \
245 "ldc.w @(0x1234:16,er3),exr"
246gdb_test "x" "ldc(.w|)\t@\\(0x12345678(:32|),er3\\),exr" \
247 "ldc.w @(0x12345678:32,er3),exr"
248gdb_test "x" "ldc(.w|)\t@0x1234(:16|),exr" \
249 "ldc.w @0x1234:16,exr"
250gdb_test "x" "ldc(.w|)\t@0x12345678(:32|),exr" \
251 "ldc.w @0x12345678:32,exr"
252gdb_test "x" "stc(.b|)\tccr,r1h" \
253 "stc.b ccr,r1h"
254gdb_test "x" "stc(.w|)\tccr,@er1" \
255 "stc.w ccr,@er1"
256gdb_test "x" "stc(.w|)\tccr,@-er1" \
257 "stc.w ccr,@-er1"
258gdb_test "x" "stc(.w|)\tccr,@\\(0x1234(:16|),er1\\)" \
259 "stc.w ccr,@(0x1234:16,er1)"
260gdb_test "x" "stc(.w|)\tccr,@\\(0x12345678(:32|),er1\\)" \
261 "stc.w ccr,@(0x12345678:32,er1)"
262gdb_test "x" "stc(.w|)\tccr,@0x1234(:16|)" \
263 "stc.w ccr,@0x1234:16"
264gdb_test "x" "stc(.w|)\tccr,@0x12345678(:32|)" \
265 "stc.w ccr,@0x12345678:32"
266gdb_test "x" "stc(.b|)\texr,r1h" \
267 "stc.b exr,r1h"
268gdb_test "x" "stc(.w|)\texr,@er1" \
269 "stc.w exr,@er1"
270gdb_test "x" "stc(.w|)\texr,@-er1" \
271 "stc.w exr,@-er1"
272gdb_test "x" "stc(.w|)\texr,@\\(0x1234(:16|),er1\\)" \
273 "stc.w exr,@(0x1234:16,er1)"
274gdb_test "x" "stc(.w|)\texr,@\\(0x12345678(:32|),er1\\)" \
275 "stc.w exr,@(0x12345678:32,er1)"
276gdb_test "x" "stc(.w|)\texr,@0x1234(:16|)" \
277 "stc.w exr,@0x1234:16"
278gdb_test "x" "stc(.w|)\texr,@0x12345678(:32|)" \
279 "stc.w exr,@0x12345678:32"
280gdb_test "x" "orc(.b|)\t#0x12(:8|),ccr" \
281 "orc.b #0x12:8,ccr"
282gdb_test "x" "orc(.b|)\t#0x12(:8|),exr" \
283 "orc.b #0x12:8,exr"
284gdb_test "x" "xorc(.b|)\t#0x12(:8|),ccr" \
285 "xorc.b #0x12:8,ccr"
286gdb_test "x" "xorc(.b|)\t#0x12(:8|),exr" \
287 "xorc.b #0x12:8,exr"
288gdb_test "x" "andc(.b|)\t#0x12(:8|),ccr" \
289 "andc.b #0x12:8,ccr"
290gdb_test "x" "andc(.b|)\t#0x12(:8|),exr" \
291 "andc.b #0x12:8,exr"
292gdb_test "x" "sleep\[ \t\]*" \
293 "sleep"
294gdb_test "x" "nop\[ \t\]*" \
295 "nop"