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 "t06_ari2"
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" "addx(.b|)\t#0x12(:8|),r1h" \
54 gdb_test "x" "addx(.b|)\t#0x12(:8|),@er1" \
56 gdb_test "x" "addx(.b|)\t#0x12(:8|),@er1-" \
57 "addx.b #0x12:8,@er1-"
58 gdb_test "x" "addx(.b|)\tr3h,r1h" \
60 gdb_test "x" "addx(.b|)\tr3h,@er1" \
62 gdb_test "x" "addx(.b|)\tr3h,@er1-" \
64 gdb_test "x" "addx(.b|)\t@er3,r1h" \
66 gdb_test "x" "addx(.b|)\t@er3,@er1" \
68 gdb_test "x" "addx(.b|)\t@er3-,r1h" \
70 gdb_test "x" "addx(.b|)\t@er3-,@er1-" \
72 gdb_test "x" "addx.w\t#0x1234(:16|),r1" \
73 "addx.w #0x1234:16,r1"
74 gdb_test "x" "addx.w\t#0x1234(:16|),@er1" \
75 "addx.w #0x1234:16,@er1"
76 gdb_test "x" "addx.w\t#0x1234(:16|),@er1-" \
77 "addx.w #0x1234:16,@er1-"
78 gdb_test "x" "addx.w\tr3,r1" \
80 gdb_test "x" "addx.w\tr3,@er1" \
82 gdb_test "x" "addx.w\tr3,@er1-" \
84 gdb_test "x" "addx.w\t@er3,r1" \
86 gdb_test "x" "addx.w\t@er3,@er1" \
88 gdb_test "x" "addx.w\t@er3-,r1" \
90 gdb_test "x" "addx.w\t@er3-,@er1-" \
92 gdb_test "x" "addx.l\t#0x12345678(:32|),er1" \
93 "addx.l #0x12345678:32,er1"
94 gdb_test "x" "addx.l\t#0x12345678(:32|),@er1" \
95 "addx.l #0x12345678:32,@er1"
96 gdb_test "x" "addx.l\t#0x12345678(:32|),@er1-" \
97 "addx.l #0x12345678:32,@er1-"
98 gdb_test "x" "addx.l\ter3,er1" \
100 gdb_test "x" "addx.l\ter3,@er1" \
102 gdb_test "x" "addx.l\ter3,@er1-" \
104 gdb_test "x" "addx.l\t@er3,er1" \
106 gdb_test "x" "addx.l\t@er3,@er1" \
108 gdb_test "x" "addx.l\t@er3-,er1" \
110 gdb_test "x" "addx.l\t@er3-,@er1-" \
112 gdb_test "x" "subx(.b|)\t#0x12(:8|),r1h" \
114 gdb_test "x" "subx(.b|)\t#0x12(:8|),@er1" \
115 "subx.b #0x12:8,@er1"
116 gdb_test "x" "subx(.b|)\t#0x12(:8|),@er1-" \
117 "subx.b #0x12:8,@er1-"
118 gdb_test "x" "subx(.b|)\tr3h,r1h" \
120 gdb_test "x" "subx(.b|)\tr3h,@er1" \
122 gdb_test "x" "subx(.b|)\tr3h,@er1-" \
124 gdb_test "x" "subx(.b|)\t@er3,r1h" \
126 gdb_test "x" "subx(.b|)\t@er3,@er1" \
128 gdb_test "x" "subx(.b|)\t@er3-,r1h" \
130 gdb_test "x" "subx(.b|)\t@er3-,@er1-" \
132 gdb_test "x" "subx.w\t#0x1234(:16|),r1" \
133 "subx.w #0x1234:16,r1"
134 gdb_test "x" "subx.w\t#0x1234(:16|),@er1" \
135 "subx.w #0x1234:16,@er1"
136 gdb_test "x" "subx.w\t#0x1234(:16|),@er1-" \
137 "subx.w #0x1234:16,@er1-"
138 gdb_test "x" "subx.w\tr3,r1" \
140 gdb_test "x" "subx.w\tr3,@er1" \
142 gdb_test "x" "subx.w\tr3,@er1-" \
144 gdb_test "x" "subx.w\t@er3,r1" \
146 gdb_test "x" "subx.w\t@er3,@er1" \
148 gdb_test "x" "subx.w\t@er3-,r1" \
150 gdb_test "x" "subx.w\t@er3-,@er1-" \
152 gdb_test "x" "subx.l\t#0x12345678(:32|),er1" \
153 "subx.l #0x12345678:32,er1"
154 gdb_test "x" "subx.l\t#0x12345678(:32|),@er1" \
155 "subx.l #0x12345678:32,@er1"
156 gdb_test "x" "subx.l\t#0x12345678(:32|),@er1-" \
157 "subx.l #0x12345678:32,@er1-"
158 gdb_test "x" "subx.l\ter3,er1" \
160 gdb_test "x" "subx.l\ter3,@er1" \
162 gdb_test "x" "subx.l\ter3,@er1-" \
164 gdb_test "x" "subx.l\t@er3,er1" \
166 gdb_test "x" "subx.l\t@er3,@er1" \
168 gdb_test "x" "subx.l\t@er3-,er1" \
170 gdb_test "x" "subx.l\t@er3-,@er1-" \
172 gdb_test "x" "inc(.b|)\tr1h" \
174 gdb_test "x" "inc(.w|)\t#1,r1" \
176 gdb_test "x" "inc(.w|)\t#2,r1" \
178 gdb_test "x" "inc(.l|)\t#1,er1" \
180 gdb_test "x" "inc(.l|)\t#2,er1" \
182 gdb_test "x" "dec(.b|)\tr1h" \
184 gdb_test "x" "dec(.w|)\t#1,r1" \
186 gdb_test "x" "dec(.w|)\t#2,r1" \
188 gdb_test "x" "dec(.l|)\t#1,er1" \
190 gdb_test "x" "dec(.l|)\t#2,er1" \
192 gdb_test "x" "adds(.l|)\t#1,er1" \
194 gdb_test "x" "adds(.l|)\t#2,er1" \
196 gdb_test "x" "adds(.l|)\t#4,er1" \
198 gdb_test "x" "subs(.l|)\t#1,er1" \
200 gdb_test "x" "subs(.l|)\t#2,er1" \
202 gdb_test "x" "subs(.l|)\t#4,er1" \
204 gdb_test "x" "daa(.b|)\tr1h" \
206 gdb_test "x" "das(.b|)\tr1h" \
208 gdb_test "x" "mulxu.b\t#0xf(:4|),r1" \
210 gdb_test "x" "mulxu.b\tr3h,r1" \
212 gdb_test "x" "mulxu.w\t#0xf(:4|),er1" \
214 gdb_test "x" "mulxu.w\tr3,er1" \
216 gdb_test "x" "divxu.b\t#0xf(:4|),r1" \
218 gdb_test "x" "divxu.b\tr3h,r1" \
220 gdb_test "x" "divxu.w\t#0xf(:4|),er1" \
222 gdb_test "x" "divxu.w\tr3,er1" \
224 gdb_test "x" "mulxs.b\t#0xf(:4|),r1" \
226 gdb_test "x" "mulxs.b\tr3h,r1" \
228 gdb_test "x" "mulxs.w\t#0xf(:4|),er1" \
230 gdb_test "x" "mulxs.w\tr3,er1" \
232 gdb_test "x" "divxs.b\t#0xf(:4|),r1" \
234 gdb_test "x" "divxs.b\tr3h,r1" \
236 gdb_test "x" "divxs.w\t#0xf(:4|),er1" \
238 gdb_test "x" "divxs.w\tr3,er1" \
240 gdb_test "x" "mulu.w\t#0xf(:4|),r1" \
242 gdb_test "x" "mulu.w\tr3,r1" \
244 gdb_test "x" "mulu.l\t#0xf(:4|),er1" \
246 gdb_test "x" "mulu.l\ter3,er1" \
248 gdb_test "x" "mulu/u.l\t#0xf(:4|),er1" \
249 "mulu/u.l #0xf:4,er1"
250 gdb_test "x" "mulu/u.l\ter3,er1" \
252 gdb_test "x" "muls.w\t#0xf(:4|),r1" \
254 gdb_test "x" "muls.w\tr3,r1" \
256 gdb_test "x" "muls.l\t#0xf(:4|),er1" \
258 gdb_test "x" "muls.l\ter3,er1" \
260 gdb_test "x" "muls/u.l\t#0xf(:4|),er1" \
261 "muls/u.l #0xf:4,er1"
262 gdb_test "x" "muls/u.l\ter3,er1" \
264 gdb_test "x" "divu.w\t#0xf(:4|),r1" \
266 gdb_test "x" "divu.w\tr3,r1" \
268 gdb_test "x" "divu.l\t#0xf(:4|),er1" \
270 gdb_test "x" "divu.l\ter3,er1" \
272 gdb_test "x" "divs.w\t#0xf(:4|),r1" \
274 gdb_test "x" "divs.w\tr3,r1" \
276 gdb_test "x" "divs.l\t#0xf(:4|),er1" \
278 gdb_test "x" "divs.l\ter3,er1" \