[ gas/ChangeLog ]
[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 svr4pic [expr [istarget *-*-elf*] || [istarget *-*-irix5*] || [istarget *-*-irix6* ] || [istarget *-*-linux*] || [istarget *-*-netbsd*] ]
21 set empic [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 $svr4pic {
51 run_dump_test "elf-jal"
52 } else {
53 run_dump_test "jal"
54 }
55 if $svr4pic { run_dump_test "jal-svr4pic" }
56 if $svr4pic { run_dump_test "jal-xgot" }
57 if $empic { run_dump_test "jal-empic" }
58 if !$aout { run_dump_test "la" }
59 if $svr4pic { run_dump_test "la-svr4pic" }
60 if $svr4pic { run_dump_test "la-xgot" }
61 if $empic { run_dump_test "la-empic" }
62 if !$aout { run_dump_test "lb" }
63 if $svr4pic { run_dump_test "lb-svr4pic" }
64 if $svr4pic {
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 $empic { 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 $svr4pic { run_dump_test "ld-svr4pic" }
83 if $svr4pic { run_dump_test "ld-xgot" }
84 if $empic { run_dump_test "ld-empic" }
85 run_dump_test "li"
86 if !$aout { run_dump_test "lifloat" }
87 if $svr4pic { run_dump_test "lif-svr4pic" }
88 if $svr4pic { run_dump_test "lif-xgot" }
89 if $empic { 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 $svr4pic { run_dump_test "ulh-svr4pic" }
97 if $svr4pic { run_dump_test "ulh-xgot" }
98 if $empic { 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 { $svr4pic && !$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 run_dump_test "mips-abi32"
134
135 if $svr4pic {
136 # Make sure that -mcpu=FOO and -mFOO are equivalent. Assemble a file
137 # containing 4650-specific instructions with -m4650 and -mcpu=4650,
138 # and verify that they're the same. Specifically, we're checking
139 # that the EF_MIPS_MACH field is set, and that the 4650 'mul'
140 # instruction does get used. In previous versions of GAS,
141 # only -mcpu=4650 would set the EF_MIPS_MACH field; -m4650 wouldn't.
142 run_dump_test "elf_e_flags1"
143 run_dump_test "elf_e_flags2"
144 run_dump_test "elf_e_flags3"
145 run_dump_test "elf_e_flags4"
146
147 run_dump_test "mips-gp32-fp32-pic"
148 run_dump_test "mips-gp32-fp64-pic"
149 run_dump_test "mips-gp64-fp32-pic"
150 run_dump_test "mips-gp64-fp64-pic"
151 run_dump_test "mips-abi32-pic"
152
153 run_dump_test "elf${el}-rel"
154 if [istarget mips64*-*-*] {
155 run_dump_test "elf${el}-rel2"
156 run_dump_test "elf-rel4"
157 } {
158 run_dump_test "e32${el}-rel2"
159 run_dump_test "e32-rel4"
160 }
161 run_dump_test "elf${el}-rel3"
162 run_dump_test "${tmips}${el}empic"
163 run_dump_test "empic2"
164 if { !$no_mips16 } {
165 run_dump_test "${tmips}mips${el}16-e"
166 run_dump_test "${tmips}mips${el}16-f"
167 }
168 }
169 }
This page took 0.034456 seconds and 5 git commands to generate.