On 3/13/23 16:38, Ilya Leoshkevich wrote:
Test EXECUTE and EXECUTE RELATIVE LONG with relative long instructions
as targets.

Signed-off-by: Ilya Leoshkevich <i...@linux.ibm.com>
---
  tests/tcg/s390x/Makefile.target    |   1 +
  tests/tcg/s390x/ex-relative-long.c | 149 +++++++++++++++++++++++++++++
  2 files changed, 150 insertions(+)
  create mode 100644 tests/tcg/s390x/ex-relative-long.c

diff --git a/tests/tcg/s390x/Makefile.target b/tests/tcg/s390x/Makefile.target
index 72ad309b273..ed2709ee2c3 100644
--- a/tests/tcg/s390x/Makefile.target
+++ b/tests/tcg/s390x/Makefile.target
@@ -28,6 +28,7 @@ TESTS+=div
  TESTS+=clst
  TESTS+=long-double
  TESTS+=cdsg
+TESTS+=ex-relative-long
cdsg: CFLAGS+=-pthread
  cdsg: LDFLAGS+=-pthread
diff --git a/tests/tcg/s390x/ex-relative-long.c 
b/tests/tcg/s390x/ex-relative-long.c
new file mode 100644
index 00000000000..e47dac7e2c3
--- /dev/null
+++ b/tests/tcg/s390x/ex-relative-long.c
@@ -0,0 +1,149 @@
+/* Check EXECUTE with relative long instructions as targets. */
+#include <stdlib.h>
+#include <stdio.h>
+
+struct test {
+    const char *name;
+    long (*func)(long reg, long *cc);
+    long exp_reg;
+    long exp_mem;
+    long exp_cc;
+};
+
+/* Variable targeted by relative long instructions. */
+long mem;

I guess you're assuming that the adjacent memory, which the buggy qemu would address, contains something other than


+/* Initial "mem" value. */
+#define MEM 0xfedcba9889abcdef

this?  Perhaps better to use an array, and address the middle of it?


r~

Reply via email to