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