Report illegal Z80 load instructions.
authorSergey Belyashov <sergey.belyashov@gmail.com>
Tue, 11 May 2021 09:57:04 +0000 (10:57 +0100)
committerNick Clifton <nickc@redhat.com>
Tue, 11 May 2021 09:57:04 +0000 (10:57 +0100)
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.

gas/ChangeLog
gas/config/tc-z80.c
gas/testsuite/gas/z80/ill_ops.d [new file with mode: 0644]
gas/testsuite/gas/z80/ill_ops.l [new file with mode: 0644]
gas/testsuite/gas/z80/ill_ops.s [new file with mode: 0644]

index 4b89aae25cc314062d13dadc45fff7866e2cbfac..459da066846fd674dd8819762ada8246940a7f58 100644 (file)
@@ -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
index b43a34f3dfb0d772dcd7a978c3101280500aea08..2146e675672a6ec09f3f41f8577bcc1e87cf413f 100644 (file)
@@ -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 (file)
index 0000000..869debf
--- /dev/null
@@ -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 (file)
index 0000000..8d8feb3
--- /dev/null
@@ -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 (file)
index 0000000..13e5637
--- /dev/null
@@ -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
This page took 0.029556 seconds and 4 git commands to generate.