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