This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Patch for illegal operands in mips assembler
- To: binutils at sourceware dot cygnus dot com
- Subject: Patch for illegal operands in mips assembler
- From: "H . J . Lu" <hjl at lucon dot org>
- Date: Fri, 8 Jun 2001 21:59:03 -0700
For this code:
--
# Source file used to test illegal operands.
foo:
move 1,2
c.eq.s 1,2
---
The current mips assembler gives
illegal.s: Assembler messages:
illegal.s:4: Error: illegal operands `move'
illegal.s:5: Error: opcode not supported on this processor: R3000 (MIPS1) `c.eq.s'
instead of
illegal.s: Assembler messages:
illegal.s:4: Error: illegal operands `move 1,2'
illegal.s:5: Error: illegal operands `c.eq.s 1,2'
The error message doesn't make much senses and misleading. I
checked in the following testcase.
H.J.
---
2001-06-08 H.J. Lu <hjl@gnu.org>
* gas/mips/illegal.s: New file.
* gas/mips/illegal.l: Likewise.
* gas/elf/elf.exp (run_list_test): New.
Run illegal with run_list_test.
Index: gas/mips/mips.exp
===================================================================
RCS file: /work/cvs/gnu/binutils/gas/testsuite/gas/mips/mips.exp,v
retrieving revision 1.1.1.10
diff -u -p -r1.1.1.10 mips.exp
--- gas/mips/mips.exp 2001/06/07 17:35:41 1.1.1.10
+++ gas/mips/mips.exp 2001/06/09 04:50:35
@@ -1,6 +1,20 @@
#
# Some generic MIPS tests
#
+
+proc run_list_test { name opts } {
+ global srcdir subdir
+ set testname "MIPS $name"
+ set file $srcdir/$subdir/$name
+ gas_run ${name}.s $opts ">&dump.out"
+ if { [regexp_diff "dump.out" "${file}.l"] } then {
+ fail $testname
+ verbose "output is [file_contents "dump.out"]" 2
+ return
+ }
+ pass $testname
+}
+
if { [istarget mips*-*-*] } then {
set no_mips16 0
set svr4pic [expr [istarget *-*-elf*] || [istarget *-*-irix5*] || [istarget *-*-irix6* ] || [istarget *-*-linux*] ]
@@ -94,6 +108,8 @@ if { [istarget mips*-*-*] } then {
run_dump_test "sync"
run_dump_test "mips32"
run_dump_test "mips64"
+
+ run_list_test "illegal" ""
if $svr4pic {
# Make sure that -mcpu=FOO and -mFOO are equivalent. Assemble a file
--- /dev/null Fri Mar 23 20:37:44 2001
+++ gas/mips/illegal.s Fri Jun 8 21:41:42 2001
@@ -0,0 +1,5 @@
+# Source file used to test illegal operands.
+
+foo:
+ move 1,2
+ c.eq.s 1,2
--- /dev/null Fri Mar 23 20:37:44 2001
+++ gas/mips/illegal.l Fri Jun 8 21:42:04 2001
@@ -0,0 +1,3 @@
+.*: Assembler messages:
+.*:4: Error: illegal operands `move 1,2'
+.*:5: Error: illegal operands `c.eq.s 1,2'