Commit | Line | Data |
---|---|---|
82704155 | 1 | # Copyright (C) 2012-2019 Free Software Foundation, Inc. |
5bf135a7 NC |
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 3 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. | |
16 | ||
252b5132 RH |
17 | # Some generic SPARC and SPARC64 tests |
18 | ||
19 | # FIXME: The tests here aren't really bullet proof. A mistake in the opcode | |
20 | # table can slip through since we use the same table for assembly and | |
21 | # disassembly. The way to fix this is to include a hex dump of the insns | |
22 | # and test that as well. Later. | |
23 | ||
b3fb1136 RH |
24 | # Find out if these binutils are either sparc64*-*-* or |
25 | # sparc*-*-* with --enable-targets=sparc64-*-* | |
26 | proc gas_64_check { } { | |
27 | global NM | |
28 | global NMFLAGS | |
252b5132 | 29 | |
7f6a71ff JM |
30 | set status [gas_host_run "$NM $NMFLAGS --help" ""] |
31 | return [regexp "elf64\[_-\]sparc" [lindex $status 1]] | |
b3fb1136 | 32 | } |
252b5132 | 33 | |
0458ca44 RO |
34 | # Until binutils support Solaris-style capabilities, specify the arch |
35 | # necessary to disassemble the ISA extensions used. | |
36 | proc set_tests_arch {arch} { | |
37 | global OBJDUMPFLAGS | |
38 | ||
39 | if [istarget "sparc*-*-solaris*"] { | |
40 | if { $arch != "" } { | |
41 | set OBJDUMPFLAGS "-msparc:$arch" | |
42 | } else { | |
43 | set OBJDUMPFLAGS "" | |
44 | } | |
45 | } | |
46 | } | |
47 | ||
b3fb1136 | 48 | if [istarget sparc*-*-*] { |
c88960d0 JM |
49 | |
50 | if [is_elf_format] { | |
51 | # The next five tests are ELF only. | |
52 | run_dump_test "unalign" | |
53 | run_dump_test "pcrel" | |
54 | run_dump_test "plt" | |
55 | run_dump_test "gotop32" | |
56 | run_dump_test "pc2210" | |
57 | # The features tested in the tests below are not ELF-specific. | |
58 | # However, these features are not present in practice in COFF | |
59 | # and a.out targets. Running them only in ELF targets allows | |
60 | # us to don't have to replicate pattern test files as that | |
61 | # would bring no practical advantage. | |
62 | run_dump_test "natural" | |
63 | run_dump_test "natural-32" | |
64 | run_list_test "pr4587" "" | |
65 | run_dump_test "ticc-imm-reg" | |
66 | run_dump_test "v8-movwr-imm" | |
c88960d0 | 67 | run_dump_test "save-args" |
df28970f | 68 | run_dump_test "leon" |
618a8fdb | 69 | run_dump_test "v8branch" |
0458ca44 RO |
70 | |
71 | set_tests_arch "v9c" | |
72 | run_dump_test "ldtxa" | |
73 | ||
74 | set_tests_arch "v9d" | |
75 | run_dump_test "edge" | |
76 | ||
77 | set_tests_arch "v9v" | |
78 | run_dump_test "cbcond" | |
79 | run_dump_test "cfr" | |
80 | run_dump_test "crypto" | |
81 | run_dump_test "hpcvis3" | |
82 | run_dump_test "ima" | |
83 | run_dump_test "pause" | |
84 | ||
85 | set_tests_arch "v9m" | |
86 | run_dump_test "mcdper" | |
87 | run_dump_test "mwait" | |
88 | run_dump_test "sparc5vis4" | |
89 | run_dump_test "xcrypto" | |
90 | ||
91 | set_tests_arch "v9m8" | |
92 | run_dump_test "fpcmpshl" | |
93 | run_dump_test "ldm-stm" | |
94 | run_dump_test "ldmf-stmf" | |
95 | run_dump_test "on" | |
96 | run_dump_test "rle" | |
97 | run_dump_test "sparc6" | |
98 | set_tests_arch "" | |
99 | ||
65d1cff9 | 100 | run_list_test "cbcond-diag" "-64" |
c88960d0 | 101 | run_dump_test "flush" |
c88960d0 JM |
102 | run_dump_test "ld_st_fsr" |
103 | run_dump_test "ldtw_sttw" | |
104 | run_dump_test "ldd_std" | |
105 | run_dump_test "ldx_stx" | |
106 | run_dump_test "ldx_efsr" | |
c88960d0 JM |
107 | run_dump_test "v9branch1" |
108 | run_dump_test "imm-plus-rreg" | |
d7cd93a7 | 109 | run_dump_test "dcti-couples-v9" |
d28b6364 | 110 | run_dump_test "call-relax" |
64517994 | 111 | run_list_test "sparc6-diag" "-64" |
64517994 | 112 | run_list_test "fpcmpshl-diag" "-64" |
64517994 | 113 | run_list_test "ldm-stm-diag" "-64" |
64517994 | 114 | run_list_test "ldmf-stmf-diag" "-64" |
64517994 | 115 | run_list_test "on-diag" "-64" |
d28b6364 JM |
116 | } else { |
117 | # The next tests are a.out only. | |
118 | run_dump_test "call-relax-aout" | |
c88960d0 JM |
119 | } |
120 | ||
b3fb1136 RH |
121 | if [gas_64_check] { |
122 | run_dump_test "asi" | |
123 | run_dump_test "membar" | |
124 | run_dump_test "prefetch" | |
125 | run_dump_test "set64" | |
126 | run_dump_test "synth64" | |
83d634e3 | 127 | run_dump_test "window" |
b3fb1136 | 128 | run_dump_test "reloc64" |
bd5e6e7e JJ |
129 | run_dump_test "pcrel64" |
130 | run_dump_test "plt64" | |
739f7f82 | 131 | run_dump_test "gotop64" |
128e85e3 | 132 | run_list_test "hwcaps-bump" "-64 -bump" |
ae0264a6 | 133 | run_list_test "asi-bump-warn" "-64 -bump" |
1b3cee56 | 134 | run_list_test "asi-arch-error" "-Av9" |
0458ca44 RO |
135 | |
136 | set_tests_arch "v9m" | |
137 | run_dump_test "rdhpr" | |
138 | run_dump_test "rdpr" | |
139 | run_dump_test "wrasr" | |
140 | run_dump_test "wrhpr" | |
141 | run_dump_test "wrpr" | |
142 | ||
143 | set_tests_arch "v9m8" | |
144 | run_dump_test "rdasr" | |
145 | set_tests_arch "" | |
b3fb1136 | 146 | } |
c88960d0 JM |
147 | |
148 | run_dump_test "synth" | |
c699f087 JJ |
149 | run_dump_test "v9branch2" |
150 | run_dump_test "v9branch3" | |
151 | run_dump_test "v9branch4" | |
152 | run_dump_test "v9branch5" | |
e140100a NC |
153 | run_dump_test "pr19910-1" |
154 | run_list_test "pr19910-2" | |
46a2d504 | 155 | run_dump_test "dcti-couples-v8" |
46a2d504 | 156 | run_dump_test "dcti-couples-v9c" |
86b80085 | 157 | run_dump_test "pr20732" |
252b5132 RH |
158 | } |
159 | ||
910600e9 RS |
160 | if [istarget sparc-*-vxworks*] { |
161 | run_dump_test "vxworks-pic" | |
162 | } | |
163 | ||
252b5132 RH |
164 | if [istarget sparclet*-*-*] { |
165 | run_dump_test "splet" | |
166 | run_dump_test "splet-2" | |
167 | } |