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