1 # Copyright (C) 2003, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
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
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
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.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 # This file was written by Michael Snyder (msnyder@redhat.com)
22 if ![istarget "h8300*-*-*"] {
23 verbose "Tests ignored for all but h8300s based targets."
28 set testfile "t07_ari3"
29 set srcfile ${srcdir}/${subdir}/${testfile}.s
30 set objfile ${objdir}/${subdir}/${testfile}.o
31 set binfile ${objdir}/${subdir}/${testfile}.x
34 set link-flags "-m h8300sxelf";
37 if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} then {
42 if {[target_link $objfile $binfile "${link-flags}"] != ""} then {
48 gdb_reinitialize_dir $srcdir/$subdir
51 gdb_test "x /i _start" "neg.b\tr1h" \
53 gdb_test "x" "neg.b\t@er1" \
55 gdb_test "x" "neg.b\t@\\(0x3(:2|),er1\\)" \
57 gdb_test "x" "neg.b\t@er1\\+" \
59 gdb_test "x" "neg.b\t@-er1" \
61 gdb_test "x" "neg.b\t@\\+er1" \
63 gdb_test "x" "neg.b\t@er1-" \
65 gdb_test "x" "neg.b\t@\\(0x1234(:16|),er1\\)" \
66 "neg.b @(0x1234:16,er1)"
67 gdb_test "x" "neg.b\t@\\(0x12345678(:32|),er1\\)" \
68 "neg.b @(0x12345678:32,er1)"
69 gdb_test "x" "neg.b\t@\\(0x1234(:16|),r2l.b\\)" \
70 "neg.b @(0x1234:16,r2l.b)"
71 gdb_test "x" "neg.b\t@\\(0x1234(:16|),r2.w\\)" \
72 "neg.b @(0x1234:16,r2.w)"
73 gdb_test "x" "neg.b\t@\\(0x1234(:16|),er2.l\\)" \
74 "neg.b @(0x1234:16,er2.l)"
75 gdb_test "x" "neg.b\t@\\(0x12345678(:32|),r2l.b\\)" \
76 "neg.b @(0x12345678:32,r2l.b)"
77 gdb_test "x" "neg.b\t@\\(0x12345678(:32|),r2.w\\)" \
78 "neg.b @(0x12345678:32,r2.w)"
79 gdb_test "x" "neg.b\t@\\(0x12345678(:32|),er2.l\\)" \
80 "neg.b @(0x12345678:32,er2.l)"
81 gdb_test "x" "neg.b\t@0x12(:8|)" \
83 gdb_test "x" "neg.b\t@0x1234(:16|)" \
85 gdb_test "x" "neg.b\t@0x12345678(:32|)" \
86 "neg.b @0x12345678:32"
87 gdb_test "x" "neg.w\tr1" \
89 gdb_test "x" "neg.w\t@er1" \
91 gdb_test "x" "neg.w\t@\\(0x6(:2|),er1\\)" \
93 gdb_test "x" "neg.w\t@er1\\+" \
95 gdb_test "x" "neg.w\t@-er1" \
97 gdb_test "x" "neg.w\t@\\+er1" \
99 gdb_test "x" "neg.w\t@er1-" \
101 gdb_test "x" "neg.w\t@\\(0x1234(:16|),er1\\)" \
102 "neg.w @(0x1234:16,er1)"
103 gdb_test "x" "neg.w\t@\\(0x12345678(:32|),er1\\)" \
104 "neg.w @(0x12345678:32,er1)"
105 gdb_test "x" "neg.w\t@\\(0x1234(:16|),r2l.b\\)" \
106 "neg.w @(0x1234:16,r2l.b)"
107 gdb_test "x" "neg.w\t@\\(0x1234(:16|),r2.w\\)" \
108 "neg.w @(0x1234:16,r2.w)"
109 gdb_test "x" "neg.w\t@\\(0x1234(:16|),er2.l\\)" \
110 "neg.w @(0x1234:16,er2.l)"
111 gdb_test "x" "neg.w\t@\\(0x12345678(:32|),r2l.b\\)" \
112 "neg.w @(0x12345678:32,r2l.b)"
113 gdb_test "x" "neg.w\t@\\(0x12345678(:32|),r2.w\\)" \
114 "neg.w @(0x12345678:32,r2.w)"
115 gdb_test "x" "neg.w\t@\\(0x12345678(:32|),er2.l\\)" \
116 "neg.w @(0x12345678:32,er2.l)"
117 gdb_test "x" "neg.w\t@0x1234(:16|)" \
119 gdb_test "x" "neg.w\t@0x12345678(:32|)" \
120 "neg.w @0x12345678:32"
121 gdb_test "x" "neg.l\ter1" \
123 gdb_test "x" "neg.l\t@er1" \
125 gdb_test "x" "neg.l\t@\\(0xc(:2|),er1\\)" \
127 gdb_test "x" "neg.l\t@er1\\+" \
129 gdb_test "x" "neg.l\t@-er1" \
131 gdb_test "x" "neg.l\t@\\+er1" \
133 gdb_test "x" "neg.l\t@er1-" \
135 gdb_test "x" "neg.l\t@\\(0x1234(:16|),er1\\)" \
136 "neg.l @(0x1234:16,er1)"
137 gdb_test "x" "neg.l\t@\\(0x12345678(:32|),er1\\)" \
138 "neg.l @(0x12345678:32,er1)"
139 gdb_test "x" "neg.l\t@\\(0x1234(:16|),r2l.b\\)" \
140 "neg.l @(0x1234:16,r2l.b)"
141 gdb_test "x" "neg.l\t@\\(0x1234(:16|),r2.w\\)" \
142 "neg.l @(0x1234:16,r2.w)"
143 gdb_test "x" "neg.l\t@\\(0x1234(:16|),er2.l\\)" \
144 "neg.l @(0x1234:16,er2.l)"
145 gdb_test "x" "neg.l\t@\\(0x12345678(:32|),r2l.b\\)" \
146 "neg.l @(0x12345678:32,r2l.b)"
147 gdb_test "x" "neg.l\t@\\(0x12345678(:32|),r2.w\\)" \
148 "neg.l @(0x12345678:32,r2.w)"
149 gdb_test "x" "neg.l\t@\\(0x12345678(:32|),er2.l\\)" \
150 "neg.l @(0x12345678:32,er2.l)"
151 gdb_test "x" "neg.l\t@0x1234(:16|)" \
153 gdb_test "x" "neg.l\t@0x12345678(:32|)" \
154 "neg.l @0x12345678:32"
155 gdb_test "x" "tas\t@er1" \
157 gdb_test "x" "extu.w\tr1" \
159 gdb_test "x" "extu.w\t@er1" \
161 gdb_test "x" "extu.w\t@\\(0x6(:2|),er1\\)" \
162 "extu.w @(0x6:2,er1)"
163 gdb_test "x" "extu.w\t@er1\\+" \
165 gdb_test "x" "extu.w\t@-er1" \
167 gdb_test "x" "extu.w\t@\\+er1" \
169 gdb_test "x" "extu.w\t@er1-" \
171 gdb_test "x" "extu.w\t@\\(0x1234(:16|),er1\\)" \
172 "extu.w @(0x1234:16,er1)"
173 gdb_test "x" "extu.w\t@\\(0x12345678(:32|),er1\\)" \
174 "extu.w @(0x12345678:32,er1)"
175 gdb_test "x" "extu.w\t@\\(0x1234(:16|),r2l.b\\)" \
176 "extu.w @(0x1234:16,r2l.b)"
177 gdb_test "x" "extu.w\t@\\(0x1234(:16|),r2.w\\)" \
178 "extu.w @(0x1234:16,r2.w)"
179 gdb_test "x" "extu.w\t@\\(0x1234(:16|),er2.l\\)" \
180 "extu.w @(0x1234:16,er2.l)"
181 gdb_test "x" "extu.w\t@\\(0x12345678(:32|),r2l.b\\)" \
182 "extu.w @(0x12345678:32,r2l.b)"
183 gdb_test "x" "extu.w\t@\\(0x12345678(:32|),r2.w\\)" \
184 "extu.w @(0x12345678:32,r2.w)"
185 gdb_test "x" "extu.w\t@\\(0x12345678(:32|),er2.l\\)" \
186 "extu.w @(0x12345678:32,er2.l)"
187 gdb_test "x" "extu.w\t@0x1234(:16|)" \
189 gdb_test "x" "extu.w\t@0x12345678(:32|)" \
190 "extu.w @0x12345678:32"
191 gdb_test "x" "extu.l\ter1" \
193 gdb_test "x" "extu.l\t@er1" \
195 gdb_test "x" "extu.l\t@\\(0xc(:2|),er1\\)" \
196 "extu.l @(0xc:2,er1)"
197 gdb_test "x" "extu.l\t@er1\\+" \
199 gdb_test "x" "extu.l\t@-er1" \
201 gdb_test "x" "extu.l\t@\\+er1" \
203 gdb_test "x" "extu.l\t@er1-" \
205 gdb_test "x" "extu.l\t@\\(0x1234(:16|),er1\\)" \
206 "extu.l @(0x1234:16,er1)"
207 gdb_test "x" "extu.l\t@\\(0x12345678(:32|),er1\\)" \
208 "extu.l @(0x12345678:32,er1)"
209 gdb_test "x" "extu.l\t@\\(0x1234(:16|),r2l.b\\)" \
210 "extu.l @(0x1234:16,r2l.b)"
211 gdb_test "x" "extu.l\t@\\(0x1234(:16|),r2.w\\)" \
212 "extu.l @(0x1234:16,r2.w)"
213 gdb_test "x" "extu.l\t@\\(0x1234(:16|),er2.l\\)" \
214 "extu.l @(0x1234:16,er2.l)"
215 gdb_test "x" "extu.l\t@\\(0x12345678(:32|),r2l.b\\)" \
216 "extu.l @(0x12345678:32,r2l.b)"
217 gdb_test "x" "extu.l\t@\\(0x12345678(:32|),r2.w\\)" \
218 "extu.l @(0x12345678:32,r2.w)"
219 gdb_test "x" "extu.l\t@\\(0x12345678(:32|),er2.l\\)" \
220 "extu.l @(0x12345678:32,er2.l)"
221 gdb_test "x" "extu.l\t@0x1234(:16|)" \
223 gdb_test "x" "extu.l\t@0x12345678(:32|)" \
224 "extu.l @0x12345678:32"
225 gdb_test "x" "extu.l\t#2,er1" \
227 gdb_test "x" "extu.l\t#2,@er1" \
229 gdb_test "x" "extu.l\t#2,@\\(0xc(:2|),er1\\)" \
230 "extu.l #2,@(0xc:2,er1)"
231 gdb_test "x" "extu.l\t#2,@er1\\+" \
233 gdb_test "x" "extu.l\t#2,@-er1" \
235 gdb_test "x" "extu.l\t#2,@\\+er1" \
237 gdb_test "x" "extu.l\t#2,@er1-" \
239 gdb_test "x" "extu.l\t#2,@\\(0x1234(:16|),er1\\)" \
240 "extu.l #2,@(0x1234:16,er1)"
241 gdb_test "x" "extu.l\t#2,@\\(0x12345678(:32|),er1\\)" \
242 "extu.l #2,@(0x12345678:32,er1)"
243 gdb_test "x" "extu.l\t#2,@\\(0x1234(:16|),r2l.b\\)" \
244 "extu.l #2,@(0x1234:16,r2l.b)"
245 gdb_test "x" "extu.l\t#2,@\\(0x1234(:16|),r2.w\\)" \
246 "extu.l #2,@(0x1234:16,r2.w)"
247 gdb_test "x" "extu.l\t#2,@\\(0x1234(:16|),er2.l\\)" \
248 "extu.l #2,@(0x1234:16,er2.l)"
249 gdb_test "x" "extu.l\t#2,@\\(0x12345678(:32|),r2l.b\\)" \
250 "extu.l #2,@(0x12345678:32,r2l.b)"
251 gdb_test "x" "extu.l\t#2,@\\(0x12345678(:32|),r2.w\\)" \
252 "extu.l #2,@(0x12345678:32,r2.w)"
253 gdb_test "x" "extu.l\t#2,@\\(0x12345678(:32|),er2.l\\)" \
254 "extu.l #2,@(0x12345678:32,er2.l)"
255 gdb_test "x" "extu.l\t#2,@0x1234(:16|)" \
256 "extu.l #2,@0x1234:16"
257 gdb_test "x" "extu.l\t#2,@0x12345678(:32|)" \
258 "extu.l #2,@0x12345678:32"
259 gdb_test "x" "exts.w\tr1" \
261 gdb_test "x" "exts.w\t@er1" \
263 gdb_test "x" "exts.w\t@\\(0x6(:2|),er1\\)" \
264 "exts.w @(0x6:2,er1)"
265 gdb_test "x" "exts.w\t@er1\\+" \
267 gdb_test "x" "exts.w\t@-er1" \
269 gdb_test "x" "exts.w\t@\\+er1" \
271 gdb_test "x" "exts.w\t@er1-" \
273 gdb_test "x" "exts.w\t@\\(0x1234(:16|),er1\\)" \
274 "exts.w @(0x1234:16,er1)"
275 gdb_test "x" "exts.w\t@\\(0x12345678(:32|),er1\\)" \
276 "exts.w @(0x12345678:32,er1)"
277 gdb_test "x" "exts.w\t@\\(0x1234(:16|),r2l.b\\)" \
278 "exts.w @(0x1234:16,r2l.b)"
279 gdb_test "x" "exts.w\t@\\(0x1234(:16|),r2.w\\)" \
280 "exts.w @(0x1234:16,r2.w)"
281 gdb_test "x" "exts.w\t@\\(0x1234(:16|),er2.l\\)" \
282 "exts.w @(0x1234:16,er2.l)"
283 gdb_test "x" "exts.w\t@\\(0x12345678(:32|),r2l.b\\)" \
284 "exts.w @(0x12345678:32,r2l.b)"
285 gdb_test "x" "exts.w\t@\\(0x12345678(:32|),r2.w\\)" \
286 "exts.w @(0x12345678:32,r2.w)"
287 gdb_test "x" "exts.w\t@\\(0x12345678(:32|),er2.l\\)" \
288 "exts.w @(0x12345678:32,er2.l)"
289 gdb_test "x" "exts.w\t@0x1234(:16|)" \
291 gdb_test "x" "exts.w\t@0x12345678(:32|)" \
292 "exts.w @0x12345678:32"
293 gdb_test "x" "exts.l\ter1" \
295 gdb_test "x" "exts.l\t@er1" \
297 gdb_test "x" "exts.l\t@\\(0xc(:2|),er1\\)" \
298 "exts.l @(0xc:2,er1)"
299 gdb_test "x" "exts.l\t@er1\\+" \
301 gdb_test "x" "exts.l\t@-er1" \
303 gdb_test "x" "exts.l\t@\\+er1" \
305 gdb_test "x" "exts.l\t@er1-" \
307 gdb_test "x" "exts.l\t@\\(0x1234(:16|),er1\\)" \
308 "exts.l @(0x1234:16,er1)"
309 gdb_test "x" "exts.l\t@\\(0x12345678(:32|),er1\\)" \
310 "exts.l @(0x12345678:32,er1)"
311 gdb_test "x" "exts.l\t@\\(0x1234(:16|),r2l.b\\)" \
312 "exts.l @(0x1234:16,r2l.b)"
313 gdb_test "x" "exts.l\t@\\(0x1234(:16|),r2.w\\)" \
314 "exts.l @(0x1234:16,r2.w)"
315 gdb_test "x" "exts.l\t@\\(0x1234(:16|),er2.l\\)" \
316 "exts.l @(0x1234:16,er2.l)"
317 gdb_test "x" "exts.l\t@\\(0x12345678(:32|),r2l.b\\)" \
318 "exts.l @(0x12345678:32,r2l.b)"
319 gdb_test "x" "exts.l\t@\\(0x12345678(:32|),r2.w\\)" \
320 "exts.l @(0x12345678:32,r2.w)"
321 gdb_test "x" "exts.l\t@\\(0x12345678(:32|),er2.l\\)" \
322 "exts.l @(0x12345678:32,er2.l)"
323 gdb_test "x" "exts.l\t@0x1234(:16|)" \
325 gdb_test "x" "exts.l\t@0x12345678(:32|)" \
326 "exts.l @0x12345678:32"
327 gdb_test "x" "exts.l\t#2,er1" \
329 gdb_test "x" "exts.l\t#2,@er1" \
331 gdb_test "x" "exts.l\t#2,@\\(0xc(:2|),er1\\)" \
332 "exts.l #2,@(0xc:2,er1)"
333 gdb_test "x" "exts.l\t#2,@er1\\+" \
335 gdb_test "x" "exts.l\t#2,@-er1" \
337 gdb_test "x" "exts.l\t#2,@\\+er1" \
339 gdb_test "x" "exts.l\t#2,@er1-" \
341 gdb_test "x" "exts.l\t#2,@\\(0x1234(:16|),er1\\)" \
342 "exts.l #2,@(0x1234:16,er1)"
343 gdb_test "x" "exts.l\t#2,@\\(0x12345678(:32|),er1\\)" \
344 "exts.l #2,@(0x12345678:32,er1)"
345 gdb_test "x" "exts.l\t#2,@\\(0x1234(:16|),r2l.b\\)" \
346 "exts.l #2,@(0x1234:16,r2l.b)"
347 gdb_test "x" "exts.l\t#2,@\\(0x1234(:16|),r2.w\\)" \
348 "exts.l #2,@(0x1234:16,r2.w)"
349 gdb_test "x" "exts.l\t#2,@\\(0x1234(:16|),er2.l\\)" \
350 "exts.l #2,@(0x1234:16,er2.l)"
351 gdb_test "x" "exts.l\t#2,@\\(0x12345678(:32|),r2l.b\\)" \
352 "exts.l #2,@(0x12345678:32,r2l.b)"
353 gdb_test "x" "exts.l\t#2,@\\(0x12345678(:32|),r2.w\\)" \
354 "exts.l #2,@(0x12345678:32,r2.w)"
355 gdb_test "x" "exts.l\t#2,@\\(0x12345678(:32|),er2.l\\)" \
356 "exts.l #2,@(0x12345678:32,er2.l)"
357 gdb_test "x" "exts.l\t#2,@0x1234(:16|)" \
358 "exts.l #2,@0x1234:16"
359 gdb_test "x" "exts.l\t#2,@0x12345678(:32|)" \
360 "exts.l #2,@0x12345678:32"