diff options
author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-06-30 16:39:24 +0300 |
---|---|---|
committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-06-30 16:40:12 +0300 |
commit | e618924df98d4ee5037db86c768a8c8014e49c4c (patch) | |
tree | abf7e2457f49c52d3ea6c6c5fb79577e5a4ad011 /tests/ldi_i8.c | |
parent | 451797936119d8236843c4e9aee4a47dc5cddd56 (diff) | |
download | ejit-e618924df98d4ee5037db86c768a8c8014e49c4c.tar.gz ejit-e618924df98d4ee5037db86c768a8c8014e49c4c.zip |
work through loads and stores
Diffstat (limited to 'tests/ldi_i8.c')
-rw-r--r-- | tests/ldi_i8.c | 19 |
1 files changed, 19 insertions, 0 deletions
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); +} |