1 # Copyright (C) 2003, 2007, 2008, 2009, 2010, 2011
2 # Free Software Foundation, Inc.
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.
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.
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/>.
17 # This file was written by Michael Snyder (msnyder@redhat.com)
23 if ![istarget "h8300*-*-*"] {
24 verbose "Tests ignored for all but h8300s based targets."
29 set testfile "t12_bit"
30 set srcfile ${srcdir}/${subdir}/${testfile}.s
31 set objfile ${objdir}/${subdir}/${testfile}.o
32 set binfile ${objdir}/${subdir}/${testfile}.x
35 set link-flags "-m h8300sxelf";
38 if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} then {
43 if {[target_link $objfile $binfile "${link-flags}"] != ""} then {
49 gdb_reinitialize_dir $srcdir/$subdir
52 gdb_test "x /i start" "bset\t#0x7,r1h" \
54 gdb_test "x" "bset\t#0x7,@er1" \
56 gdb_test "x" "bset\t#0x7,@0x12(:8|)" \
58 gdb_test "x" "bset\t#0x7,@0x1234(:16|)" \
59 "bset #0x7,@0x1234:16"
60 gdb_test "x" "bset\t#0x7,@0x12345678(:32|)" \
61 "bset #0x7,@0x12345678:32"
62 gdb_test "x" "bset\tr3h,r1h" \
64 gdb_test "x" "bset\tr3h,@er1" \
66 gdb_test "x" "bset\tr3h,@0x12(:8|)" \
68 gdb_test "x" "bset\tr3h,@0x1234(:16|)" \
70 gdb_test "x" "bset\tr3h,@0x12345678(:32|)" \
71 "bset r3h,@0x12345678:32"
72 gdb_test "x" "bset/eq\t#0x7,@er1" \
74 gdb_test "x" "bset/eq\t#0x7,@0x12(:8|)" \
75 "bset/eq #0x7,@0x12:8"
76 gdb_test "x" "bset/eq\t#0x7,@0x1234(:16|)" \
77 "bset/eq #0x7,@0x1234:16"
78 gdb_test "x" "bset/eq\t#0x7,@0x12345678(:32|)" \
79 "bset/eq #0x7,@0x12345678:32"
80 gdb_test "x" "bset/eq\tr3h,@er1" \
82 gdb_test "x" "bset/eq\tr3h,@0x12(:8|)" \
84 gdb_test "x" "bset/eq\tr3h,@0x1234(:16|)" \
85 "bset/eq r3h,@0x1234:16"
86 gdb_test "x" "bset/eq\tr3h,@0x12345678(:32|)" \
87 "bset/eq r3h,@0x12345678:32"
88 gdb_test "x" "bset/ne\t#0x7,@er1" \
90 gdb_test "x" "bset/ne\t#0x7,@0x12(:8|)" \
91 "bset/ne #0x7,@0x12:8"
92 gdb_test "x" "bset/ne\t#0x7,@0x1234(:16|)" \
93 "bset/ne #0x7,@0x1234:16"
94 gdb_test "x" "bset/ne\t#0x7,@0x12345678(:32|)" \
95 "bset/ne #0x7,@0x12345678:32"
96 gdb_test "x" "bset/ne\tr3h,@er1" \
98 gdb_test "x" "bset/ne\tr3h,@0x12(:8|)" \
100 gdb_test "x" "bset/ne\tr3h,@0x1234(:16|)" \
101 "bset/ne r3h,@0x1234:16"
102 gdb_test "x" "bset/ne\tr3h,@0x12345678(:32|)" \
103 "bset/ne r3h,@0x12345678:32"
104 gdb_test "x" "bnot\t#0x7,r1h" \
106 gdb_test "x" "bnot\t#0x7,@er1" \
108 gdb_test "x" "bnot\t#0x7,@0x12(:8|)" \
110 gdb_test "x" "bnot\t#0x7,@0x1234(:16|)" \
111 "bnot #0x7,@0x1234:16"
112 gdb_test "x" "bnot\t#0x7,@0x12345678(:32|)" \
113 "bnot #0x7,@0x12345678:32"
114 gdb_test "x" "bnot\tr3h,r1h" \
116 gdb_test "x" "bnot\tr3h,@er1" \
118 gdb_test "x" "bnot\tr3h,@0x12(:8|)" \
120 gdb_test "x" "bnot\tr3h,@0x1234(:16|)" \
121 "bnot r3h,@0x1234:16"
122 gdb_test "x" "bnot\tr3h,@0x12345678(:32|)" \
123 "bnot r3h,@0x12345678:32"
124 gdb_test "x" "bclr\t#0x7,r1h" \
126 gdb_test "x" "bclr\t#0x7,@er1" \
128 gdb_test "x" "bclr\t#0x7,@0x12(:8|)" \
130 gdb_test "x" "bclr\t#0x7,@0x1234(:16|)" \
131 "bclr #0x7,@0x1234:16"
132 gdb_test "x" "bclr\t#0x7,@0x12345678(:32|)" \
133 "bclr #0x7,@0x12345678:32"
134 gdb_test "x" "bclr\tr3h,r1h" \
136 gdb_test "x" "bclr\tr3h,@er1" \
138 gdb_test "x" "bclr\tr3h,@0x12(:8|)" \
140 gdb_test "x" "bclr\tr3h,@0x1234(:16|)" \
141 "bclr r3h,@0x1234:16"
142 gdb_test "x" "bclr\tr3h,@0x12345678(:32|)" \
143 "bclr r3h,@0x12345678:32"
144 gdb_test "x" "bclr/eq\t#0x7,@er1" \
146 gdb_test "x" "bclr/eq\t#0x7,@0x12(:8|)" \
147 "bclr/eq #0x7,@0x12:8"
148 gdb_test "x" "bclr/eq\t#0x7,@0x1234(:16|)" \
149 "bclr/eq #0x7,@0x1234:16"
150 gdb_test "x" "bclr/eq\t#0x7,@0x12345678(:32|)" \
151 "bclr/eq #0x7,@0x12345678:32"
152 gdb_test "x" "bclr/eq\tr3h,@er1" \
154 gdb_test "x" "bclr/eq\tr3h,@0x12(:8|)" \
155 "bclr/eq r3h,@0x12:8"
156 gdb_test "x" "bclr/eq\tr3h,@0x1234(:16|)" \
157 "bclr/eq r3h,@0x1234:16"
158 gdb_test "x" "bclr/eq\tr3h,@0x12345678(:32|)" \
159 "bclr/eq r3h,@0x12345678:32"
160 gdb_test "x" "bclr/ne\t#0x7,@er1" \
162 gdb_test "x" "bclr/ne\t#0x7,@0x12(:8|)" \
163 "bclr/ne #0x7,@0x12:8"
164 gdb_test "x" "bclr/ne\t#0x7,@0x1234(:16|)" \
165 "bclr/ne #0x7,@0x1234:16"
166 gdb_test "x" "bclr/ne\t#0x7,@0x12345678(:32|)" \
167 "bclr/ne #0x7,@0x12345678:32"
168 gdb_test "x" "bclr/ne\tr3h,@er1" \
170 gdb_test "x" "bclr/ne\tr3h,@0x12(:8|)" \
171 "bclr/ne r3h,@0x12:8"
172 gdb_test "x" "bclr/ne\tr3h,@0x1234(:16|)" \
173 "bclr/ne r3h,@0x1234:16"
174 gdb_test "x" "bclr/ne\tr3h,@0x12345678(:32|)" \
175 "bclr/ne r3h,@0x12345678:32"
176 gdb_test "x" "btst\t#0x7,r1h" \
178 gdb_test "x" "btst\t#0x7,@er1" \
180 gdb_test "x" "btst\t#0x7,@0x12(:8|)" \
182 gdb_test "x" "btst\t#0x7,@0x1234(:16|)" \
183 "btst #0x7,@0x1234:16"
184 gdb_test "x" "btst\t#0x7,@0x12345678(:32|)" \
185 "btst #0x7,@0x12345678:32"
186 gdb_test "x" "btst\tr3h,r1h" \
188 gdb_test "x" "btst\tr3h,@er1" \
190 gdb_test "x" "btst\tr3h,@0x12(:8|)" \
192 gdb_test "x" "btst\tr3h,@0x1234(:16|)" \
193 "btst r3h,@0x1234:16"
194 gdb_test "x" "btst\tr3h,@0x12345678(:32|)" \
195 "btst r3h,@0x12345678:32"
196 gdb_test "x" "bor\t#0x7,r1h" \
198 gdb_test "x" "bor\t#0x7,@er1" \
200 gdb_test "x" "bor\t#0x7,@0x12(:8|)" \
202 gdb_test "x" "bor\t#0x7,@0x1234(:16|)" \
203 "bor #0x7,@0x1234:16"
204 gdb_test "x" "bor\t#0x7,@0x12345678(:32|)" \
205 "bor #0x7,@0x12345678:32"
206 gdb_test "x" "bior\t#0x7,r1h" \
208 gdb_test "x" "bior\t#0x7,@er1" \
210 gdb_test "x" "bior\t#0x7,@0x12(:8|)" \
212 gdb_test "x" "bior\t#0x7,@0x1234(:16|)" \
213 "bior #0x7,@0x1234:16"
214 gdb_test "x" "bior\t#0x7,@0x12345678(:32|)" \
215 "bior #0x7,@0x12345678:32"
216 gdb_test "x" "bxor\t#0x7,r1h" \
218 gdb_test "x" "bxor\t#0x7,@er1" \
220 gdb_test "x" "bxor\t#0x7,@0x12(:8|)" \
222 gdb_test "x" "bxor\t#0x7,@0x1234(:16|)" \
223 "bxor #0x7,@0x1234:16"
224 gdb_test "x" "bxor\t#0x7,@0x12345678(:32|)" \
225 "bxor #0x7,@0x12345678:32"
226 gdb_test "x" "bixor\t#0x7,r1h" \
228 gdb_test "x" "bixor\t#0x7,@er1" \
230 gdb_test "x" "bixor\t#0x7,@0x12(:8|)" \
232 gdb_test "x" "bixor\t#0x7,@0x1234(:16|)" \
233 "bixor #0x7,@0x1234:16"
234 gdb_test "x" "bixor\t#0x7,@0x12345678(:32|)" \
235 "bixor #0x7,@0x12345678:32"
236 gdb_test "x" "band\t#0x7,r1h" \
238 gdb_test "x" "band\t#0x7,@er1" \
240 gdb_test "x" "band\t#0x7,@0x12(:8|)" \
242 gdb_test "x" "band\t#0x7,@0x1234(:16|)" \
243 "band #0x7,@0x1234:16"
244 gdb_test "x" "band\t#0x7,@0x12345678(:32|)" \
245 "band #0x7,@0x12345678:32"
246 gdb_test "x" "biand\t#0x7,r1h" \
248 gdb_test "x" "biand\t#0x7,@er1" \
250 gdb_test "x" "biand\t#0x7,@0x12(:8|)" \
252 gdb_test "x" "biand\t#0x7,@0x1234(:16|)" \
253 "biand #0x7,@0x1234:16"
254 gdb_test "x" "biand\t#0x7,@0x12345678(:32|)" \
255 "biand #0x7,@0x12345678:32"
256 gdb_test "x" "bld\t#0x7,r1h" \
258 gdb_test "x" "bld\t#0x7,@er1" \
260 gdb_test "x" "bld\t#0x7,@0x12(:8|)" \
262 gdb_test "x" "bld\t#0x7,@0x1234(:16|)" \
263 "bld #0x7,@0x1234:16"
264 gdb_test "x" "bld\t#0x7,@0x12345678(:32|)" \
265 "bld #0x7,@0x12345678:32"
266 gdb_test "x" "bild\t#0x7,r1h" \
268 gdb_test "x" "bild\t#0x7,@er1" \
270 gdb_test "x" "bild\t#0x7,@0x12(:8|)" \
272 gdb_test "x" "bild\t#0x7,@0x1234(:16|)" \
273 "bild #0x7,@0x1234:16"
274 gdb_test "x" "bild\t#0x7,@0x12345678(:32|)" \
275 "bild #0x7,@0x12345678:32"
276 gdb_test "x" "bst\t#0x7,r1h" \
278 gdb_test "x" "bst\t#0x7,@er1" \
280 gdb_test "x" "bst\t#0x7,@0x12(:8|)" \
282 gdb_test "x" "bst\t#0x7,@0x1234(:16|)" \
283 "bst #0x7,@0x1234:16"
284 gdb_test "x" "bst\t#0x7,@0x12345678(:32|)" \
285 "bst #0x7,@0x12345678:32"
286 gdb_test "x" "bstz\t#0x7,@er1" \
288 gdb_test "x" "bstz\t#0x7,@0x12(:8|)" \
290 gdb_test "x" "bstz\t#0x7,@0x1234(:16|)" \
291 "bstz #0x7,@0x1234:16"
292 gdb_test "x" "bstz\t#0x7,@0x12345678(:32|)" \
293 "bstz #0x7,@0x12345678:32"
294 gdb_test "x" "bist\t#0x7,r1h" \
296 gdb_test "x" "bist\t#0x7,@er1" \
298 gdb_test "x" "bist\t#0x7,@0x12(:8|)" \
300 gdb_test "x" "bist\t#0x7,@0x1234(:16|)" \
301 "bist #0x7,@0x1234:16"
302 gdb_test "x" "bist\t#0x7,@0x12345678(:32|)" \
303 "bist #0x7,@0x12345678:32"
304 gdb_test "x" "bistz\t#0x7,@er1" \
306 gdb_test "x" "bistz\t#0x7,@0x12(:8|)" \
308 gdb_test "x" "bistz\t#0x7,@0x1234(:16|)" \
309 "bistz #0x7,@0x1234:16"
310 gdb_test "x" "bistz\t#0x7,@0x12345678(:32|)" \
311 "bistz #0x7,@0x12345678:32"
312 gdb_test "x" "bfld\t#0x34(:8|),@er1,r3h" \
313 "bfld #0x34:8,@er1,r3h"
314 gdb_test "x" "bfld\t#0x34(:8|),@0x12(:8|),r3h" \
315 "bfld #0x34:8,@0x12:8,r3h"
316 gdb_test "x" "bfld\t#0x34(:8|),@0x1234(:16|),r3h" \
317 "bfld #0x34:8,@0x1234:16,r3h"
318 gdb_test "x" "bfld\t#0x34(:8|),@0x12345678(:32|),r3h" \
319 "bfld #0x34:8,@0x12345678:32,r3h"
320 gdb_test "x" "bfst\tr3h,#0x34(:8|),@er1" \
321 "bfst r3h,#0x34:8,@er1"
322 gdb_test "x" "bfst\tr3h,#0x34(:8|),@0x12(:8|)" \
323 "bfst r3h,#0x34:8,@0x12:8"
324 gdb_test "x" "bfst\tr3h,#0x34(:8|),@0x1234(:16|)" \
325 "bfst r3h,#0x34:8,@0x1234:16"
326 gdb_test "x" "bfst\tr3h,#0x34(:8|),@0x12345678(:32|)" \
327 "bfst r3h,#0x34:8,@0x12345678:32"