From e618924df98d4ee5037db86c768a8c8014e49c4c Mon Sep 17 00:00:00 2001
From: Kimplul <kimi.h.kuparinen@gmail.com>
Date: Sun, 30 Jun 2024 16:39:24 +0300
Subject: work through loads and stores

---
 tests/ldi_i8.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 tests/ldi_i8.c

(limited to 'tests/ldi_i8.c')

diff --git a/tests/ldi_i8.c b/tests/ldi_i8.c
new file mode 100644
index 0000000..2d3c55a
--- /dev/null
+++ b/tests/ldi_i8.c
@@ -0,0 +1,19 @@
+#include <ejit/ejit.h>
+#include <assert.h>
+#include "do_jit.h"
+
+static uint8_t data[] = { 0xff, 0x00, 0x42 };
+
+int main()
+{
+	struct ejit_func *f = ejit_create_func(EJIT_TYPE(unsigned long), 0,
+	                                       NULL);
+	ejit_ldi_i8(f, EJIT_GPR(0), &data[0]);
+	ejit_retr(f, EJIT_GPR(0));
+
+	ejit_select_compile_func(f, 1, 0, EJIT_USE64(unsigned long), do_jit);
+
+	assert(ejit_run_func(f, 0, NULL) == -1);
+
+	ejit_destroy_func(f);
+}
-- 
cgit v1.2.3