Commit | Line | Data |
---|---|---|
252b5132 RH |
1 | # |
2 | # Some generic MIPS tests | |
3 | # | |
d9e138e2 L |
4 | |
5 | proc run_list_test { name opts } { | |
6 | global srcdir subdir | |
7 | set testname "MIPS $name" | |
8 | set file $srcdir/$subdir/$name | |
9 | gas_run ${name}.s $opts ">&dump.out" | |
10 | if { [regexp_diff "dump.out" "${file}.l"] } then { | |
11 | fail $testname | |
12 | verbose "output is [file_contents "dump.out"]" 2 | |
13 | return | |
14 | } | |
15 | pass $testname | |
16 | } | |
17 | ||
0285c67d | 18 | if { [istarget mips*-*-*] } then { |
252b5132 | 19 | set no_mips16 0 |
ae948b86 TS |
20 | set elf [expr [istarget *-*-elf*] || [istarget *-*-irix5*] || [istarget *-*-irix6* ] || [istarget *-*-linux*] || [istarget *-*-netbsd*] ] |
21 | set ecoff [expr [istarget *-*-ecoff*] || [istarget *-*-ultrix*] || [istarget *-*-irix\[1-4\]*] ] | |
9fb9af6e | 22 | set aout [expr [istarget *-*-bsd*] || [istarget *-*-openbsd*] ] |
252b5132 RH |
23 | set ilocks [istarget mipstx39*-*-*] |
24 | set gpr_ilocks [expr [istarget mipstx39*-*-*]] | |
25 | set addr32 [expr [istarget mipstx39*-*-*]] | |
26 | ||
dda688fc | 27 | if { [istarget "mips*-*-*linux*"] } then { |
ff8715d0 L |
28 | set tmips "t" |
29 | } else { | |
30 | set tmips "" | |
31 | } | |
0c4ec151 RS |
32 | if [istarget mips*el-*-*] { |
33 | set el el | |
34 | } { | |
35 | set el "" | |
36 | } | |
252b5132 RH |
37 | |
38 | run_dump_test "abs" | |
39 | run_dump_test "add" | |
40 | run_dump_test "and" | |
41 | run_dump_test "break20" | |
42 | run_dump_test "trap20" | |
43 | run_dump_test "beq" | |
44 | run_dump_test "bge" | |
45 | run_dump_test "bgeu" | |
46 | run_dump_test "blt" | |
47 | run_dump_test "bltu" | |
48 | if !$ilocks { run_dump_test "div" } else { run_dump_test "div-ilocks" } | |
49 | run_dump_test "dli" | |
ae948b86 | 50 | if $elf { |
7388e440 L |
51 | run_dump_test "elf-jal" |
52 | } else { | |
53 | run_dump_test "jal" | |
54 | } | |
ae948b86 TS |
55 | if $elf { run_dump_test "jal-svr4pic" } |
56 | if $elf { run_dump_test "jal-xgot" } | |
57 | if $ecoff { run_dump_test "jal-empic" } | |
252b5132 | 58 | if !$aout { run_dump_test "la" } |
ae948b86 TS |
59 | if $elf { run_dump_test "la-svr4pic" } |
60 | if $elf { run_dump_test "la-xgot" } | |
61 | if $ecoff { run_dump_test "la-empic" } | |
252b5132 | 62 | if !$aout { run_dump_test "lb" } |
ae948b86 TS |
63 | if $elf { run_dump_test "lb-svr4pic" } |
64 | if $elf { | |
252b5132 RH |
65 | # Both versions specify the cpu, so we can run both regardless of |
66 | # the interlocking in the configured default cpu. | |
67 | run_dump_test "lb-xgot" | |
68 | run_dump_test "lb-xgot-ilocks" | |
69 | } | |
ae948b86 | 70 | if $ecoff { run_dump_test "lb-empic" } |
252b5132 RH |
71 | if !$aout { |
72 | if !$gpr_ilocks { | |
73 | run_dump_test "ld" | |
74 | } else { | |
75 | if !$addr32 { | |
76 | run_dump_test "ld-ilocks" | |
77 | } else { | |
78 | run_dump_test "ld-ilocks-addr32" | |
79 | } | |
80 | } | |
81 | } | |
ae948b86 TS |
82 | if $elf { run_dump_test "ld-svr4pic" } |
83 | if $elf { run_dump_test "ld-xgot" } | |
84 | if $ecoff { run_dump_test "ld-empic" } | |
252b5132 RH |
85 | run_dump_test "li" |
86 | if !$aout { run_dump_test "lifloat" } | |
ae948b86 TS |
87 | if $elf { run_dump_test "lif-svr4pic" } |
88 | if $elf { run_dump_test "lif-xgot" } | |
89 | if $ecoff { run_dump_test "lif-empic" } | |
252b5132 RH |
90 | run_dump_test "mips4" |
91 | if !$ilocks { run_dump_test "mul" } else { run_dump_test "mul-ilocks" } | |
92 | run_dump_test "rol" | |
93 | if !$aout { run_dump_test "sb" } | |
94 | run_dump_test "trunc" | |
95 | if !$aout { run_dump_test "ulh" } | |
ae948b86 TS |
96 | if $elf { run_dump_test "ulh-svr4pic" } |
97 | if $elf { run_dump_test "ulh-xgot" } | |
98 | if $ecoff { run_dump_test "ulh-empic" } | |
252b5132 RH |
99 | if !$aout { |
100 | run_dump_test "ulw" | |
101 | run_dump_test "uld" | |
102 | run_dump_test "ush" | |
103 | run_dump_test "usw" | |
104 | run_dump_test "usd" | |
105 | } | |
106 | # The mips16 test can only be run on ELF, because only ELF | |
107 | # supports the necessary mips16 reloc. | |
ae948b86 | 108 | if { $elf && !$no_mips16 } { run_dump_test "mips16" } |
252b5132 RH |
109 | run_dump_test "delay" |
110 | run_dump_test "nodelay" | |
111 | run_dump_test "mips4010" | |
112 | run_dump_test "mips4650" | |
113 | run_dump_test "mips4100" | |
99c14723 | 114 | run_dump_test "perfcount" |
9160c09b L |
115 | # Linux uses ELF stabs, which doesn't support line number. |
116 | setup_xfail "mips*-*-*linux*" | |
252b5132 RH |
117 | run_dump_test "lineno" |
118 | run_dump_test "sync" | |
e7af610e | 119 | run_dump_test "mips32" |
0808b8a9 | 120 | run_dump_test "mips64" |
2228315b | 121 | run_dump_test "sb1-ext-ps" |
252b5132 | 122 | |
594e740f L |
123 | # It will always fail until someone fixes it. |
124 | setup_xfail "mips*-*-*" | |
125 | run_dump_test "relax" | |
126 | ||
d9e138e2 L |
127 | run_list_test "illegal" "" |
128 | ||
dc462216 RS |
129 | run_dump_test "mips-gp32-fp32" |
130 | run_dump_test "mips-gp32-fp64" | |
131 | run_dump_test "mips-gp64-fp32" | |
132 | run_dump_test "mips-gp64-fp64" | |
dc462216 | 133 | |
ae948b86 | 134 | if $elf { |
2cd5676f CD |
135 | # Make sure that -mcpu=FOO and -mFOO are equivalent. Assemble a file |
136 | # containing 4650-specific instructions with -m4650 and -mcpu=4650, | |
137 | # and verify that they're the same. Specifically, we're checking | |
138 | # that the EF_MIPS_MACH field is set, and that the 4650 'mul' | |
139 | # instruction does get used. In previous versions of GAS, | |
140 | # only -mcpu=4650 would set the EF_MIPS_MACH field; -m4650 wouldn't. | |
141 | run_dump_test "elf_e_flags1" | |
142 | run_dump_test "elf_e_flags2" | |
143 | run_dump_test "elf_e_flags3" | |
144 | run_dump_test "elf_e_flags4" | |
dc462216 RS |
145 | |
146 | run_dump_test "mips-gp32-fp32-pic" | |
147 | run_dump_test "mips-gp32-fp64-pic" | |
148 | run_dump_test "mips-gp64-fp32-pic" | |
149 | run_dump_test "mips-gp64-fp64-pic" | |
ae948b86 TS |
150 | |
151 | run_dump_test "mips-abi32" | |
152 | run_dump_test "mips-abi32-pic" | |
ff8715d0 | 153 | |
0c4ec151 | 154 | run_dump_test "elf${el}-rel" |
07147777 | 155 | if [istarget mips64*-*-*] { |
15ba8cc1 | 156 | run_dump_test "elf${el}-rel2" |
aea2ae6e | 157 | run_dump_test "elf-rel4" |
a90335ee | 158 | } { |
15ba8cc1 | 159 | run_dump_test "e32${el}-rel2" |
aea2ae6e | 160 | run_dump_test "e32-rel4" |
a90335ee | 161 | } |
0c4ec151 RS |
162 | run_dump_test "elf${el}-rel3" |
163 | run_dump_test "${tmips}${el}empic" | |
afdbd6d0 | 164 | run_dump_test "empic2" |
bb2d6cd7 | 165 | if { !$no_mips16 } { |
0c4ec151 | 166 | run_dump_test "${tmips}mips${el}16-e" |
dda688fc | 167 | run_dump_test "${tmips}mips${el}16-f" |
bb2d6cd7 | 168 | } |
07147777 | 169 | } |
252b5132 | 170 | } |