Commit | Line | Data |
---|---|---|
28e7fd62 | 1 | # Copyright (C) 2003-2013 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 | ||
57ba3b85 MS |
18 | if ![istarget "h8300*-*-*"] { |
19 | verbose "Tests ignored for all but h8300s based targets." | |
20 | return | |
21 | } | |
22 | ||
57ba3b85 MS |
23 | |
24 | set testfile "t06_ari2" | |
25 | set srcfile ${srcdir}/${subdir}/${testfile}.s | |
26 | set objfile ${objdir}/${subdir}/${testfile}.o | |
27 | set binfile ${objdir}/${subdir}/${testfile}.x | |
28 | ||
4ec70201 PA |
29 | set asm-flags "" |
30 | set link-flags "-m h8300sxelf" | |
57ba3b85 MS |
31 | |
32 | ||
33 | if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} then { | |
b60f0898 JB |
34 | untested t06_ari2.exp |
35 | return -1 | |
57ba3b85 MS |
36 | } |
37 | ||
38 | if {[target_link $objfile $binfile "${link-flags}"] != ""} then { | |
b60f0898 JB |
39 | untested t06_ari2.exp |
40 | return -1 | |
57ba3b85 MS |
41 | } |
42 | ||
43 | gdb_start | |
44 | gdb_reinitialize_dir $srcdir/$subdir | |
45 | gdb_load $binfile | |
46 | ||
df0f4836 | 47 | gdb_test "x /i start" "addx(.b|)\t#0x12(:8|),r1h" \ |
57ba3b85 MS |
48 | "addx.b #0x12:8,r1h" |
49 | gdb_test "x" "addx(.b|)\t#0x12(:8|),@er1" \ | |
50 | "addx.b #0x12:8,@er1" | |
51 | gdb_test "x" "addx(.b|)\t#0x12(:8|),@er1-" \ | |
52 | "addx.b #0x12:8,@er1-" | |
53 | gdb_test "x" "addx(.b|)\tr3h,r1h" \ | |
54 | "addx.b r3h,r1h" | |
55 | gdb_test "x" "addx(.b|)\tr3h,@er1" \ | |
56 | "addx.b r3h,@er1" | |
57 | gdb_test "x" "addx(.b|)\tr3h,@er1-" \ | |
58 | "addx.b r3h,@er1-" | |
59 | gdb_test "x" "addx(.b|)\t@er3,r1h" \ | |
60 | "addx.b @er3,r1h" | |
61 | gdb_test "x" "addx(.b|)\t@er3,@er1" \ | |
62 | "addx.b @er3,@er1" | |
63 | gdb_test "x" "addx(.b|)\t@er3-,r1h" \ | |
64 | "addx.b @er3-,r1h" | |
65 | gdb_test "x" "addx(.b|)\t@er3-,@er1-" \ | |
66 | "addx.b @er3-,@er1-" | |
67 | gdb_test "x" "addx.w\t#0x1234(:16|),r1" \ | |
68 | "addx.w #0x1234:16,r1" | |
69 | gdb_test "x" "addx.w\t#0x1234(:16|),@er1" \ | |
70 | "addx.w #0x1234:16,@er1" | |
71 | gdb_test "x" "addx.w\t#0x1234(:16|),@er1-" \ | |
72 | "addx.w #0x1234:16,@er1-" | |
73 | gdb_test "x" "addx.w\tr3,r1" \ | |
74 | "addx.w r3,r1" | |
75 | gdb_test "x" "addx.w\tr3,@er1" \ | |
76 | "addx.w r3,@er1" | |
77 | gdb_test "x" "addx.w\tr3,@er1-" \ | |
78 | "addx.w r3,@er1-" | |
79 | gdb_test "x" "addx.w\t@er3,r1" \ | |
80 | "addx.w @er3,r1" | |
81 | gdb_test "x" "addx.w\t@er3,@er1" \ | |
82 | "addx.w @er3,@er1" | |
83 | gdb_test "x" "addx.w\t@er3-,r1" \ | |
84 | "addx.w @er3-,r1" | |
85 | gdb_test "x" "addx.w\t@er3-,@er1-" \ | |
86 | "addx.w @er3-,@er1-" | |
87 | gdb_test "x" "addx.l\t#0x12345678(:32|),er1" \ | |
88 | "addx.l #0x12345678:32,er1" | |
89 | gdb_test "x" "addx.l\t#0x12345678(:32|),@er1" \ | |
90 | "addx.l #0x12345678:32,@er1" | |
91 | gdb_test "x" "addx.l\t#0x12345678(:32|),@er1-" \ | |
92 | "addx.l #0x12345678:32,@er1-" | |
93 | gdb_test "x" "addx.l\ter3,er1" \ | |
94 | "addx.l er3,er1" | |
95 | gdb_test "x" "addx.l\ter3,@er1" \ | |
96 | "addx.l er3,@er1" | |
97 | gdb_test "x" "addx.l\ter3,@er1-" \ | |
98 | "addx.l er3,@er1-" | |
99 | gdb_test "x" "addx.l\t@er3,er1" \ | |
100 | "addx.l @er3,er1" | |
101 | gdb_test "x" "addx.l\t@er3,@er1" \ | |
102 | "addx.l @er3,@er1" | |
103 | gdb_test "x" "addx.l\t@er3-,er1" \ | |
104 | "addx.l @er3-,er1" | |
105 | gdb_test "x" "addx.l\t@er3-,@er1-" \ | |
106 | "addx.l @er3-,@er1-" | |
107 | gdb_test "x" "subx(.b|)\t#0x12(:8|),r1h" \ | |
108 | "subx.b #0x12:8,r1h" | |
109 | gdb_test "x" "subx(.b|)\t#0x12(:8|),@er1" \ | |
110 | "subx.b #0x12:8,@er1" | |
111 | gdb_test "x" "subx(.b|)\t#0x12(:8|),@er1-" \ | |
112 | "subx.b #0x12:8,@er1-" | |
113 | gdb_test "x" "subx(.b|)\tr3h,r1h" \ | |
114 | "subx.b r3h,r1h" | |
115 | gdb_test "x" "subx(.b|)\tr3h,@er1" \ | |
116 | "subx.b r3h,@er1" | |
117 | gdb_test "x" "subx(.b|)\tr3h,@er1-" \ | |
118 | "subx.b r3h,@er1-" | |
119 | gdb_test "x" "subx(.b|)\t@er3,r1h" \ | |
120 | "subx.b @er3,r1h" | |
121 | gdb_test "x" "subx(.b|)\t@er3,@er1" \ | |
122 | "subx.b @er3,@er1" | |
123 | gdb_test "x" "subx(.b|)\t@er3-,r1h" \ | |
124 | "subx.b @er3-,r1h" | |
125 | gdb_test "x" "subx(.b|)\t@er3-,@er1-" \ | |
126 | "subx.b @er3-,@er1-" | |
127 | gdb_test "x" "subx.w\t#0x1234(:16|),r1" \ | |
128 | "subx.w #0x1234:16,r1" | |
129 | gdb_test "x" "subx.w\t#0x1234(:16|),@er1" \ | |
130 | "subx.w #0x1234:16,@er1" | |
131 | gdb_test "x" "subx.w\t#0x1234(:16|),@er1-" \ | |
132 | "subx.w #0x1234:16,@er1-" | |
133 | gdb_test "x" "subx.w\tr3,r1" \ | |
134 | "subx.w r3,r1" | |
135 | gdb_test "x" "subx.w\tr3,@er1" \ | |
136 | "subx.w r3,@er1" | |
137 | gdb_test "x" "subx.w\tr3,@er1-" \ | |
138 | "subx.w r3,@er1-" | |
139 | gdb_test "x" "subx.w\t@er3,r1" \ | |
140 | "subx.w @er3,r1" | |
141 | gdb_test "x" "subx.w\t@er3,@er1" \ | |
142 | "subx.w @er3,@er1" | |
143 | gdb_test "x" "subx.w\t@er3-,r1" \ | |
144 | "subx.w @er3-,r1" | |
145 | gdb_test "x" "subx.w\t@er3-,@er1-" \ | |
146 | "subx.w @er3-,@er1-" | |
147 | gdb_test "x" "subx.l\t#0x12345678(:32|),er1" \ | |
148 | "subx.l #0x12345678:32,er1" | |
149 | gdb_test "x" "subx.l\t#0x12345678(:32|),@er1" \ | |
150 | "subx.l #0x12345678:32,@er1" | |
151 | gdb_test "x" "subx.l\t#0x12345678(:32|),@er1-" \ | |
152 | "subx.l #0x12345678:32,@er1-" | |
153 | gdb_test "x" "subx.l\ter3,er1" \ | |
154 | "subx.l er3,er1" | |
155 | gdb_test "x" "subx.l\ter3,@er1" \ | |
156 | "subx.l er3,@er1" | |
157 | gdb_test "x" "subx.l\ter3,@er1-" \ | |
158 | "subx.l er3,@er1-" | |
159 | gdb_test "x" "subx.l\t@er3,er1" \ | |
160 | "subx.l @er3,er1" | |
161 | gdb_test "x" "subx.l\t@er3,@er1" \ | |
162 | "subx.l @er3,@er1" | |
163 | gdb_test "x" "subx.l\t@er3-,er1" \ | |
164 | "subx.l @er3-,er1" | |
165 | gdb_test "x" "subx.l\t@er3-,@er1-" \ | |
166 | "subx.l @er3-,@er1-" | |
167 | gdb_test "x" "inc(.b|)\tr1h" \ | |
168 | "inc.b r1h" | |
169 | gdb_test "x" "inc(.w|)\t#1,r1" \ | |
170 | "inc.w #1,r1" | |
171 | gdb_test "x" "inc(.w|)\t#2,r1" \ | |
172 | "inc.w #2,r1" | |
173 | gdb_test "x" "inc(.l|)\t#1,er1" \ | |
174 | "inc.l #1,er1" | |
175 | gdb_test "x" "inc(.l|)\t#2,er1" \ | |
176 | "inc.l #2,er1" | |
177 | gdb_test "x" "dec(.b|)\tr1h" \ | |
178 | "dec.b r1h" | |
179 | gdb_test "x" "dec(.w|)\t#1,r1" \ | |
180 | "dec.w #1,r1" | |
181 | gdb_test "x" "dec(.w|)\t#2,r1" \ | |
182 | "dec.w #2,r1" | |
183 | gdb_test "x" "dec(.l|)\t#1,er1" \ | |
184 | "dec.l #1,er1" | |
185 | gdb_test "x" "dec(.l|)\t#2,er1" \ | |
186 | "dec.l #2,er1" | |
187 | gdb_test "x" "adds(.l|)\t#1,er1" \ | |
188 | "adds.l #1,er1" | |
189 | gdb_test "x" "adds(.l|)\t#2,er1" \ | |
190 | "adds.l #2,er1" | |
191 | gdb_test "x" "adds(.l|)\t#4,er1" \ | |
192 | "adds.l #4,er1" | |
193 | gdb_test "x" "subs(.l|)\t#1,er1" \ | |
194 | "subs.l #1,er1" | |
195 | gdb_test "x" "subs(.l|)\t#2,er1" \ | |
196 | "subs.l #2,er1" | |
197 | gdb_test "x" "subs(.l|)\t#4,er1" \ | |
198 | "subs.l #4,er1" | |
199 | gdb_test "x" "daa(.b|)\tr1h" \ | |
200 | "daa.b r1h" | |
201 | gdb_test "x" "das(.b|)\tr1h" \ | |
202 | "das.b r1h" | |
203 | gdb_test "x" "mulxu.b\t#0xf(:4|),r1" \ | |
204 | "mulxu.b #0xf:4,r1" | |
205 | gdb_test "x" "mulxu.b\tr3h,r1" \ | |
206 | "mulxu.b r3h,r1" | |
207 | gdb_test "x" "mulxu.w\t#0xf(:4|),er1" \ | |
208 | "mulxu.w #0xf:4,er1" | |
209 | gdb_test "x" "mulxu.w\tr3,er1" \ | |
210 | "mulxu.w r3,er1" | |
211 | gdb_test "x" "divxu.b\t#0xf(:4|),r1" \ | |
212 | "divxu.b #0xf:4,r1" | |
213 | gdb_test "x" "divxu.b\tr3h,r1" \ | |
214 | "divxu.b r3h,r1" | |
215 | gdb_test "x" "divxu.w\t#0xf(:4|),er1" \ | |
216 | "divxu.w #0xf:4,er1" | |
217 | gdb_test "x" "divxu.w\tr3,er1" \ | |
218 | "divxu.w r3,er1" | |
219 | gdb_test "x" "mulxs.b\t#0xf(:4|),r1" \ | |
220 | "mulxs.b #0xf:4,r1" | |
221 | gdb_test "x" "mulxs.b\tr3h,r1" \ | |
222 | "mulxs.b r3h,r1" | |
223 | gdb_test "x" "mulxs.w\t#0xf(:4|),er1" \ | |
224 | "mulxs.w #0xf:4,er1" | |
225 | gdb_test "x" "mulxs.w\tr3,er1" \ | |
226 | "mulxs.w r3,er1" | |
227 | gdb_test "x" "divxs.b\t#0xf(:4|),r1" \ | |
228 | "divxs.b #0xf:4,r1" | |
229 | gdb_test "x" "divxs.b\tr3h,r1" \ | |
230 | "divxs.b r3h,r1" | |
231 | gdb_test "x" "divxs.w\t#0xf(:4|),er1" \ | |
232 | "divxs.w #0xf:4,er1" | |
233 | gdb_test "x" "divxs.w\tr3,er1" \ | |
234 | "divxs.w r3,er1" | |
235 | gdb_test "x" "mulu.w\t#0xf(:4|),r1" \ | |
236 | "mulu.w #0xf:4,r1" | |
237 | gdb_test "x" "mulu.w\tr3,r1" \ | |
238 | "mulu.w r3,r1" | |
239 | gdb_test "x" "mulu.l\t#0xf(:4|),er1" \ | |
240 | "mulu.l #0xf:4,er1" | |
241 | gdb_test "x" "mulu.l\ter3,er1" \ | |
242 | "mulu.l er3,er1" | |
243 | gdb_test "x" "mulu/u.l\t#0xf(:4|),er1" \ | |
244 | "mulu/u.l #0xf:4,er1" | |
245 | gdb_test "x" "mulu/u.l\ter3,er1" \ | |
246 | "mulu/u.l er3,er1" | |
247 | gdb_test "x" "muls.w\t#0xf(:4|),r1" \ | |
248 | "muls.w #0xf:4,r1" | |
249 | gdb_test "x" "muls.w\tr3,r1" \ | |
250 | "muls.w r3,r1" | |
251 | gdb_test "x" "muls.l\t#0xf(:4|),er1" \ | |
252 | "muls.l #0xf:4,er1" | |
253 | gdb_test "x" "muls.l\ter3,er1" \ | |
254 | "muls.l er3,er1" | |
255 | gdb_test "x" "muls/u.l\t#0xf(:4|),er1" \ | |
256 | "muls/u.l #0xf:4,er1" | |
257 | gdb_test "x" "muls/u.l\ter3,er1" \ | |
258 | "muls/u.l er3,er1" | |
259 | gdb_test "x" "divu.w\t#0xf(:4|),r1" \ | |
260 | "divu.w #0xf:4,r1" | |
261 | gdb_test "x" "divu.w\tr3,r1" \ | |
262 | "divu.w r3,r1" | |
263 | gdb_test "x" "divu.l\t#0xf(:4|),er1" \ | |
264 | "divu.l #0xf:4,er1" | |
265 | gdb_test "x" "divu.l\ter3,er1" \ | |
266 | "divu.l er3,er1" | |
267 | gdb_test "x" "divs.w\t#0xf(:4|),r1" \ | |
268 | "divs.w #0xf:4,r1" | |
269 | gdb_test "x" "divs.w\tr3,r1" \ | |
270 | "divs.w r3,r1" | |
271 | gdb_test "x" "divs.l\t#0xf(:4|),er1" \ | |
272 | "divs.l #0xf:4,er1" | |
273 | gdb_test "x" "divs.l\ter3,er1" \ | |
274 | "divs.l er3,er1" |