1 # Copyright
(C
) 2003-2019 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
)
18 if ![istarget
"h8300*-*-*"] {
19 verbose
"Tests ignored for all but h8300s based targets."
24 set testfile
"t12_bit"
25 set srcfile $
{srcdir
}/$
{subdir
}/$
{testfile
}.s
26 set objfile $
{objdir
}/$
{subdir
}/$
{testfile
}.o
27 set binfile $
{objdir
}/$
{subdir
}/$
{testfile
}.x
30 set link
-flags
"-m h8300sxelf"
33 if {[target_assemble $srcfile $objfile
"${asm-flags}"] != ""} then {
34 untested
"failed to assemble"
38 if {[target_link $objfile $binfile
"${link-flags}"] != ""} then {
39 untested
"failed to link"
44 gdb_reinitialize_dir $srcdir
/$subdir
47 gdb_test
"x /i start" "bset\t#0x7,r1h" \
49 gdb_test
"x" "bset\t#0x7,@er1" \
51 gdb_test
"x" "bset\t#0x7,@0x12(:8|)" \
53 gdb_test
"x" "bset\t#0x7,@0x1234(:16|)" \
54 "bset #0x7,@0x1234:16"
55 gdb_test
"x" "bset\t#0x7,@0x12345678(:32|)" \
56 "bset #0x7,@0x12345678:32"
57 gdb_test
"x" "bset\tr3h,r1h" \
59 gdb_test
"x" "bset\tr3h,@er1" \
61 gdb_test
"x" "bset\tr3h,@0x12(:8|)" \
63 gdb_test
"x" "bset\tr3h,@0x1234(:16|)" \
65 gdb_test
"x" "bset\tr3h,@0x12345678(:32|)" \
66 "bset r3h,@0x12345678:32"
67 gdb_test
"x" "bset/eq\t#0x7,@er1" \
69 gdb_test
"x" "bset/eq\t#0x7,@0x12(:8|)" \
70 "bset/eq #0x7,@0x12:8"
71 gdb_test
"x" "bset/eq\t#0x7,@0x1234(:16|)" \
72 "bset/eq #0x7,@0x1234:16"
73 gdb_test
"x" "bset/eq\t#0x7,@0x12345678(:32|)" \
74 "bset/eq #0x7,@0x12345678:32"
75 gdb_test
"x" "bset/eq\tr3h,@er1" \
77 gdb_test
"x" "bset/eq\tr3h,@0x12(:8|)" \
79 gdb_test
"x" "bset/eq\tr3h,@0x1234(:16|)" \
80 "bset/eq r3h,@0x1234:16"
81 gdb_test
"x" "bset/eq\tr3h,@0x12345678(:32|)" \
82 "bset/eq r3h,@0x12345678:32"
83 gdb_test
"x" "bset/ne\t#0x7,@er1" \
85 gdb_test
"x" "bset/ne\t#0x7,@0x12(:8|)" \
86 "bset/ne #0x7,@0x12:8"
87 gdb_test
"x" "bset/ne\t#0x7,@0x1234(:16|)" \
88 "bset/ne #0x7,@0x1234:16"
89 gdb_test
"x" "bset/ne\t#0x7,@0x12345678(:32|)" \
90 "bset/ne #0x7,@0x12345678:32"
91 gdb_test
"x" "bset/ne\tr3h,@er1" \
93 gdb_test
"x" "bset/ne\tr3h,@0x12(:8|)" \
95 gdb_test
"x" "bset/ne\tr3h,@0x1234(:16|)" \
96 "bset/ne r3h,@0x1234:16"
97 gdb_test
"x" "bset/ne\tr3h,@0x12345678(:32|)" \
98 "bset/ne r3h,@0x12345678:32"
99 gdb_test
"x" "bnot\t#0x7,r1h" \
101 gdb_test
"x" "bnot\t#0x7,@er1" \
103 gdb_test
"x" "bnot\t#0x7,@0x12(:8|)" \
105 gdb_test
"x" "bnot\t#0x7,@0x1234(:16|)" \
106 "bnot #0x7,@0x1234:16"
107 gdb_test
"x" "bnot\t#0x7,@0x12345678(:32|)" \
108 "bnot #0x7,@0x12345678:32"
109 gdb_test
"x" "bnot\tr3h,r1h" \
111 gdb_test
"x" "bnot\tr3h,@er1" \
113 gdb_test
"x" "bnot\tr3h,@0x12(:8|)" \
115 gdb_test
"x" "bnot\tr3h,@0x1234(:16|)" \
116 "bnot r3h,@0x1234:16"
117 gdb_test
"x" "bnot\tr3h,@0x12345678(:32|)" \
118 "bnot r3h,@0x12345678:32"
119 gdb_test
"x" "bclr\t#0x7,r1h" \
121 gdb_test
"x" "bclr\t#0x7,@er1" \
123 gdb_test
"x" "bclr\t#0x7,@0x12(:8|)" \
125 gdb_test
"x" "bclr\t#0x7,@0x1234(:16|)" \
126 "bclr #0x7,@0x1234:16"
127 gdb_test
"x" "bclr\t#0x7,@0x12345678(:32|)" \
128 "bclr #0x7,@0x12345678:32"
129 gdb_test
"x" "bclr\tr3h,r1h" \
131 gdb_test
"x" "bclr\tr3h,@er1" \
133 gdb_test
"x" "bclr\tr3h,@0x12(:8|)" \
135 gdb_test
"x" "bclr\tr3h,@0x1234(:16|)" \
136 "bclr r3h,@0x1234:16"
137 gdb_test
"x" "bclr\tr3h,@0x12345678(:32|)" \
138 "bclr r3h,@0x12345678:32"
139 gdb_test
"x" "bclr/eq\t#0x7,@er1" \
141 gdb_test
"x" "bclr/eq\t#0x7,@0x12(:8|)" \
142 "bclr/eq #0x7,@0x12:8"
143 gdb_test
"x" "bclr/eq\t#0x7,@0x1234(:16|)" \
144 "bclr/eq #0x7,@0x1234:16"
145 gdb_test
"x" "bclr/eq\t#0x7,@0x12345678(:32|)" \
146 "bclr/eq #0x7,@0x12345678:32"
147 gdb_test
"x" "bclr/eq\tr3h,@er1" \
149 gdb_test
"x" "bclr/eq\tr3h,@0x12(:8|)" \
150 "bclr/eq r3h,@0x12:8"
151 gdb_test
"x" "bclr/eq\tr3h,@0x1234(:16|)" \
152 "bclr/eq r3h,@0x1234:16"
153 gdb_test
"x" "bclr/eq\tr3h,@0x12345678(:32|)" \
154 "bclr/eq r3h,@0x12345678:32"
155 gdb_test
"x" "bclr/ne\t#0x7,@er1" \
157 gdb_test
"x" "bclr/ne\t#0x7,@0x12(:8|)" \
158 "bclr/ne #0x7,@0x12:8"
159 gdb_test
"x" "bclr/ne\t#0x7,@0x1234(:16|)" \
160 "bclr/ne #0x7,@0x1234:16"
161 gdb_test
"x" "bclr/ne\t#0x7,@0x12345678(:32|)" \
162 "bclr/ne #0x7,@0x12345678:32"
163 gdb_test
"x" "bclr/ne\tr3h,@er1" \
165 gdb_test
"x" "bclr/ne\tr3h,@0x12(:8|)" \
166 "bclr/ne r3h,@0x12:8"
167 gdb_test
"x" "bclr/ne\tr3h,@0x1234(:16|)" \
168 "bclr/ne r3h,@0x1234:16"
169 gdb_test
"x" "bclr/ne\tr3h,@0x12345678(:32|)" \
170 "bclr/ne r3h,@0x12345678:32"
171 gdb_test
"x" "btst\t#0x7,r1h" \
173 gdb_test
"x" "btst\t#0x7,@er1" \
175 gdb_test
"x" "btst\t#0x7,@0x12(:8|)" \
177 gdb_test
"x" "btst\t#0x7,@0x1234(:16|)" \
178 "btst #0x7,@0x1234:16"
179 gdb_test
"x" "btst\t#0x7,@0x12345678(:32|)" \
180 "btst #0x7,@0x12345678:32"
181 gdb_test
"x" "btst\tr3h,r1h" \
183 gdb_test
"x" "btst\tr3h,@er1" \
185 gdb_test
"x" "btst\tr3h,@0x12(:8|)" \
187 gdb_test
"x" "btst\tr3h,@0x1234(:16|)" \
188 "btst r3h,@0x1234:16"
189 gdb_test
"x" "btst\tr3h,@0x12345678(:32|)" \
190 "btst r3h,@0x12345678:32"
191 gdb_test
"x" "bor\t#0x7,r1h" \
193 gdb_test
"x" "bor\t#0x7,@er1" \
195 gdb_test
"x" "bor\t#0x7,@0x12(:8|)" \
197 gdb_test
"x" "bor\t#0x7,@0x1234(:16|)" \
198 "bor #0x7,@0x1234:16"
199 gdb_test
"x" "bor\t#0x7,@0x12345678(:32|)" \
200 "bor #0x7,@0x12345678:32"
201 gdb_test
"x" "bior\t#0x7,r1h" \
203 gdb_test
"x" "bior\t#0x7,@er1" \
205 gdb_test
"x" "bior\t#0x7,@0x12(:8|)" \
207 gdb_test
"x" "bior\t#0x7,@0x1234(:16|)" \
208 "bior #0x7,@0x1234:16"
209 gdb_test
"x" "bior\t#0x7,@0x12345678(:32|)" \
210 "bior #0x7,@0x12345678:32"
211 gdb_test
"x" "bxor\t#0x7,r1h" \
213 gdb_test
"x" "bxor\t#0x7,@er1" \
215 gdb_test
"x" "bxor\t#0x7,@0x12(:8|)" \
217 gdb_test
"x" "bxor\t#0x7,@0x1234(:16|)" \
218 "bxor #0x7,@0x1234:16"
219 gdb_test
"x" "bxor\t#0x7,@0x12345678(:32|)" \
220 "bxor #0x7,@0x12345678:32"
221 gdb_test
"x" "bixor\t#0x7,r1h" \
223 gdb_test
"x" "bixor\t#0x7,@er1" \
225 gdb_test
"x" "bixor\t#0x7,@0x12(:8|)" \
227 gdb_test
"x" "bixor\t#0x7,@0x1234(:16|)" \
228 "bixor #0x7,@0x1234:16"
229 gdb_test
"x" "bixor\t#0x7,@0x12345678(:32|)" \
230 "bixor #0x7,@0x12345678:32"
231 gdb_test
"x" "band\t#0x7,r1h" \
233 gdb_test
"x" "band\t#0x7,@er1" \
235 gdb_test
"x" "band\t#0x7,@0x12(:8|)" \
237 gdb_test
"x" "band\t#0x7,@0x1234(:16|)" \
238 "band #0x7,@0x1234:16"
239 gdb_test
"x" "band\t#0x7,@0x12345678(:32|)" \
240 "band #0x7,@0x12345678:32"
241 gdb_test
"x" "biand\t#0x7,r1h" \
243 gdb_test
"x" "biand\t#0x7,@er1" \
245 gdb_test
"x" "biand\t#0x7,@0x12(:8|)" \
247 gdb_test
"x" "biand\t#0x7,@0x1234(:16|)" \
248 "biand #0x7,@0x1234:16"
249 gdb_test
"x" "biand\t#0x7,@0x12345678(:32|)" \
250 "biand #0x7,@0x12345678:32"
251 gdb_test
"x" "bld\t#0x7,r1h" \
253 gdb_test
"x" "bld\t#0x7,@er1" \
255 gdb_test
"x" "bld\t#0x7,@0x12(:8|)" \
257 gdb_test
"x" "bld\t#0x7,@0x1234(:16|)" \
258 "bld #0x7,@0x1234:16"
259 gdb_test
"x" "bld\t#0x7,@0x12345678(:32|)" \
260 "bld #0x7,@0x12345678:32"
261 gdb_test
"x" "bild\t#0x7,r1h" \
263 gdb_test
"x" "bild\t#0x7,@er1" \
265 gdb_test
"x" "bild\t#0x7,@0x12(:8|)" \
267 gdb_test
"x" "bild\t#0x7,@0x1234(:16|)" \
268 "bild #0x7,@0x1234:16"
269 gdb_test
"x" "bild\t#0x7,@0x12345678(:32|)" \
270 "bild #0x7,@0x12345678:32"
271 gdb_test
"x" "bst\t#0x7,r1h" \
273 gdb_test
"x" "bst\t#0x7,@er1" \
275 gdb_test
"x" "bst\t#0x7,@0x12(:8|)" \
277 gdb_test
"x" "bst\t#0x7,@0x1234(:16|)" \
278 "bst #0x7,@0x1234:16"
279 gdb_test
"x" "bst\t#0x7,@0x12345678(:32|)" \
280 "bst #0x7,@0x12345678:32"
281 gdb_test
"x" "bstz\t#0x7,@er1" \
283 gdb_test
"x" "bstz\t#0x7,@0x12(:8|)" \
285 gdb_test
"x" "bstz\t#0x7,@0x1234(:16|)" \
286 "bstz #0x7,@0x1234:16"
287 gdb_test
"x" "bstz\t#0x7,@0x12345678(:32|)" \
288 "bstz #0x7,@0x12345678:32"
289 gdb_test
"x" "bist\t#0x7,r1h" \
291 gdb_test
"x" "bist\t#0x7,@er1" \
293 gdb_test
"x" "bist\t#0x7,@0x12(:8|)" \
295 gdb_test
"x" "bist\t#0x7,@0x1234(:16|)" \
296 "bist #0x7,@0x1234:16"
297 gdb_test
"x" "bist\t#0x7,@0x12345678(:32|)" \
298 "bist #0x7,@0x12345678:32"
299 gdb_test
"x" "bistz\t#0x7,@er1" \
301 gdb_test
"x" "bistz\t#0x7,@0x12(:8|)" \
303 gdb_test
"x" "bistz\t#0x7,@0x1234(:16|)" \
304 "bistz #0x7,@0x1234:16"
305 gdb_test
"x" "bistz\t#0x7,@0x12345678(:32|)" \
306 "bistz #0x7,@0x12345678:32"
307 gdb_test
"x" "bfld\t#0x34(:8|),@er1,r3h" \
308 "bfld #0x34:8,@er1,r3h"
309 gdb_test
"x" "bfld\t#0x34(:8|),@0x12(:8|),r3h" \
310 "bfld #0x34:8,@0x12:8,r3h"
311 gdb_test
"x" "bfld\t#0x34(:8|),@0x1234(:16|),r3h" \
312 "bfld #0x34:8,@0x1234:16,r3h"
313 gdb_test
"x" "bfld\t#0x34(:8|),@0x12345678(:32|),r3h" \
314 "bfld #0x34:8,@0x12345678:32,r3h"
315 gdb_test
"x" "bfst\tr3h,#0x34(:8|),@er1" \
316 "bfst r3h,#0x34:8,@er1"
317 gdb_test
"x" "bfst\tr3h,#0x34(:8|),@0x12(:8|)" \
318 "bfst r3h,#0x34:8,@0x12:8"
319 gdb_test
"x" "bfst\tr3h,#0x34(:8|),@0x1234(:16|)" \
320 "bfst r3h,#0x34:8,@0x1234:16"
321 gdb_test
"x" "bfst\tr3h,#0x34(:8|),@0x12345678(:32|)" \
322 "bfst r3h,#0x34:8,@0x12345678:32"