This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch][gas/testsuite/z80]Add some tests


I have added some tests for error reporting on target z80. One of them 
is a test for not accepting a register name as an ordinary symbol.

Applied with a mistake in the changelog entry (`.s' missing once):
gas/testsuite/Changelog:
	* gas/z80/jr-forwf.s: New file, adapted from z8k version.
	* gas/z80/jr-backf.s: Likewise.
	* gas/z80/djnz-backf.s: Likewise.
	* gas/z80/ill_op: New file, with illegal operand.
	* gas/z80/z80.exp: Run new tests.
Index: gas/z80/jr-forwf.s
===================================================================
RCS file: gas/z80/jr-forwf.s
diff -N gas/z80/jr-forwf.s
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gas/z80/jr-forwf.s	6 May 2012 10:46:41 -0000
@@ -0,0 +1,5 @@
+.text
+start:	jr c,dest
+	.space	128
+.globl dest
+dest:	nop
Index: gas/z80/jr-backf.s
===================================================================
RCS file: gas/z80/jr-backf.s
diff -N gas/z80/jr-backf.s
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gas/z80/jr-backf.s	6 May 2012 10:46:41 -0000
@@ -0,0 +1,7 @@
+.text
+.globl	start
+start:	nop
+	.space	126
+.globl	dest
+dest:	jr z,start
+	nop
Index: gas/z80/djnz-backf.s
===================================================================
RCS file: gas/z80/djnz-backf.s
diff -N gas/z80/djnz-backf.s
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gas/z80/djnz-backf.s	6 May 2012 10:46:41 -0000
@@ -0,0 +1,8 @@
+.text
+.globl	label1
+label1:	nop
+	.space	126
+
+	djnz	label1
+	nop
+
Index: gas/z80/ill_op.s
===================================================================
RCS file: gas/z80/ill_op.s
diff -N gas/z80/ill_op.s
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gas/z80/ill_op.s	6 May 2012 10:46:41 -0000
@@ -0,0 +1,2 @@
+.text
+ LD HL,(SP+0)
Index: gas/z80/z80.exp
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/z80/z80.exp,v
retrieving revision 1.8
diff -u -r1.8 z80.exp
--- gas/z80/z80.exp	5 Dec 2010 21:44:08 -0000	1.8
+++ gas/z80/z80.exp	6 May 2012 10:46:41 -0000
@@ -11,6 +11,10 @@
     run_dump_test "suffix"
 # test assembling and disassembling instructions involving offsets
     run_dump_test "offset"
+    gas_test_error "jr-forwf.s" "" "relative jump out of range (jr)"
+    gas_test_error "jr-backf.s" "" "relative jump out of range (jr)"
+    gas_test_error "djnz-backf.s" "" "relative jump out of range (djnz)"
+ 
 # test assembling instruction with offset that is a label defined later
     run_dump_test "atend"
 # test for data transfer instructions
@@ -29,4 +33,5 @@
     run_dump_test "inout"
 #test for other instructions
     run_dump_test "misc"
+    gas_test_error "ill_op.s" "" "Illegal operand: ld hl,(sp+0)"
 }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]