1 # Copyright
(C
) 2003 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
2 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
, write to the Free Software
15 # Foundation
, Inc.
, 59 Temple Place
- Suite
330, Boston
, MA
02111-1307, USA.
17 # Please email
any bugs
, comments
, and
/or additions to this file to
:
18 # bug
-gdb@prep.ai.mit.edu
20 # This file was written by Michael Snyder
(msnyder@redhat.com
)
26 if ![istarget
"h8300*-*-*"] {
27 verbose
"Tests ignored for all but h8300s based targets."
34 set testfile
"t13_otr"
35 set srcfile $
{srcdir
}/$
{subdir
}/$
{testfile
}.s
36 set objfile $
{objdir
}/$
{subdir
}/$
{testfile
}.o
37 set binfile $
{objdir
}/$
{subdir
}/$
{testfile
}.x
40 set link
-flags
"-m h8300sxelf";
43 if {[target_assemble $srcfile $objfile
"${asm-flags}"] != ""} then {
44 gdb_suppress_entire_file
"Testcase assembly failed, so all tests in this file will automatically fail."
47 if {[target_link $objfile $binfile
"${link-flags}"] != ""} then {
48 gdb_suppress_entire_file
"Testcase link failed, so all tests in this file will automatically fail."
52 gdb_reinitialize_dir $srcdir
/$subdir
57 gdb_test
"x /i _start" "bra\t.\\+18 \\($hex\\)" \
59 gdb_test
"x" "brn\t.\\+18 \\($hex\\)" \
61 gdb_test
"x" "bhi\t.\\+18 \\($hex\\)" \
63 gdb_test
"x" "bls\t.\\+18 \\($hex\\)" \
65 gdb_test
"x" "bcc\t.\\+18 \\($hex\\)" \
67 gdb_test
"x" "bcs\t.\\+18 \\($hex\\)" \
69 gdb_test
"x" "bne\t.\\+18 \\($hex\\)" \
71 gdb_test
"x" "beq\t.\\+18 \\($hex\\)" \
73 gdb_test
"x" "bvc\t.\\+18 \\($hex\\)" \
75 gdb_test
"x" "bvs\t.\\+18 \\($hex\\)" \
77 gdb_test
"x" "bpl\t.\\+18 \\($hex\\)" \
79 gdb_test
"x" "bmi\t.\\+18 \\($hex\\)" \
81 gdb_test
"x" "bge\t.\\+18 \\($hex\\)" \
83 gdb_test
"x" "blt\t.\\+18 \\($hex\\)" \
85 gdb_test
"x" "bgt\t.\\+18 \\($hex\\)" \
87 gdb_test
"x" "ble\t.\\+18 \\($hex\\)" \
89 gdb_test
"x" "bra\t.\\+4660 \\($hex\\)" \
91 gdb_test
"x" "brn\t.\\+4660 \\($hex\\)" \
93 gdb_test
"x" "bhi\t.\\+4660 \\($hex\\)" \
95 gdb_test
"x" "bls\t.\\+4660 \\($hex\\)" \
97 gdb_test
"x" "bcc\t.\\+4660 \\($hex\\)" \
99 gdb_test
"x" "bcs\t.\\+4660 \\($hex\\)" \
101 gdb_test
"x" "bne\t.\\+4660 \\($hex\\)" \
103 gdb_test
"x" "beq\t.\\+4660 \\($hex\\)" \
105 gdb_test
"x" "bvc\t.\\+4660 \\($hex\\)" \
107 gdb_test
"x" "bvs\t.\\+4660 \\($hex\\)" \
109 gdb_test
"x" "bpl\t.\\+4660 \\($hex\\)" \
111 gdb_test
"x" "bmi\t.\\+4660 \\($hex\\)" \
113 gdb_test
"x" "bge\t.\\+4660 \\($hex\\)" \
115 gdb_test
"x" "blt\t.\\+4660 \\($hex\\)" \
117 gdb_test
"x" "bgt\t.\\+4660 \\($hex\\)" \
119 gdb_test
"x" "ble\t.\\+4660 \\($hex\\)" \
121 gdb_test
"x" "bra/s\t.\\+18 \\($hex\\)" \
123 gdb_test
"x" "nop\[ \t\]*" \
125 gdb_test
"x" "bra/bc\t#0x7,@er2,.\\+18 \\($hex\\)" \
126 "bra/bc #0x7,@er2,.+18"
127 gdb_test
"x" "bra/bc\t#0x7,@0x9a(:8|),.\\+18 \\($hex\\)" \
128 "bra/bc #0x7,@0x9a:8,.+18"
129 gdb_test
"x" "bra/bc\t#0x7,@0x1234(:16|),.\\+18 \\($hex\\)" \
130 "bra/bc #0x7,@0x1234:16,.+18"
131 gdb_test
"x" "bra/bc\t#0x7,@0x12345678(:32|),.\\+18 \\($hex\\)" \
132 "bra/bc #0x7,@0x12345678:32,.+18"
133 gdb_test
"x" "bra/bc\t#0x7,@er2,.\\+4660 \\($hex\\)" \
134 "bra/bc #0x7,@er2,.+4660"
135 gdb_test
"x" "bra/bc\t#0x7,@0x12(:8|),.\\+4660 \\($hex\\)" \
136 "bra/bc #0x7,@0x12:8,.+4660"
137 gdb_test
"x" "bra/bc\t#0x7,@0x9abc(:16|),.\\+4660 \\($hex\\)" \
138 "bra/bc #0x7,@0x9abc:16,.+4660"
139 gdb_test
"x" "bra/bc\t#0x7,@0x12345678(:32|),.\\+4660 \\($hex\\)" \
140 "bra/bc #0x7,@0x12345678:32,.+4660"
141 gdb_test
"x" "bra/bs\t#0x7,@er2,.\\+18 \\($hex\\)" \
142 "bra/bs #0x7,@er2,.+18"
143 gdb_test
"x" "bra/bs\t#0x7,@0x9a(:8|),.\\+18 \\($hex\\)" \
144 "bra/bs #0x7,@0x9a:8,.+18"
145 gdb_test
"x" "bra/bs\t#0x7,@0x1234(:16|),.\\+18 \\($hex\\)" \
146 "bra/bs #0x7,@0x1234:16,.+18"
147 gdb_test
"x" "bra/bs\t#0x7,@0x12345678(:32|),.\\+18 \\($hex\\)" \
148 "bra/bs #0x7,@0x12345678:32,.+18"
149 gdb_test
"x" "bra/bs\t#0x7,@er2,.\\+4660 \\($hex\\)" \
150 "bra/bs #0x7,@er2,.+4660"
151 gdb_test
"x" "bra/bs\t#0x7,@0x12(:8|),.\\+4660 \\($hex\\)" \
152 "bra/bs #0x7,@0x12:8,.+4660"
153 gdb_test
"x" "bra/bs\t#0x7,@0x9abc(:16|),.\\+4660 \\($hex\\)" \
154 "bra/bs #0x7,@0x9abc:16,.+4660"
155 gdb_test
"x" "bra/bs\t#0x7,@0x12345678(:32|),.\\+4660 \\($hex\\)" \
156 "bra/bs #0x7,@0x12345678:32,.+4660"
157 gdb_test
"x" "bsr/bc\t#0x7,@er2,.\\+4660 \\($hex\\)" \
158 "bsr/bc #0x7,@er2,.+4660"
159 gdb_test
"x" "bsr/bc\t#0x7,@0x12(:8|),.\\+4660 \\($hex\\)" \
160 "bsr/bc #0x7,@0x12:8,.+4660"
161 gdb_test
"x" "bsr/bc\t#0x7,@0x9abc(:16|),.\\+4660 \\($hex\\)" \
162 "bsr/bc #0x7,@0x9abc:16,.+4660"
163 gdb_test
"x" "bsr/bc\t#0x7,@0x12345678(:32|),.\\+4660 \\($hex\\)" \
164 "bsr/bc #0x7,@0x12345678:32,.+4660"
165 gdb_test
"x" "bsr/bs\t#0x7,@er2,.\\+4660 \\($hex\\)" \
166 "bsr/bs #0x7,@er2,.+4660"
167 gdb_test
"x" "bsr/bs\t#0x7,@0x12(:8|),.\\+4660 \\($hex\\)" \
168 "bsr/bs #0x7,@0x12:8,.+4660"
169 gdb_test
"x" "bsr/bs\t#0x7,@0x9abc(:16|),.\\+4660 \\($hex\\)" \
170 "bsr/bs #0x7,@0x9abc:16,.+4660"
171 gdb_test
"x" "bsr/bs\t#0x7,@0x12345678(:32|),.\\+4660 \\($hex\\)" \
172 "bsr/bs #0x7,@0x12345678:32,.+4660"
173 gdb_test
"x" "bra\tr2l.b" \
175 gdb_test
"x" "bra\tr2.w" \
177 gdb_test
"x" "bra\ter2(.l|)" \
179 gdb_test
"x" "bsr\t.\\+18 \\($hex\\)" \
181 gdb_test
"x" "bsr\t.\\+4660 \\($hex\\)" \
183 gdb_test
"x" "bsr\tr2l.b" \
185 gdb_test
"x" "bsr\tr2.w" \
187 gdb_test
"x" "bsr\ter2(.l|)" \
189 gdb_test
"x" "jmp\t@er2" \
191 gdb_test
"x" "jmp\t@0x123456(:24|)" \
193 gdb_test
"x" "jmp\t@0x12345678(:32|)" \
195 gdb_test
"x" "jmp\t@@18 \\(0x12\\)" \
197 gdb_test
"x" "jmp\t@@564 \\(0x234\\)" \
199 gdb_test
"x" "jsr\t@er2" \
201 gdb_test
"x" "jsr\t@0x123456(:24|)" \
203 gdb_test
"x" "jsr\t@0x12345678(:32|)" \
205 gdb_test
"x" "jsr\t@@18 \\(0x12\\)" \
207 gdb_test
"x" "jsr\t@@564 \\(0x234\\)" \
209 gdb_test
"x" "rts\[ \t\]*" \
211 gdb_test
"x" "rts/l\ter3" \
213 gdb_test
"x" "rts/l\ter1-er2" \
215 gdb_test
"x" "rts/l\ter2-er4" \
217 gdb_test
"x" "rts/l\ter3-er6" \
219 gdb_test
"x" "trapa\t#0x3" \
221 gdb_test
"x" "rte\[ \t\]*" \
223 gdb_test
"x" "rte/l\ter3" \
225 gdb_test
"x" "rte/l\ter1-er2" \
227 gdb_test
"x" "rte/l\ter2-er4" \
229 gdb_test
"x" "rte/l\ter3-er6" \
231 gdb_test
"x" "ldc(.b|)\t#0x12(:8|),ccr" \
233 gdb_test
"x" "ldc(.b|)\tr3h,ccr" \
235 gdb_test
"x" "ldc(.w|)\t@er3,ccr" \
237 gdb_test
"x" "ldc(.w|)\t@er3\\+,ccr" \
239 gdb_test
"x" "ldc(.w|)\t@\\(0x1234(:16|),er3\\),ccr" \
240 "ldc.w @(0x1234:16,er3),ccr"
241 gdb_test
"x" "ldc(.w|)\t@\\(0x12345678(:32|),er3\\),ccr" \
242 "ldc.w @(0x12345678:32,er3),ccr"
243 gdb_test
"x" "ldc(.w|)\t@0x1234(:16|),ccr" \
244 "ldc.w @0x1234:16,ccr"
245 gdb_test
"x" "ldc(.w|)\t@0x12345678(:32|),ccr" \
246 "ldc.w @0x12345678:32,ccr"
247 gdb_test
"x" "ldc(.b|)\t#0x12(:8|),exr" \
249 gdb_test
"x" "ldc(.b|)\tr3h,exr" \
251 gdb_test
"x" "ldc(.w|)\t@er3,exr" \
253 gdb_test
"x" "ldc(.w|)\t@er3\\+,exr" \
255 gdb_test
"x" "ldc(.w|)\t@\\(0x1234(:16|),er3\\),exr" \
256 "ldc.w @(0x1234:16,er3),exr"
257 gdb_test
"x" "ldc(.w|)\t@\\(0x12345678(:32|),er3\\),exr" \
258 "ldc.w @(0x12345678:32,er3),exr"
259 gdb_test
"x" "ldc(.w|)\t@0x1234(:16|),exr" \
260 "ldc.w @0x1234:16,exr"
261 gdb_test
"x" "ldc(.w|)\t@0x12345678(:32|),exr" \
262 "ldc.w @0x12345678:32,exr"
263 gdb_test
"x" "stc(.b|)\tccr,r1h" \
265 gdb_test
"x" "stc(.w|)\tccr,@er1" \
267 gdb_test
"x" "stc(.w|)\tccr,@-er1" \
269 gdb_test
"x" "stc(.w|)\tccr,@\\(0x1234(:16|),er1\\)" \
270 "stc.w ccr,@(0x1234:16,er1)"
271 gdb_test
"x" "stc(.w|)\tccr,@\\(0x12345678(:32|),er1\\)" \
272 "stc.w ccr,@(0x12345678:32,er1)"
273 gdb_test
"x" "stc(.w|)\tccr,@0x1234(:16|)" \
274 "stc.w ccr,@0x1234:16"
275 gdb_test
"x" "stc(.w|)\tccr,@0x12345678(:32|)" \
276 "stc.w ccr,@0x12345678:32"
277 gdb_test
"x" "stc(.b|)\texr,r1h" \
279 gdb_test
"x" "stc(.w|)\texr,@er1" \
281 gdb_test
"x" "stc(.w|)\texr,@-er1" \
283 gdb_test
"x" "stc(.w|)\texr,@\\(0x1234(:16|),er1\\)" \
284 "stc.w exr,@(0x1234:16,er1)"
285 gdb_test
"x" "stc(.w|)\texr,@\\(0x12345678(:32|),er1\\)" \
286 "stc.w exr,@(0x12345678:32,er1)"
287 gdb_test
"x" "stc(.w|)\texr,@0x1234(:16|)" \
288 "stc.w exr,@0x1234:16"
289 gdb_test
"x" "stc(.w|)\texr,@0x12345678(:32|)" \
290 "stc.w exr,@0x12345678:32"
291 gdb_test
"x" "orc(.b|)\t#0x12(:8|),ccr" \
293 gdb_test
"x" "orc(.b|)\t#0x12(:8|),exr" \
295 gdb_test
"x" "xorc(.b|)\t#0x12(:8|),ccr" \
297 gdb_test
"x" "xorc(.b|)\t#0x12(:8|),exr" \
299 gdb_test
"x" "andc(.b|)\t#0x12(:8|),ccr" \
301 gdb_test
"x" "andc(.b|)\t#0x12(:8|),exr" \
303 gdb_test
"x" "sleep\[ \t\]*" \
305 gdb_test
"x" "nop\[ \t\]*" \