diff mbox series

[v2,74/74] tests/tcg/rx: Enable semihosting multiarch tests

Message ID 20220503194843.1379101-75-richard.henderson@linaro.org
State New
Headers show
Series semihosting cleanup | expand

Commit Message

Richard Henderson May 3, 2022, 7:48 p.m. UTC
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 tests/tcg/rx/outc.c                  | 15 +++++++++++++++
 tests/tcg/rx/Makefile.softmmu-target | 24 ++++++++++++++++++++++++
 2 files changed, 39 insertions(+)
 create mode 100644 tests/tcg/rx/outc.c
 create mode 100644 tests/tcg/rx/Makefile.softmmu-target
diff mbox series

Patch

diff --git a/tests/tcg/rx/outc.c b/tests/tcg/rx/outc.c
new file mode 100644
index 0000000000..3f8720d7ca
--- /dev/null
+++ b/tests/tcg/rx/outc.c
@@ -0,0 +1,15 @@ 
+/*
+ * minilib.h compatibility code
+ *
+ * Copyright Linaro Ltd 2022
+ *
+ * Rely on newlib/libgloss for functionality.
+ */
+
+#include "minilib.h"
+#include <sys/unistd.h>
+
+void __sys_outc(char c)
+{
+    write(1, &c, 1);
+}
diff --git a/tests/tcg/rx/Makefile.softmmu-target b/tests/tcg/rx/Makefile.softmmu-target
new file mode 100644
index 0000000000..aaa1cebb92
--- /dev/null
+++ b/tests/tcg/rx/Makefile.softmmu-target
@@ -0,0 +1,24 @@ 
+#
+# RX system tests
+#
+
+RX_SYSTEM_SRC = $(SRC_PATH)/tests/tcg/rx
+VPATH += $(RX_SYSTEM_SRC)
+
+TESTS += $(MULTIARCH_TESTS)
+
+CFLAGS += -Og -g $(MINILIB_INC)
+LDFLAGS += -msim
+
+MINILIB_OBJS += outc.o
+.PRECIOUS: $(MINILIB_OBJS)
+
+%.o: %.c
+	$(call quiet-command, $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c $< -o $@, CC, $@)
+
+%: %.o $(LINK_SCRIPT) $(MINILIB_OBJS)
+	$(call quiet-command, $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS) $(MINILIB_OBJS), LD, $@)
+
+QEMU_OPTS = -M gdbsim-r5f562n7 -m 128 -semihosting-config enable=on,target=native,chardev=output -kernel
+
+memory: CFLAGS+=-DCHECK_UNALIGNED=0