Commit | Line | Data |
---|---|---|
6aba47ca | 1 | # Copyright (C) 2003, 2007 Free Software Foundation, Inc. |
57ba3b85 MS |
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 2 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, write to the Free Software | |
15 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
16 | ||
17 | # Please email any bugs, comments, and/or additions to this file to: | |
18 | # bug-gdb@prep.ai.mit.edu | |
19 | ||
20 | # This file was written by Michael Snyder (msnyder@redhat.com) | |
21 | ||
22 | if $tracelevel then { | |
23 | strace $tracelevel | |
24 | } | |
25 | ||
26 | if ![istarget "h8300*-*-*"] { | |
27 | verbose "Tests ignored for all but h8300s based targets." | |
28 | return | |
29 | } | |
30 | ||
31 | set prms_id 0 | |
32 | set bug_id 0 | |
33 | ||
34 | set testfile "t12_bit" | |
35 | set srcfile ${srcdir}/${subdir}/${testfile}.s | |
36 | set objfile ${objdir}/${subdir}/${testfile}.o | |
37 | set binfile ${objdir}/${subdir}/${testfile}.x | |
38 | ||
39 | set asm-flags ""; | |
40 | set link-flags "-m h8300sxelf"; | |
41 | ||
42 | ||
43 | if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} then { | |
b60f0898 JB |
44 | untested t12_bit.exp |
45 | return -1 | |
57ba3b85 MS |
46 | } |
47 | ||
48 | if {[target_link $objfile $binfile "${link-flags}"] != ""} then { | |
b60f0898 JB |
49 | untested t12_bit.exp |
50 | return -1 | |
57ba3b85 MS |
51 | } |
52 | ||
53 | gdb_start | |
54 | gdb_reinitialize_dir $srcdir/$subdir | |
55 | gdb_load $binfile | |
56 | ||
57 | gdb_test "x /i _start" "bset\t#0x7,r1h" \ | |
58 | "bset #0x7,r1h" | |
59 | gdb_test "x" "bset\t#0x7,@er1" \ | |
60 | "bset #0x7,@er1" | |
61 | gdb_test "x" "bset\t#0x7,@0x12(:8|)" \ | |
62 | "bset #0x7,@0x12:8" | |
63 | gdb_test "x" "bset\t#0x7,@0x1234(:16|)" \ | |
64 | "bset #0x7,@0x1234:16" | |
65 | gdb_test "x" "bset\t#0x7,@0x12345678(:32|)" \ | |
66 | "bset #0x7,@0x12345678:32" | |
67 | gdb_test "x" "bset\tr3h,r1h" \ | |
68 | "bset r3h,r1h" | |
69 | gdb_test "x" "bset\tr3h,@er1" \ | |
70 | "bset r3h,@er1" | |
71 | gdb_test "x" "bset\tr3h,@0x12(:8|)" \ | |
72 | "bset r3h,@0x12:8" | |
73 | gdb_test "x" "bset\tr3h,@0x1234(:16|)" \ | |
74 | "bset r3h,@0x1234:16" | |
75 | gdb_test "x" "bset\tr3h,@0x12345678(:32|)" \ | |
76 | "bset r3h,@0x12345678:32" | |
77 | gdb_test "x" "bset/eq\t#0x7,@er1" \ | |
78 | "bset/eq #0x7,@er1" | |
79 | gdb_test "x" "bset/eq\t#0x7,@0x12(:8|)" \ | |
80 | "bset/eq #0x7,@0x12:8" | |
81 | gdb_test "x" "bset/eq\t#0x7,@0x1234(:16|)" \ | |
82 | "bset/eq #0x7,@0x1234:16" | |
83 | gdb_test "x" "bset/eq\t#0x7,@0x12345678(:32|)" \ | |
84 | "bset/eq #0x7,@0x12345678:32" | |
85 | gdb_test "x" "bset/eq\tr3h,@er1" \ | |
86 | "bset/eq r3h,@er1" | |
87 | gdb_test "x" "bset/eq\tr3h,@0x12(:8|)" \ | |
88 | "bset/eq r3h,@0x12:8" | |
89 | gdb_test "x" "bset/eq\tr3h,@0x1234(:16|)" \ | |
90 | "bset/eq r3h,@0x1234:16" | |
91 | gdb_test "x" "bset/eq\tr3h,@0x12345678(:32|)" \ | |
92 | "bset/eq r3h,@0x12345678:32" | |
93 | gdb_test "x" "bset/ne\t#0x7,@er1" \ | |
94 | "bset/ne #0x7,@er1" | |
95 | gdb_test "x" "bset/ne\t#0x7,@0x12(:8|)" \ | |
96 | "bset/ne #0x7,@0x12:8" | |
97 | gdb_test "x" "bset/ne\t#0x7,@0x1234(:16|)" \ | |
98 | "bset/ne #0x7,@0x1234:16" | |
99 | gdb_test "x" "bset/ne\t#0x7,@0x12345678(:32|)" \ | |
100 | "bset/ne #0x7,@0x12345678:32" | |
101 | gdb_test "x" "bset/ne\tr3h,@er1" \ | |
102 | "bset/ne r3h,@er1" | |
103 | gdb_test "x" "bset/ne\tr3h,@0x12(:8|)" \ | |
104 | "bset/ne r3h,@0x12:8" | |
105 | gdb_test "x" "bset/ne\tr3h,@0x1234(:16|)" \ | |
106 | "bset/ne r3h,@0x1234:16" | |
107 | gdb_test "x" "bset/ne\tr3h,@0x12345678(:32|)" \ | |
108 | "bset/ne r3h,@0x12345678:32" | |
109 | gdb_test "x" "bnot\t#0x7,r1h" \ | |
110 | "bnot #0x7,r1h" | |
111 | gdb_test "x" "bnot\t#0x7,@er1" \ | |
112 | "bnot #0x7,@er1" | |
113 | gdb_test "x" "bnot\t#0x7,@0x12(:8|)" \ | |
114 | "bnot #0x7,@0x12:8" | |
115 | gdb_test "x" "bnot\t#0x7,@0x1234(:16|)" \ | |
116 | "bnot #0x7,@0x1234:16" | |
117 | gdb_test "x" "bnot\t#0x7,@0x12345678(:32|)" \ | |
118 | "bnot #0x7,@0x12345678:32" | |
119 | gdb_test "x" "bnot\tr3h,r1h" \ | |
120 | "bnot r3h,r1h" | |
121 | gdb_test "x" "bnot\tr3h,@er1" \ | |
122 | "bnot r3h,@er1" | |
123 | gdb_test "x" "bnot\tr3h,@0x12(:8|)" \ | |
124 | "bnot r3h,@0x12:8" | |
125 | gdb_test "x" "bnot\tr3h,@0x1234(:16|)" \ | |
126 | "bnot r3h,@0x1234:16" | |
127 | gdb_test "x" "bnot\tr3h,@0x12345678(:32|)" \ | |
128 | "bnot r3h,@0x12345678:32" | |
129 | gdb_test "x" "bclr\t#0x7,r1h" \ | |
130 | "bclr #0x7,r1h" | |
131 | gdb_test "x" "bclr\t#0x7,@er1" \ | |
132 | "bclr #0x7,@er1" | |
133 | gdb_test "x" "bclr\t#0x7,@0x12(:8|)" \ | |
134 | "bclr #0x7,@0x12:8" | |
135 | gdb_test "x" "bclr\t#0x7,@0x1234(:16|)" \ | |
136 | "bclr #0x7,@0x1234:16" | |
137 | gdb_test "x" "bclr\t#0x7,@0x12345678(:32|)" \ | |
138 | "bclr #0x7,@0x12345678:32" | |
139 | gdb_test "x" "bclr\tr3h,r1h" \ | |
140 | "bclr r3h,r1h" | |
141 | gdb_test "x" "bclr\tr3h,@er1" \ | |
142 | "bclr r3h,@er1" | |
143 | gdb_test "x" "bclr\tr3h,@0x12(:8|)" \ | |
144 | "bclr r3h,@0x12:8" | |
145 | gdb_test "x" "bclr\tr3h,@0x1234(:16|)" \ | |
146 | "bclr r3h,@0x1234:16" | |
147 | gdb_test "x" "bclr\tr3h,@0x12345678(:32|)" \ | |
148 | "bclr r3h,@0x12345678:32" | |
149 | gdb_test "x" "bclr/eq\t#0x7,@er1" \ | |
150 | "bclr/eq #0x7,@er1" | |
151 | gdb_test "x" "bclr/eq\t#0x7,@0x12(:8|)" \ | |
152 | "bclr/eq #0x7,@0x12:8" | |
153 | gdb_test "x" "bclr/eq\t#0x7,@0x1234(:16|)" \ | |
154 | "bclr/eq #0x7,@0x1234:16" | |
155 | gdb_test "x" "bclr/eq\t#0x7,@0x12345678(:32|)" \ | |
156 | "bclr/eq #0x7,@0x12345678:32" | |
157 | gdb_test "x" "bclr/eq\tr3h,@er1" \ | |
158 | "bclr/eq r3h,@er1" | |
159 | gdb_test "x" "bclr/eq\tr3h,@0x12(:8|)" \ | |
160 | "bclr/eq r3h,@0x12:8" | |
161 | gdb_test "x" "bclr/eq\tr3h,@0x1234(:16|)" \ | |
162 | "bclr/eq r3h,@0x1234:16" | |
163 | gdb_test "x" "bclr/eq\tr3h,@0x12345678(:32|)" \ | |
164 | "bclr/eq r3h,@0x12345678:32" | |
165 | gdb_test "x" "bclr/ne\t#0x7,@er1" \ | |
166 | "bclr/ne #0x7,@er1" | |
167 | gdb_test "x" "bclr/ne\t#0x7,@0x12(:8|)" \ | |
168 | "bclr/ne #0x7,@0x12:8" | |
169 | gdb_test "x" "bclr/ne\t#0x7,@0x1234(:16|)" \ | |
170 | "bclr/ne #0x7,@0x1234:16" | |
171 | gdb_test "x" "bclr/ne\t#0x7,@0x12345678(:32|)" \ | |
172 | "bclr/ne #0x7,@0x12345678:32" | |
173 | gdb_test "x" "bclr/ne\tr3h,@er1" \ | |
174 | "bclr/ne r3h,@er1" | |
175 | gdb_test "x" "bclr/ne\tr3h,@0x12(:8|)" \ | |
176 | "bclr/ne r3h,@0x12:8" | |
177 | gdb_test "x" "bclr/ne\tr3h,@0x1234(:16|)" \ | |
178 | "bclr/ne r3h,@0x1234:16" | |
179 | gdb_test "x" "bclr/ne\tr3h,@0x12345678(:32|)" \ | |
180 | "bclr/ne r3h,@0x12345678:32" | |
181 | gdb_test "x" "btst\t#0x7,r1h" \ | |
182 | "btst #0x7,r1h" | |
183 | gdb_test "x" "btst\t#0x7,@er1" \ | |
184 | "btst #0x7,@er1" | |
185 | gdb_test "x" "btst\t#0x7,@0x12(:8|)" \ | |
186 | "btst #0x7,@0x12:8" | |
187 | gdb_test "x" "btst\t#0x7,@0x1234(:16|)" \ | |
188 | "btst #0x7,@0x1234:16" | |
189 | gdb_test "x" "btst\t#0x7,@0x12345678(:32|)" \ | |
190 | "btst #0x7,@0x12345678:32" | |
191 | gdb_test "x" "btst\tr3h,r1h" \ | |
192 | "btst r3h,r1h" | |
193 | gdb_test "x" "btst\tr3h,@er1" \ | |
194 | "btst r3h,@er1" | |
195 | gdb_test "x" "btst\tr3h,@0x12(:8|)" \ | |
196 | "btst r3h,@0x12:8" | |
197 | gdb_test "x" "btst\tr3h,@0x1234(:16|)" \ | |
198 | "btst r3h,@0x1234:16" | |
199 | gdb_test "x" "btst\tr3h,@0x12345678(:32|)" \ | |
200 | "btst r3h,@0x12345678:32" | |
201 | gdb_test "x" "bor\t#0x7,r1h" \ | |
202 | "bor #0x7,r1h" | |
203 | gdb_test "x" "bor\t#0x7,@er1" \ | |
204 | "bor #0x7,@er1" | |
205 | gdb_test "x" "bor\t#0x7,@0x12(:8|)" \ | |
206 | "bor #0x7,@0x12:8" | |
207 | gdb_test "x" "bor\t#0x7,@0x1234(:16|)" \ | |
208 | "bor #0x7,@0x1234:16" | |
209 | gdb_test "x" "bor\t#0x7,@0x12345678(:32|)" \ | |
210 | "bor #0x7,@0x12345678:32" | |
211 | gdb_test "x" "bior\t#0x7,r1h" \ | |
212 | "bior #0x7,r1h" | |
213 | gdb_test "x" "bior\t#0x7,@er1" \ | |
214 | "bior #0x7,@er1" | |
215 | gdb_test "x" "bior\t#0x7,@0x12(:8|)" \ | |
216 | "bior #0x7,@0x12:8" | |
217 | gdb_test "x" "bior\t#0x7,@0x1234(:16|)" \ | |
218 | "bior #0x7,@0x1234:16" | |
219 | gdb_test "x" "bior\t#0x7,@0x12345678(:32|)" \ | |
220 | "bior #0x7,@0x12345678:32" | |
221 | gdb_test "x" "bxor\t#0x7,r1h" \ | |
222 | "bxor #0x7,r1h" | |
223 | gdb_test "x" "bxor\t#0x7,@er1" \ | |
224 | "bxor #0x7,@er1" | |
225 | gdb_test "x" "bxor\t#0x7,@0x12(:8|)" \ | |
226 | "bxor #0x7,@0x12:8" | |
227 | gdb_test "x" "bxor\t#0x7,@0x1234(:16|)" \ | |
228 | "bxor #0x7,@0x1234:16" | |
229 | gdb_test "x" "bxor\t#0x7,@0x12345678(:32|)" \ | |
230 | "bxor #0x7,@0x12345678:32" | |
231 | gdb_test "x" "bixor\t#0x7,r1h" \ | |
232 | "bixor #0x7,r1h" | |
233 | gdb_test "x" "bixor\t#0x7,@er1" \ | |
234 | "bixor #0x7,@er1" | |
235 | gdb_test "x" "bixor\t#0x7,@0x12(:8|)" \ | |
236 | "bixor #0x7,@0x12:8" | |
237 | gdb_test "x" "bixor\t#0x7,@0x1234(:16|)" \ | |
238 | "bixor #0x7,@0x1234:16" | |
239 | gdb_test "x" "bixor\t#0x7,@0x12345678(:32|)" \ | |
240 | "bixor #0x7,@0x12345678:32" | |
241 | gdb_test "x" "band\t#0x7,r1h" \ | |
242 | "band #0x7,r1h" | |
243 | gdb_test "x" "band\t#0x7,@er1" \ | |
244 | "band #0x7,@er1" | |
245 | gdb_test "x" "band\t#0x7,@0x12(:8|)" \ | |
246 | "band #0x7,@0x12:8" | |
247 | gdb_test "x" "band\t#0x7,@0x1234(:16|)" \ | |
248 | "band #0x7,@0x1234:16" | |
249 | gdb_test "x" "band\t#0x7,@0x12345678(:32|)" \ | |
250 | "band #0x7,@0x12345678:32" | |
251 | gdb_test "x" "biand\t#0x7,r1h" \ | |
252 | "biand #0x7,r1h" | |
253 | gdb_test "x" "biand\t#0x7,@er1" \ | |
254 | "biand #0x7,@er1" | |
255 | gdb_test "x" "biand\t#0x7,@0x12(:8|)" \ | |
256 | "biand #0x7,@0x12:8" | |
257 | gdb_test "x" "biand\t#0x7,@0x1234(:16|)" \ | |
258 | "biand #0x7,@0x1234:16" | |
259 | gdb_test "x" "biand\t#0x7,@0x12345678(:32|)" \ | |
260 | "biand #0x7,@0x12345678:32" | |
261 | gdb_test "x" "bld\t#0x7,r1h" \ | |
262 | "bld #0x7,r1h" | |
263 | gdb_test "x" "bld\t#0x7,@er1" \ | |
264 | "bld #0x7,@er1" | |
265 | gdb_test "x" "bld\t#0x7,@0x12(:8|)" \ | |
266 | "bld #0x7,@0x12:8" | |
267 | gdb_test "x" "bld\t#0x7,@0x1234(:16|)" \ | |
268 | "bld #0x7,@0x1234:16" | |
269 | gdb_test "x" "bld\t#0x7,@0x12345678(:32|)" \ | |
270 | "bld #0x7,@0x12345678:32" | |
271 | gdb_test "x" "bild\t#0x7,r1h" \ | |
272 | "bild #0x7,r1h" | |
273 | gdb_test "x" "bild\t#0x7,@er1" \ | |
274 | "bild #0x7,@er1" | |
275 | gdb_test "x" "bild\t#0x7,@0x12(:8|)" \ | |
276 | "bild #0x7,@0x12:8" | |
277 | gdb_test "x" "bild\t#0x7,@0x1234(:16|)" \ | |
278 | "bild #0x7,@0x1234:16" | |
279 | gdb_test "x" "bild\t#0x7,@0x12345678(:32|)" \ | |
280 | "bild #0x7,@0x12345678:32" | |
281 | gdb_test "x" "bst\t#0x7,r1h" \ | |
282 | "bst #0x7,r1h" | |
283 | gdb_test "x" "bst\t#0x7,@er1" \ | |
284 | "bst #0x7,@er1" | |
285 | gdb_test "x" "bst\t#0x7,@0x12(:8|)" \ | |
286 | "bst #0x7,@0x12:8" | |
287 | gdb_test "x" "bst\t#0x7,@0x1234(:16|)" \ | |
288 | "bst #0x7,@0x1234:16" | |
289 | gdb_test "x" "bst\t#0x7,@0x12345678(:32|)" \ | |
290 | "bst #0x7,@0x12345678:32" | |
291 | gdb_test "x" "bstz\t#0x7,@er1" \ | |
292 | "bstz #0x7,@er1" | |
293 | gdb_test "x" "bstz\t#0x7,@0x12(:8|)" \ | |
294 | "bstz #0x7,@0x12:8" | |
295 | gdb_test "x" "bstz\t#0x7,@0x1234(:16|)" \ | |
296 | "bstz #0x7,@0x1234:16" | |
297 | gdb_test "x" "bstz\t#0x7,@0x12345678(:32|)" \ | |
298 | "bstz #0x7,@0x12345678:32" | |
299 | gdb_test "x" "bist\t#0x7,r1h" \ | |
300 | "bist #0x7,r1h" | |
301 | gdb_test "x" "bist\t#0x7,@er1" \ | |
302 | "bist #0x7,@er1" | |
303 | gdb_test "x" "bist\t#0x7,@0x12(:8|)" \ | |
304 | "bist #0x7,@0x12:8" | |
305 | gdb_test "x" "bist\t#0x7,@0x1234(:16|)" \ | |
306 | "bist #0x7,@0x1234:16" | |
307 | gdb_test "x" "bist\t#0x7,@0x12345678(:32|)" \ | |
308 | "bist #0x7,@0x12345678:32" | |
309 | gdb_test "x" "bistz\t#0x7,@er1" \ | |
310 | "bistz #0x7,@er1" | |
311 | gdb_test "x" "bistz\t#0x7,@0x12(:8|)" \ | |
312 | "bistz #0x7,@0x12:8" | |
313 | gdb_test "x" "bistz\t#0x7,@0x1234(:16|)" \ | |
314 | "bistz #0x7,@0x1234:16" | |
315 | gdb_test "x" "bistz\t#0x7,@0x12345678(:32|)" \ | |
316 | "bistz #0x7,@0x12345678:32" | |
317 | gdb_test "x" "bfld\t#0x34(:8|),@er1,r3h" \ | |
318 | "bfld #0x34:8,@er1,r3h" | |
319 | gdb_test "x" "bfld\t#0x34(:8|),@0x12(:8|),r3h" \ | |
320 | "bfld #0x34:8,@0x12:8,r3h" | |
321 | gdb_test "x" "bfld\t#0x34(:8|),@0x1234(:16|),r3h" \ | |
322 | "bfld #0x34:8,@0x1234:16,r3h" | |
323 | gdb_test "x" "bfld\t#0x34(:8|),@0x12345678(:32|),r3h" \ | |
324 | "bfld #0x34:8,@0x12345678:32,r3h" | |
325 | gdb_test "x" "bfst\tr3h,#0x34(:8|),@er1" \ | |
326 | "bfst r3h,#0x34:8,@er1" | |
327 | gdb_test "x" "bfst\tr3h,#0x34(:8|),@0x12(:8|)" \ | |
328 | "bfst r3h,#0x34:8,@0x12:8" | |
329 | gdb_test "x" "bfst\tr3h,#0x34(:8|),@0x1234(:16|)" \ | |
330 | "bfst r3h,#0x34:8,@0x1234:16" | |
331 | gdb_test "x" "bfst\tr3h,#0x34(:8|),@0x12345678(:32|)" \ | |
332 | "bfst r3h,#0x34:8,@0x12345678:32" |