aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Belyashov <sergey.belyashov@gmail.com>2021-05-11 10:57:04 +0100
committerNick Clifton <nickc@redhat.com>2021-05-11 10:57:04 +0100
commitcfe7a19169f54ce3a007f850b7adccbaec62d00a (patch)
tree18248f6f5740feeb33847a2248a8accf8b705084
parentf2f9554bf0d15a5b93289ebfef7e04d0aeb51a60 (diff)
downloadfsf-binutils-gdb-cfe7a19169f54ce3a007f850b7adccbaec62d00a.zip
fsf-binutils-gdb-cfe7a19169f54ce3a007f850b7adccbaec62d00a.tar.gz
fsf-binutils-gdb-cfe7a19169f54ce3a007f850b7adccbaec62d00a.tar.bz2
Report illegal Z80 load instructions.
PR 27823 * config/tc-z80.c (emit_ld_r_m): Report an illegal load instruction. * testsuite/gas/z80/ill_ops.s: New test source file. * testsuite/gas/z80/ill_ops.d: New test driver. * testsuite/gas/z80/ill_ops.l: New test error output.
-rw-r--r--gas/ChangeLog9
-rw-r--r--gas/config/tc-z80.c2
-rw-r--r--gas/testsuite/gas/z80/ill_ops.d3
-rw-r--r--gas/testsuite/gas/z80/ill_ops.l39
-rw-r--r--gas/testsuite/gas/z80/ill_ops.s42
5 files changed, 95 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 4b89aae..459da06 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,12 @@
+2021-05-11 Sergey Belyashov <sergey.belyashov@gmail.com>
+
+ PR 27823
+ * config/tc-z80.c (emit_ld_r_m): Report an illegal load
+ instruction.
+ * testsuite/gas/z80/ill_ops.s: New test source file.
+ * testsuite/gas/z80/ill_ops.d: New test driver.
+ * testsuite/gas/z80/ill_ops.l: New test error output.
+
2021-05-10 Sergey Belyashov <sergey.belyashov@gmail.com>
PR 27415
diff --git a/gas/config/tc-z80.c b/gas/config/tc-z80.c
index b43a34f..2146e67 100644
--- a/gas/config/tc-z80.c
+++ b/gas/config/tc-z80.c
@@ -2391,6 +2391,8 @@ emit_ld_r_m (expressionS *dst, expressionS *src)
*q = (ins_ok & INS_GBZ80) ? 0xFA : 0x3A;
emit_word (src);
}
+ else
+ ill_op ();
}
}
diff --git a/gas/testsuite/gas/z80/ill_ops.d b/gas/testsuite/gas/z80/ill_ops.d
new file mode 100644
index 0000000..869debf
--- /dev/null
+++ b/gas/testsuite/gas/z80/ill_ops.d
@@ -0,0 +1,3 @@
+#as:
+#name: illegal operations
+#error_output: ill_ops.l
diff --git a/gas/testsuite/gas/z80/ill_ops.l b/gas/testsuite/gas/z80/ill_ops.l
new file mode 100644
index 0000000..8d8feb3
--- /dev/null
+++ b/gas/testsuite/gas/z80/ill_ops.l
@@ -0,0 +1,39 @@
+[^:]*: Assembler messages:
+[^:]*:2: Error: illegal operand
+[^:]*:3: Error: illegal operand
+[^:]*:4: Error: illegal operand
+[^:]*:5: Error: illegal operand
+[^:]*:6: Error: illegal operand
+[^:]*:7: Error: illegal operand
+[^:]*:8: Error: illegal operand
+[^:]*:9: Error: illegal operand
+[^:]*:10: Error: illegal operand
+[^:]*:11: Error: illegal operand
+[^:]*:12: Error: illegal operand
+[^:]*:13: Error: illegal operand
+[^:]*:14: Error: illegal operand
+[^:]*:15: Error: illegal operand
+[^:]*:16: Error: illegal operand
+[^:]*:17: Error: illegal operand
+[^:]*:18: Error: illegal operand
+[^:]*:19: Error: illegal operand
+[^:]*:20: Error: illegal operand
+[^:]*:21: Error: illegal operand
+[^:]*:22: Error: illegal operand
+[^:]*:23: Error: illegal operand
+[^:]*:24: Error: illegal operand
+[^:]*:25: Error: illegal operand
+[^:]*:26: Error: illegal operand
+[^:]*:27: Error: illegal operand
+[^:]*:28: Error: illegal operand
+[^:]*:29: Error: illegal operand
+[^:]*:30: Error: illegal operand
+[^:]*:31: Error: illegal operand
+[^:]*:32: Error: illegal operand
+[^:]*:33: Error: illegal operand
+[^:]*:34: Error: illegal operand
+[^:]*:35: Error: illegal operand
+[^:]*:36: Error: illegal operand
+[^:]*:37: Error: illegal operand
+[^:]*:38: Error: illegal operand
+[^:]*:39: Error: illegal operand
diff --git a/gas/testsuite/gas/z80/ill_ops.s b/gas/testsuite/gas/z80/ill_ops.s
new file mode 100644
index 0000000..13e5637
--- /dev/null
+++ b/gas/testsuite/gas/z80/ill_ops.s
@@ -0,0 +1,42 @@
+.text
+ ld b,(var)
+ ld c,(var)
+ ld d,(var)
+ ld e,(var)
+ ld h,(var)
+ ld l,(var)
+ ld (var),(var)
+ ld (var),b
+ ld (var),c
+ ld (var),d
+ ld (var),h
+ ld (var),l
+ ld (var),10
+ ld 10,(var)
+ ld b,(bc)
+ ld c,(bc)
+ ld d,(bc)
+ ld e,(bc)
+ ld h,(bc)
+ ld l,(bc)
+ ld (bc),b
+ ld (bc),c
+ ld (bc),d
+ ld (bc),e
+ ld (bc),h
+ ld (bc),l
+ ld b,(de)
+ ld c,(de)
+ ld d,(de)
+ ld e,(de)
+ ld h,(de)
+ ld l,(de)
+ ld (de),b
+ ld (de),c
+ ld (de),d
+ ld (de),e
+ ld (de),h
+ ld (de),l
+.bss
+var:
+ .db 10