1 # Copyright
(C
) 2003-2024 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 require
{istarget
"h8300*-*-*"}
21 set testfile
"t12_bit"
22 set srcfile $
{srcdir
}/$
{subdir
}/$
{testfile
}.s
23 set objfile $
{objdir
}/$
{subdir
}/$
{testfile
}.o
24 set binfile $
{objdir
}/$
{subdir
}/$
{testfile
}.x
27 set link
-flags
"-m h8300sxelf"
30 if {[target_assemble $srcfile $objfile
"${asm-flags}"] != ""} {
31 untested
"failed to assemble"
35 if {[target_link $objfile $binfile
"${link-flags}"] != ""} {
36 untested
"failed to link"
41 gdb_reinitialize_dir $srcdir
/$subdir
44 gdb_test
"x /i start" "bset\t#0x7,r1h" \
46 gdb_test
"x" "bset\t#0x7,@er1" \
48 gdb_test
"x" "bset\t#0x7,@0x12(:8|)" \
50 gdb_test
"x" "bset\t#0x7,@0x1234(:16|)" \
51 "bset #0x7,@0x1234:16"
52 gdb_test
"x" "bset\t#0x7,@0x12345678(:32|)" \
53 "bset #0x7,@0x12345678:32"
54 gdb_test
"x" "bset\tr3h,r1h" \
56 gdb_test
"x" "bset\tr3h,@er1" \
58 gdb_test
"x" "bset\tr3h,@0x12(:8|)" \
60 gdb_test
"x" "bset\tr3h,@0x1234(:16|)" \
62 gdb_test
"x" "bset\tr3h,@0x12345678(:32|)" \
63 "bset r3h,@0x12345678:32"
64 gdb_test
"x" "bset/eq\t#0x7,@er1" \
66 gdb_test
"x" "bset/eq\t#0x7,@0x12(:8|)" \
67 "bset/eq #0x7,@0x12:8"
68 gdb_test
"x" "bset/eq\t#0x7,@0x1234(:16|)" \
69 "bset/eq #0x7,@0x1234:16"
70 gdb_test
"x" "bset/eq\t#0x7,@0x12345678(:32|)" \
71 "bset/eq #0x7,@0x12345678:32"
72 gdb_test
"x" "bset/eq\tr3h,@er1" \
74 gdb_test
"x" "bset/eq\tr3h,@0x12(:8|)" \
76 gdb_test
"x" "bset/eq\tr3h,@0x1234(:16|)" \
77 "bset/eq r3h,@0x1234:16"
78 gdb_test
"x" "bset/eq\tr3h,@0x12345678(:32|)" \
79 "bset/eq r3h,@0x12345678:32"
80 gdb_test
"x" "bset/ne\t#0x7,@er1" \
82 gdb_test
"x" "bset/ne\t#0x7,@0x12(:8|)" \
83 "bset/ne #0x7,@0x12:8"
84 gdb_test
"x" "bset/ne\t#0x7,@0x1234(:16|)" \
85 "bset/ne #0x7,@0x1234:16"
86 gdb_test
"x" "bset/ne\t#0x7,@0x12345678(:32|)" \
87 "bset/ne #0x7,@0x12345678:32"
88 gdb_test
"x" "bset/ne\tr3h,@er1" \
90 gdb_test
"x" "bset/ne\tr3h,@0x12(:8|)" \
92 gdb_test
"x" "bset/ne\tr3h,@0x1234(:16|)" \
93 "bset/ne r3h,@0x1234:16"
94 gdb_test
"x" "bset/ne\tr3h,@0x12345678(:32|)" \
95 "bset/ne r3h,@0x12345678:32"
96 gdb_test
"x" "bnot\t#0x7,r1h" \
98 gdb_test
"x" "bnot\t#0x7,@er1" \
100 gdb_test
"x" "bnot\t#0x7,@0x12(:8|)" \
102 gdb_test
"x" "bnot\t#0x7,@0x1234(:16|)" \
103 "bnot #0x7,@0x1234:16"
104 gdb_test
"x" "bnot\t#0x7,@0x12345678(:32|)" \
105 "bnot #0x7,@0x12345678:32"
106 gdb_test
"x" "bnot\tr3h,r1h" \
108 gdb_test
"x" "bnot\tr3h,@er1" \
110 gdb_test
"x" "bnot\tr3h,@0x12(:8|)" \
112 gdb_test
"x" "bnot\tr3h,@0x1234(:16|)" \
113 "bnot r3h,@0x1234:16"
114 gdb_test
"x" "bnot\tr3h,@0x12345678(:32|)" \
115 "bnot r3h,@0x12345678:32"
116 gdb_test
"x" "bclr\t#0x7,r1h" \
118 gdb_test
"x" "bclr\t#0x7,@er1" \
120 gdb_test
"x" "bclr\t#0x7,@0x12(:8|)" \
122 gdb_test
"x" "bclr\t#0x7,@0x1234(:16|)" \
123 "bclr #0x7,@0x1234:16"
124 gdb_test
"x" "bclr\t#0x7,@0x12345678(:32|)" \
125 "bclr #0x7,@0x12345678:32"
126 gdb_test
"x" "bclr\tr3h,r1h" \
128 gdb_test
"x" "bclr\tr3h,@er1" \
130 gdb_test
"x" "bclr\tr3h,@0x12(:8|)" \
132 gdb_test
"x" "bclr\tr3h,@0x1234(:16|)" \
133 "bclr r3h,@0x1234:16"
134 gdb_test
"x" "bclr\tr3h,@0x12345678(:32|)" \
135 "bclr r3h,@0x12345678:32"
136 gdb_test
"x" "bclr/eq\t#0x7,@er1" \
138 gdb_test
"x" "bclr/eq\t#0x7,@0x12(:8|)" \
139 "bclr/eq #0x7,@0x12:8"
140 gdb_test
"x" "bclr/eq\t#0x7,@0x1234(:16|)" \
141 "bclr/eq #0x7,@0x1234:16"
142 gdb_test
"x" "bclr/eq\t#0x7,@0x12345678(:32|)" \
143 "bclr/eq #0x7,@0x12345678:32"
144 gdb_test
"x" "bclr/eq\tr3h,@er1" \
146 gdb_test
"x" "bclr/eq\tr3h,@0x12(:8|)" \
147 "bclr/eq r3h,@0x12:8"
148 gdb_test
"x" "bclr/eq\tr3h,@0x1234(:16|)" \
149 "bclr/eq r3h,@0x1234:16"
150 gdb_test
"x" "bclr/eq\tr3h,@0x12345678(:32|)" \
151 "bclr/eq r3h,@0x12345678:32"
152 gdb_test
"x" "bclr/ne\t#0x7,@er1" \
154 gdb_test
"x" "bclr/ne\t#0x7,@0x12(:8|)" \
155 "bclr/ne #0x7,@0x12:8"
156 gdb_test
"x" "bclr/ne\t#0x7,@0x1234(:16|)" \
157 "bclr/ne #0x7,@0x1234:16"
158 gdb_test
"x" "bclr/ne\t#0x7,@0x12345678(:32|)" \
159 "bclr/ne #0x7,@0x12345678:32"
160 gdb_test
"x" "bclr/ne\tr3h,@er1" \
162 gdb_test
"x" "bclr/ne\tr3h,@0x12(:8|)" \
163 "bclr/ne r3h,@0x12:8"
164 gdb_test
"x" "bclr/ne\tr3h,@0x1234(:16|)" \
165 "bclr/ne r3h,@0x1234:16"
166 gdb_test
"x" "bclr/ne\tr3h,@0x12345678(:32|)" \
167 "bclr/ne r3h,@0x12345678:32"
168 gdb_test
"x" "btst\t#0x7,r1h" \
170 gdb_test
"x" "btst\t#0x7,@er1" \
172 gdb_test
"x" "btst\t#0x7,@0x12(:8|)" \
174 gdb_test
"x" "btst\t#0x7,@0x1234(:16|)" \
175 "btst #0x7,@0x1234:16"
176 gdb_test
"x" "btst\t#0x7,@0x12345678(:32|)" \
177 "btst #0x7,@0x12345678:32"
178 gdb_test
"x" "btst\tr3h,r1h" \
180 gdb_test
"x" "btst\tr3h,@er1" \
182 gdb_test
"x" "btst\tr3h,@0x12(:8|)" \
184 gdb_test
"x" "btst\tr3h,@0x1234(:16|)" \
185 "btst r3h,@0x1234:16"
186 gdb_test
"x" "btst\tr3h,@0x12345678(:32|)" \
187 "btst r3h,@0x12345678:32"
188 gdb_test
"x" "bor\t#0x7,r1h" \
190 gdb_test
"x" "bor\t#0x7,@er1" \
192 gdb_test
"x" "bor\t#0x7,@0x12(:8|)" \
194 gdb_test
"x" "bor\t#0x7,@0x1234(:16|)" \
195 "bor #0x7,@0x1234:16"
196 gdb_test
"x" "bor\t#0x7,@0x12345678(:32|)" \
197 "bor #0x7,@0x12345678:32"
198 gdb_test
"x" "bior\t#0x7,r1h" \
200 gdb_test
"x" "bior\t#0x7,@er1" \
202 gdb_test
"x" "bior\t#0x7,@0x12(:8|)" \
204 gdb_test
"x" "bior\t#0x7,@0x1234(:16|)" \
205 "bior #0x7,@0x1234:16"
206 gdb_test
"x" "bior\t#0x7,@0x12345678(:32|)" \
207 "bior #0x7,@0x12345678:32"
208 gdb_test
"x" "bxor\t#0x7,r1h" \
210 gdb_test
"x" "bxor\t#0x7,@er1" \
212 gdb_test
"x" "bxor\t#0x7,@0x12(:8|)" \
214 gdb_test
"x" "bxor\t#0x7,@0x1234(:16|)" \
215 "bxor #0x7,@0x1234:16"
216 gdb_test
"x" "bxor\t#0x7,@0x12345678(:32|)" \
217 "bxor #0x7,@0x12345678:32"
218 gdb_test
"x" "bixor\t#0x7,r1h" \
220 gdb_test
"x" "bixor\t#0x7,@er1" \
222 gdb_test
"x" "bixor\t#0x7,@0x12(:8|)" \
224 gdb_test
"x" "bixor\t#0x7,@0x1234(:16|)" \
225 "bixor #0x7,@0x1234:16"
226 gdb_test
"x" "bixor\t#0x7,@0x12345678(:32|)" \
227 "bixor #0x7,@0x12345678:32"
228 gdb_test
"x" "band\t#0x7,r1h" \
230 gdb_test
"x" "band\t#0x7,@er1" \
232 gdb_test
"x" "band\t#0x7,@0x12(:8|)" \
234 gdb_test
"x" "band\t#0x7,@0x1234(:16|)" \
235 "band #0x7,@0x1234:16"
236 gdb_test
"x" "band\t#0x7,@0x12345678(:32|)" \
237 "band #0x7,@0x12345678:32"
238 gdb_test
"x" "biand\t#0x7,r1h" \
240 gdb_test
"x" "biand\t#0x7,@er1" \
242 gdb_test
"x" "biand\t#0x7,@0x12(:8|)" \
244 gdb_test
"x" "biand\t#0x7,@0x1234(:16|)" \
245 "biand #0x7,@0x1234:16"
246 gdb_test
"x" "biand\t#0x7,@0x12345678(:32|)" \
247 "biand #0x7,@0x12345678:32"
248 gdb_test
"x" "bld\t#0x7,r1h" \
250 gdb_test
"x" "bld\t#0x7,@er1" \
252 gdb_test
"x" "bld\t#0x7,@0x12(:8|)" \
254 gdb_test
"x" "bld\t#0x7,@0x1234(:16|)" \
255 "bld #0x7,@0x1234:16"
256 gdb_test
"x" "bld\t#0x7,@0x12345678(:32|)" \
257 "bld #0x7,@0x12345678:32"
258 gdb_test
"x" "bild\t#0x7,r1h" \
260 gdb_test
"x" "bild\t#0x7,@er1" \
262 gdb_test
"x" "bild\t#0x7,@0x12(:8|)" \
264 gdb_test
"x" "bild\t#0x7,@0x1234(:16|)" \
265 "bild #0x7,@0x1234:16"
266 gdb_test
"x" "bild\t#0x7,@0x12345678(:32|)" \
267 "bild #0x7,@0x12345678:32"
268 gdb_test
"x" "bst\t#0x7,r1h" \
270 gdb_test
"x" "bst\t#0x7,@er1" \
272 gdb_test
"x" "bst\t#0x7,@0x12(:8|)" \
274 gdb_test
"x" "bst\t#0x7,@0x1234(:16|)" \
275 "bst #0x7,@0x1234:16"
276 gdb_test
"x" "bst\t#0x7,@0x12345678(:32|)" \
277 "bst #0x7,@0x12345678:32"
278 gdb_test
"x" "bstz\t#0x7,@er1" \
280 gdb_test
"x" "bstz\t#0x7,@0x12(:8|)" \
282 gdb_test
"x" "bstz\t#0x7,@0x1234(:16|)" \
283 "bstz #0x7,@0x1234:16"
284 gdb_test
"x" "bstz\t#0x7,@0x12345678(:32|)" \
285 "bstz #0x7,@0x12345678:32"
286 gdb_test
"x" "bist\t#0x7,r1h" \
288 gdb_test
"x" "bist\t#0x7,@er1" \
290 gdb_test
"x" "bist\t#0x7,@0x12(:8|)" \
292 gdb_test
"x" "bist\t#0x7,@0x1234(:16|)" \
293 "bist #0x7,@0x1234:16"
294 gdb_test
"x" "bist\t#0x7,@0x12345678(:32|)" \
295 "bist #0x7,@0x12345678:32"
296 gdb_test
"x" "bistz\t#0x7,@er1" \
298 gdb_test
"x" "bistz\t#0x7,@0x12(:8|)" \
300 gdb_test
"x" "bistz\t#0x7,@0x1234(:16|)" \
301 "bistz #0x7,@0x1234:16"
302 gdb_test
"x" "bistz\t#0x7,@0x12345678(:32|)" \
303 "bistz #0x7,@0x12345678:32"
304 gdb_test
"x" "bfld\t#0x34(:8|),@er1,r3h" \
305 "bfld #0x34:8,@er1,r3h"
306 gdb_test
"x" "bfld\t#0x34(:8|),@0x12(:8|),r3h" \
307 "bfld #0x34:8,@0x12:8,r3h"
308 gdb_test
"x" "bfld\t#0x34(:8|),@0x1234(:16|),r3h" \
309 "bfld #0x34:8,@0x1234:16,r3h"
310 gdb_test
"x" "bfld\t#0x34(:8|),@0x12345678(:32|),r3h" \
311 "bfld #0x34:8,@0x12345678:32,r3h"
312 gdb_test
"x" "bfst\tr3h,#0x34(:8|),@er1" \
313 "bfst r3h,#0x34:8,@er1"
314 gdb_test
"x" "bfst\tr3h,#0x34(:8|),@0x12(:8|)" \
315 "bfst r3h,#0x34:8,@0x12:8"
316 gdb_test
"x" "bfst\tr3h,#0x34(:8|),@0x1234(:16|)" \
317 "bfst r3h,#0x34:8,@0x1234:16"
318 gdb_test
"x" "bfst\tr3h,#0x34(:8|),@0x12345678(:32|)" \
319 "bfst r3h,#0x34:8,@0x12345678:32"