This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: mn10300: don't accept `mov pc,r[0-7]'
On Jan 22, 2002, Richard Henderson <rth@redhat.com> wrote:
> On Tue, Jan 22, 2002 at 07:39:36PM -0200, Alexandre Oliva wrote:
>> Here's a patch that fixes the problem. I've tried to introduce a
>> negative test for the inappropriately-supported instructions, but I
>> couldn't figure out how to do it.
> See, for example, testsuite/gas/alpha/elf-reloc-2.[sl].
Thanks, that's the hint I needed. Here's the testcase I'm checking in
along with the patch that Eric approved.
Index: gas/testsuite/gas/mn10300/basic.exp
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/mn10300/basic.exp,v
retrieving revision 1.4
diff -u -p -r1.4 basic.exp
--- gas/testsuite/gas/mn10300/basic.exp 2000/05/29 20:10:32 1.4
+++ gas/testsuite/gas/mn10300/basic.exp 2002/01/23 01:43:41
@@ -1,4 +1,4 @@
-# Copyright (C) 1996, 2000 Free Software Foundation, Inc.
+# Copyright (C) 1996, 2000, 2002 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -1734,7 +1734,20 @@ proc do_am33_8 {} {
if [expr $x==67] then { pass $testname } else { fail $testname }
}
+proc run_list_test { name opts } {
+ global srcdir subdir
+ set testname "alpha $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 mn10300*-*-*] then {
# Test the basic instruction parser.
do_add
@@ -1765,4 +1778,6 @@ if [istarget mn10300*-*-*] then {
do_am33_6
do_am33_7
do_am33_8
+
+ run_list_test "movpc" ""
}
Index: gas/testsuite/gas/mn10300/movpc.l
===================================================================
RCS file: movpc.l
diff -N movpc.l
--- /dev/null Tue May 5 13:32:27 1998
+++ gas/testsuite/gas/mn10300/movpc.l Tue Jan 22 17:43:42 2002
@@ -0,0 +1,25 @@
+.*: Assembler messages:
+.*:6: Error: Invalid opcode/operands
+.*:7: Error: Unrecognized opcode: .*
+.*:7: Error: Invalid opcode/operands
+.*:8: Error: Unrecognized opcode: .*
+.*:8: Error: Invalid opcode/operands
+.*:9: Error: Unrecognized opcode: .*
+.*:9: Error: Invalid opcode/operands
+.*:10: Error: Unrecognized opcode: .*
+.*:10: Error: Invalid opcode/operands
+.*:11: Error: Unrecognized opcode: .*
+.*:11: Error: Invalid opcode/operands
+.*:12: Error: Unrecognized opcode: .*
+.*:12: Error: Invalid opcode/operands
+.*:13: Error: Unrecognized opcode: .*
+.*:13: Error: Invalid opcode/operands
+.*:14: Error: Unrecognized opcode: .*
+.*:14: Error: Invalid opcode/operands
+.*:15: Error: Unrecognized opcode: .*
+.*:15: Error: Invalid opcode/operands
+.*:16: Error: Unrecognized opcode: .*
+.*:16: Error: Invalid opcode/operands
+.*:17: Error: Unrecognized opcode: .*
+.*:17: Error: Invalid opcode/operands
+.*:18: Error: Unrecognized opcode: .*
Index: gas/testsuite/gas/mn10300/movpc.s
===================================================================
RCS file: movpc.s
diff -N movpc.s
--- /dev/null Tue May 5 13:32:27 1998
+++ gas/testsuite/gas/mn10300/movpc.s Tue Jan 22 17:43:42 2002
@@ -0,0 +1,17 @@
+ .am33
+ mov pc,a0
+ mov pc,a1
+ mov pc,a2
+ mov pc,a3
+ mov pc,d0
+ mov pc,d1
+ mov pc,d2
+ mov pc,d3
+ mov pc,r0
+ mov pc,r1
+ mov pc,r2
+ mov pc,r3
+ mov pc,r4
+ mov pc,r5
+ mov pc,r6
+ mov pc,r7
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me