1 |
38 |
julius |
# Copyright (C) 1995, 1996, 1997, 2002, 2003, 2004, 2007
|
2 |
|
|
# Free Software Foundation, Inc.
|
3 |
|
|
|
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.
|
8 |
|
|
#
|
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.
|
13 |
|
|
#
|
14 |
|
|
# You should have received a copy of the GNU General Public License
|
15 |
|
|
# along with this program; if not, write to the Free Software
|
16 |
|
|
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
17 |
|
|
|
18 |
|
|
# Please email any bugs, comments, and/or additions to this file to:
|
19 |
|
|
# dejagnu@gnu.org
|
20 |
|
|
|
21 |
|
|
# Written by Cygnus Support.
|
22 |
|
|
|
23 |
|
|
if [istarget "sh*-*-linux-*"] {
|
24 |
|
|
global ASFLAGS
|
25 |
|
|
set ASFLAGS "$ASFLAGS -big"
|
26 |
|
|
}
|
27 |
|
|
if {[istarget "sh64*-*-*"] || [istarget "sh5*-*-*"]} then {
|
28 |
|
|
global ASFLAGS
|
29 |
|
|
|
30 |
|
|
set old_ASFLAGS $ASFLAGS
|
31 |
|
|
set ASFLAGS "$ASFLAGS --abi=32 --isa=SHcompact"
|
32 |
|
|
}
|
33 |
|
|
|
34 |
|
|
proc do_fp {} {
|
35 |
|
|
set testname "fp.s: floating point tests (sh3e)"
|
36 |
|
|
set x 0
|
37 |
|
|
|
38 |
|
|
gas_start "fp.s" "-al"
|
39 |
|
|
|
40 |
|
|
# Check the assembled instruction against a table built by the HP assembler
|
41 |
|
|
# Any differences should be checked by hand -- with the number of problems
|
42 |
|
|
# I've seen in the HP assembler I don't completely trust it.
|
43 |
|
|
#
|
44 |
|
|
# Instead of having a variable for each match string just increment the
|
45 |
|
|
# total number of matches seen. That's simpler when testing large numbers
|
46 |
|
|
# of instructions (as these tests to).
|
47 |
|
|
while 1 {
|
48 |
|
|
expect {
|
49 |
|
|
-re "^ +\[0-9\]+ 0000 F008\[^\n\]*\n" { set x [expr $x+1] }
|
50 |
|
|
-re "^ +\[0-9\]+ 0002 F00A\[^\n\]*\n" { set x [expr $x+1] }
|
51 |
|
|
-re "^ +\[0-9\]+ 0004 F009\[^\n\]*\n" { set x [expr $x+1] }
|
52 |
|
|
-re "^ +\[0-9\]+ 0006 F00B\[^\n\]*\n" { set x [expr $x+1] }
|
53 |
|
|
-re "^ +\[0-9\]+ 0008 F006\[^\n\]*\n" { set x [expr $x+1] }
|
54 |
|
|
-re "^ +\[0-9\]+ 000a F007\[^\n\]*\n" { set x [expr $x+1] }
|
55 |
|
|
-re "^ +\[0-9\]+ 000c F10C\[^\n\]*\n" { set x [expr $x+1] }
|
56 |
|
|
-re "^ +\[0-9\]+ 000e F08D\[^\n\]*\n" { set x [expr $x+1] }
|
57 |
|
|
-re "^ +\[0-9\]+ 0010 F09D\[^\n\]*\n" { set x [expr $x+1] }
|
58 |
|
|
-re "^ +\[0-9\]+ 0012 F100\[^\n\]*\n" { set x [expr $x+1] }
|
59 |
|
|
-re "^ +\[0-9\]+ 0014 F101\[^\n\]*\n" { set x [expr $x+1] }
|
60 |
|
|
-re "^ +\[0-9\]+ 0016 F102\[^\n\]*\n" { set x [expr $x+1] }
|
61 |
|
|
-re "^ +\[0-9\]+ 0018 F103\[^\n\]*\n" { set x [expr $x+1] }
|
62 |
|
|
-re "^ +\[0-9\]+ 001a F10E\[^\n\]*\n" { set x [expr $x+1] }
|
63 |
|
|
-re "^ +\[0-9\]+ 001c F104\[^\n\]*\n" { set x [expr $x+1] }
|
64 |
|
|
-re "^ +\[0-9\]+ 001e F105\[^\n\]*\n" { set x [expr $x+1] }
|
65 |
|
|
-re "^ +\[0-9\]+ 0020 F04D\[^\n\]*\n" { set x [expr $x+1] }
|
66 |
|
|
-re "^ +\[0-9\]+ 0022 F05D\[^\n\]*\n" { set x [expr $x+1] }
|
67 |
|
|
-re "^ +\[0-9\]+ 0024 F06D\[^\n\]*\n" { set x [expr $x+1] }
|
68 |
|
|
-re "^ +\[0-9\]+ 0026 F02D\[^\n\]*\n" { set x [expr $x+1] }
|
69 |
|
|
-re "^ +\[0-9\]+ 0028 F03D\[^\n\]*\n" { set x [expr $x+1] }
|
70 |
|
|
-re "^ +\[0-9\]+ 002a F00D\[^\n\]*\n" { set x [expr $x+1] }
|
71 |
|
|
-re "^ +\[0-9\]+ 002c F01D\[^\n\]*\n" { set x [expr $x+1] }
|
72 |
|
|
-re "^ +\[0-9\]+ 002e 435A\[^\n\]*\n" { set x [expr $x+1] }
|
73 |
|
|
-re "^ +\[0-9\]+ 0030 4356\[^\n\]*\n" { set x [expr $x+1] }
|
74 |
|
|
-re "^ +\[0-9\]+ 0032 436A\[^\n\]*\n" { set x [expr $x+1] }
|
75 |
|
|
-re "^ +\[0-9\]+ 0034 4366\[^\n\]*\n" { set x [expr $x+1] }
|
76 |
|
|
-re "^ +\[0-9\]+ 0036 035A\[^\n\]*\n" { set x [expr $x+1] }
|
77 |
|
|
-re "^ +\[0-9\]+ 0038 4352\[^\n\]*\n" { set x [expr $x+1] }
|
78 |
|
|
-re "^ +\[0-9\]+ 003a 036A\[^\n\]*\n" { set x [expr $x+1] }
|
79 |
|
|
-re "^ +\[0-9\]+ 003c 4362\[^\n\]*\n" { set x [expr $x+1] }
|
80 |
|
|
-re "^ +\[0-9\]+ 0000 08F0\[^\n\]*\n" { set x [expr $x+1] }
|
81 |
|
|
-re "^ +\[0-9\]+ 0002 0AF0\[^\n\]*\n" { set x [expr $x+1] }
|
82 |
|
|
-re "^ +\[0-9\]+ 0004 09F0\[^\n\]*\n" { set x [expr $x+1] }
|
83 |
|
|
-re "^ +\[0-9\]+ 0006 0BF0\[^\n\]*\n" { set x [expr $x+1] }
|
84 |
|
|
-re "^ +\[0-9\]+ 0008 06F0\[^\n\]*\n" { set x [expr $x+1] }
|
85 |
|
|
-re "^ +\[0-9\]+ 000a 07F0\[^\n\]*\n" { set x [expr $x+1] }
|
86 |
|
|
-re "^ +\[0-9\]+ 000c 0CF1\[^\n\]*\n" { set x [expr $x+1] }
|
87 |
|
|
-re "^ +\[0-9\]+ 000e 8DF0\[^\n\]*\n" { set x [expr $x+1] }
|
88 |
|
|
-re "^ +\[0-9\]+ 0010 9DF0\[^\n\]*\n" { set x [expr $x+1] }
|
89 |
|
|
-re "^ +\[0-9\]+ 0012 00F1\[^\n\]*\n" { set x [expr $x+1] }
|
90 |
|
|
-re "^ +\[0-9\]+ 0014 01F1\[^\n\]*\n" { set x [expr $x+1] }
|
91 |
|
|
-re "^ +\[0-9\]+ 0016 02F1\[^\n\]*\n" { set x [expr $x+1] }
|
92 |
|
|
-re "^ +\[0-9\]+ 0018 03F1\[^\n\]*\n" { set x [expr $x+1] }
|
93 |
|
|
-re "^ +\[0-9\]+ 001a 0EF1\[^\n\]*\n" { set x [expr $x+1] }
|
94 |
|
|
-re "^ +\[0-9\]+ 001c 04F1\[^\n\]*\n" { set x [expr $x+1] }
|
95 |
|
|
-re "^ +\[0-9\]+ 001e 05F1\[^\n\]*\n" { set x [expr $x+1] }
|
96 |
|
|
-re "^ +\[0-9\]+ 0020 4DF0\[^\n\]*\n" { set x [expr $x+1] }
|
97 |
|
|
-re "^ +\[0-9\]+ 0022 5DF0\[^\n\]*\n" { set x [expr $x+1] }
|
98 |
|
|
-re "^ +\[0-9\]+ 0024 6DF0\[^\n\]*\n" { set x [expr $x+1] }
|
99 |
|
|
-re "^ +\[0-9\]+ 0026 2DF0\[^\n\]*\n" { set x [expr $x+1] }
|
100 |
|
|
-re "^ +\[0-9\]+ 0028 3DF0\[^\n\]*\n" { set x [expr $x+1] }
|
101 |
|
|
-re "^ +\[0-9\]+ 002a 0DF0\[^\n\]*\n" { set x [expr $x+1] }
|
102 |
|
|
-re "^ +\[0-9\]+ 002c 1DF0\[^\n\]*\n" { set x [expr $x+1] }
|
103 |
|
|
-re "^ +\[0-9\]+ 002e 5A43\[^\n\]*\n" { set x [expr $x+1] }
|
104 |
|
|
-re "^ +\[0-9\]+ 0030 5643\[^\n\]*\n" { set x [expr $x+1] }
|
105 |
|
|
-re "^ +\[0-9\]+ 0032 6A43\[^\n\]*\n" { set x [expr $x+1] }
|
106 |
|
|
-re "^ +\[0-9\]+ 0034 6643\[^\n\]*\n" { set x [expr $x+1] }
|
107 |
|
|
-re "^ +\[0-9\]+ 0036 5A03\[^\n\]*\n" { set x [expr $x+1] }
|
108 |
|
|
-re "^ +\[0-9\]+ 0038 5243\[^\n\]*\n" { set x [expr $x+1] }
|
109 |
|
|
-re "^ +\[0-9\]+ 003a 6A03\[^\n\]*\n" { set x [expr $x+1] }
|
110 |
|
|
-re "^ +\[0-9\]+ 003c 6243\[^\n\]*\n" { set x [expr $x+1] }
|
111 |
|
|
-re "\[^\n\]*\n" { }
|
112 |
|
|
timeout { perror "timeout\n"; break }
|
113 |
|
|
eof { break }
|
114 |
|
|
}
|
115 |
|
|
}
|
116 |
|
|
|
117 |
|
|
# This was intended to do any cleanup necessary. It kinda looks like it
|
118 |
|
|
# isn't needed, but just in case, please keep it in for now.
|
119 |
|
|
gas_finish
|
120 |
|
|
|
121 |
|
|
# Did we find what we were looking for? If not, flunk it.
|
122 |
|
|
if [expr $x==31] then { pass $testname } else { fail $testname }
|
123 |
|
|
}
|
124 |
|
|
|
125 |
|
|
|
126 |
|
|
if [istarget sh*-*-*] then {
|
127 |
|
|
# Test the basic instruction parser.
|
128 |
|
|
do_fp
|
129 |
|
|
|
130 |
|
|
# coff is missing information about the machine type, so everything is
|
131 |
|
|
# dumped as sh4.
|
132 |
|
|
if {[istarget sh*-*coff] || [istarget sh*-pe*] || [istarget sh*-rtems]} then {
|
133 |
|
|
run_dump_test "pcrel-coff"
|
134 |
|
|
} elseif {[istarget sh*-hms] } {
|
135 |
|
|
run_dump_test "pcrel-hms"
|
136 |
|
|
} elseif {![istarget sh64*-*-*] && ![istarget sh5*-*-*] } {
|
137 |
|
|
# Test DSP instructions
|
138 |
|
|
run_dump_test "dsp"
|
139 |
|
|
|
140 |
|
|
run_dump_test "pcrel"
|
141 |
|
|
|
142 |
|
|
run_dump_test "pcrel2"
|
143 |
|
|
}
|
144 |
|
|
|
145 |
|
|
if {[istarget sh*-*elf] || [istarget sh*-linux*]} then {
|
146 |
|
|
if {![istarget "sh64*-*-*"] && ![istarget "sh5*-*-*"]} then {
|
147 |
|
|
run_dump_test "sh4a"
|
148 |
|
|
run_dump_test "sh4a-fp"
|
149 |
|
|
|
150 |
|
|
run_dump_test "sh4a-dsp"
|
151 |
|
|
run_dump_test "sh4al-dsp"
|
152 |
|
|
|
153 |
|
|
run_dump_test "sh2a"
|
154 |
|
|
}
|
155 |
|
|
|
156 |
|
|
run_dump_test "pic"
|
157 |
|
|
|
158 |
|
|
# Test TLS.
|
159 |
|
|
run_dump_test "tlsd"
|
160 |
|
|
|
161 |
|
|
run_dump_test "tlspic"
|
162 |
|
|
|
163 |
|
|
run_dump_test "tlsnopic"
|
164 |
|
|
|
165 |
|
|
# Test --renesas.
|
166 |
|
|
run_dump_test "renesas-1"
|
167 |
|
|
|
168 |
|
|
# Test --allow-reg-prefix.
|
169 |
|
|
run_dump_test "reg-prefix"
|
170 |
|
|
|
171 |
|
|
run_dump_test "too_large"
|
172 |
|
|
}
|
173 |
|
|
}
|
174 |
|
|
|
175 |
|
|
if {[info exists old_ASFLAGS]} {
|
176 |
|
|
global ASFLAGS
|
177 |
|
|
set ASFLAGS $old_ASFLAGS
|
178 |
|
|
}
|