* config/tc-mips.c (support_64bit_objects): Define for OBJ_ELF only.
[deliverable/binutils-gdb.git] / gas / testsuite / gas / mips / mips.exp
1 #
2 # Some generic MIPS tests
3 #
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
18 if { [istarget mips*-*-*] } then {
19 set no_mips16 0
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\]*] ]
22 set aout [expr [istarget *-*-bsd*] || [istarget *-*-openbsd*] ]
23 set ilocks [istarget mipstx39*-*-*]
24 set gpr_ilocks [expr [istarget mipstx39*-*-*]]
25 set addr32 [expr [istarget mipstx39*-*-*]]
26
27 if { [istarget "mips*-*-*linux*"] } then {
28 set tmips "t"
29 } else {
30 set tmips ""
31 }
32 if [istarget mips*el-*-*] {
33 set el el
34 } {
35 set el ""
36 }
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"
50 if $elf {
51 run_dump_test "elf-jal"
52 } else {
53 run_dump_test "jal"
54 }
55 if $elf { run_dump_test "jal-svr4pic" }
56 if $elf { run_dump_test "jal-xgot" }
57 if $ecoff { run_dump_test "jal-empic" }
58 if !$aout { run_dump_test "la" }
59 if $elf { run_dump_test "la-svr4pic" }
60 if $elf { run_dump_test "la-xgot" }
61 if $ecoff { run_dump_test "la-empic" }
62 if !$aout { run_dump_test "lb" }
63 if $elf { run_dump_test "lb-svr4pic" }
64 if $elf {
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 }
70 if $ecoff { run_dump_test "lb-empic" }
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 }
82 if $elf { run_dump_test "ld-svr4pic" }
83 if $elf { run_dump_test "ld-xgot" }
84 if $ecoff { run_dump_test "ld-empic" }
85 run_dump_test "li"
86 if !$aout { run_dump_test "lifloat" }
87 if $elf { run_dump_test "lif-svr4pic" }
88 if $elf { run_dump_test "lif-xgot" }
89 if $ecoff { run_dump_test "lif-empic" }
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" }
96 if $elf { run_dump_test "ulh-svr4pic" }
97 if $elf { run_dump_test "ulh-xgot" }
98 if $ecoff { run_dump_test "ulh-empic" }
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.
108 if { $elf && !$no_mips16 } { run_dump_test "mips16" }
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"
114 run_dump_test "perfcount"
115 # Linux uses ELF stabs, which doesn't support line number.
116 setup_xfail "mips*-*-*linux*"
117 run_dump_test "lineno"
118 run_dump_test "sync"
119 run_dump_test "mips32"
120 run_dump_test "mips64"
121 run_dump_test "sb1-ext-ps"
122
123 # It will always fail until someone fixes it.
124 setup_xfail "mips*-*-*"
125 run_dump_test "relax"
126
127 run_list_test "illegal" ""
128
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"
133
134 if $elf {
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"
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"
150
151 run_dump_test "mips-abi32"
152 run_dump_test "mips-abi32-pic"
153
154 run_dump_test "elf${el}-rel"
155 if [istarget mips64*-*-*] {
156 run_dump_test "elf${el}-rel2"
157 run_dump_test "elf-rel4"
158 } {
159 run_dump_test "e32${el}-rel2"
160 run_dump_test "e32-rel4"
161 }
162 run_dump_test "elf${el}-rel3"
163 run_dump_test "${tmips}${el}empic"
164 run_dump_test "empic2"
165 if { !$no_mips16 } {
166 run_dump_test "${tmips}mips${el}16-e"
167 run_dump_test "${tmips}mips${el}16-f"
168 }
169 }
170 }
This page took 0.042884 seconds and 5 git commands to generate.