2001-06-08 H.J. Lu <hjl@gnu.org>
[binutils-gdb.git] / gas / testsuite / gas / mips / mips.exp
1 #
2 # Some generic MIPS tests
3 #
4 if { [istarget mips*-*-*] } then {
5 set no_mips16 0
6 set svr4pic [expr [istarget *-*-elf*] || [istarget *-*-irix5*] || [istarget *-*-irix6* ] || [istarget *-*-linux*] ]
7 set empic [expr [istarget *-*-ecoff*] || [istarget *-*-ultrix*] || [istarget *-*-irix\[1-4\]*] ]
8 set aout [expr [istarget *-*-bsd*] || [istarget *-*-netbsd*] || [istarget *-*-openbsd*] ]
9 set ilocks [istarget mipstx39*-*-*]
10 set gpr_ilocks [expr [istarget mipstx39*-*-*]]
11 set addr32 [expr [istarget mipstx39*-*-*]]
12
13 if { [istarget mips*el-*-*] || [istarget "mips*-*-*linux*"] } then {
14 set tmips "t"
15 } else {
16 set tmips ""
17 }
18
19 run_dump_test "abs"
20 run_dump_test "add"
21 run_dump_test "and"
22 run_dump_test "break20"
23 run_dump_test "trap20"
24 run_dump_test "beq"
25 run_dump_test "bge"
26 run_dump_test "bgeu"
27 run_dump_test "blt"
28 run_dump_test "bltu"
29 if !$ilocks { run_dump_test "div" } else { run_dump_test "div-ilocks" }
30 run_dump_test "dli"
31 if $svr4pic {
32 run_dump_test "elf-jal"
33 } else {
34 run_dump_test "jal"
35 }
36 if $svr4pic { run_dump_test "jal-svr4pic" }
37 if $svr4pic { run_dump_test "jal-xgot" }
38 if $empic { run_dump_test "jal-empic" }
39 if !$aout { run_dump_test "la" }
40 if $svr4pic { run_dump_test "la-svr4pic" }
41 if $svr4pic { run_dump_test "la-xgot" }
42 if $empic { run_dump_test "la-empic" }
43 if !$aout { run_dump_test "lb" }
44 if $svr4pic { run_dump_test "lb-svr4pic" }
45 if $svr4pic {
46 # Both versions specify the cpu, so we can run both regardless of
47 # the interlocking in the configured default cpu.
48 run_dump_test "lb-xgot"
49 run_dump_test "lb-xgot-ilocks"
50 }
51 if $empic { run_dump_test "lb-empic" }
52 if !$aout {
53 if !$gpr_ilocks {
54 run_dump_test "ld"
55 } else {
56 if !$addr32 {
57 run_dump_test "ld-ilocks"
58 } else {
59 run_dump_test "ld-ilocks-addr32"
60 }
61 }
62 }
63 if $svr4pic { run_dump_test "ld-svr4pic" }
64 if $svr4pic { run_dump_test "ld-xgot" }
65 if $empic { run_dump_test "ld-empic" }
66 run_dump_test "li"
67 if !$aout { run_dump_test "lifloat" }
68 if $svr4pic { run_dump_test "lif-svr4pic" }
69 if $svr4pic { run_dump_test "lif-xgot" }
70 if $empic { run_dump_test "lif-empic" }
71 run_dump_test "mips4"
72 if !$ilocks { run_dump_test "mul" } else { run_dump_test "mul-ilocks" }
73 run_dump_test "rol"
74 if !$aout { run_dump_test "sb" }
75 run_dump_test "trunc"
76 if !$aout { run_dump_test "ulh" }
77 if $svr4pic { run_dump_test "ulh-svr4pic" }
78 if $svr4pic { run_dump_test "ulh-xgot" }
79 if $empic { run_dump_test "ulh-empic" }
80 if !$aout {
81 run_dump_test "ulw"
82 run_dump_test "uld"
83 run_dump_test "ush"
84 run_dump_test "usw"
85 run_dump_test "usd"
86 }
87 # The mips16 test can only be run on ELF, because only ELF
88 # supports the necessary mips16 reloc.
89 if { $svr4pic && !$no_mips16 } { run_dump_test "mips16" }
90 run_dump_test "delay"
91 run_dump_test "nodelay"
92 run_dump_test "mips4010"
93 run_dump_test "mips4650"
94 run_dump_test "mips4100"
95 # Linux uses ELF stabs, which doesn't support line number.
96 setup_xfail "mips*-*-*linux*"
97 run_dump_test "lineno"
98 run_dump_test "sync"
99 run_dump_test "mips32"
100 run_dump_test "mips64"
101
102 if $svr4pic {
103 # Make sure that -mcpu=FOO and -mFOO are equivalent. Assemble a file
104 # containing 4650-specific instructions with -m4650 and -mcpu=4650,
105 # and verify that they're the same. Specifically, we're checking
106 # that the EF_MIPS_MACH field is set, and that the 4650 'mul'
107 # instruction does get used. In previous versions of GAS,
108 # only -mcpu=4650 would set the EF_MIPS_MACH field; -m4650 wouldn't.
109 run_dump_test "elf_e_flags1"
110 run_dump_test "elf_e_flags2"
111 run_dump_test "elf_e_flags3"
112 run_dump_test "elf_e_flags4"
113
114 if [istarget mips*el-*-*] {
115 run_dump_test "elfel-rel"
116 } {
117 run_dump_test "elf-rel"
118 }
119
120 if [istarget mips64*-*-*] {
121 if [istarget mips*el-*-*] {
122 run_dump_test "elfel-rel2"
123 } {
124 run_dump_test "elf-rel2"
125 }
126 } {
127 if [istarget mips*el-*-*] {
128 run_dump_test "e32el-rel2"
129 } {
130 run_dump_test "e32-rel2"
131 }
132 }
133
134 if [istarget mips*el-*-*] {
135 run_dump_test "elfel-rel3"
136 } {
137 run_dump_test "elf-rel3"
138 }
139
140 if [istarget mips*el-*-*] {
141 run_dump_test "${tmips}elempic"
142 } {
143 run_dump_test "${tmips}empic"
144 }
145
146 if { !$no_mips16 } {
147 if [istarget mips*el-*-*] {
148 run_dump_test "${tmips}mipsel16-e"
149 } {
150 run_dump_test "${tmips}mips16-e"
151 }
152 setup_xfail "mips*-*-*"
153 if [istarget mips*el-*-*] {
154 run_dump_test "mipsel16-f"
155 } {
156 run_dump_test "mips16-f"
157 }
158 }
159 }
160 }