blob: a7a8c9854113fe29cb6fa33c55be95a98695ca60 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#include <ejit/ejit.h>
#include <assert.h>
#include "do_jit.h"
int main()
{
static uint64_t data[] = { 0xffffffffffffffff, 0x00000000,
0x42424242 };
struct ejit_func *f = ejit_create_func(EJIT_TYPE(unsigned long), 0,
NULL);
ejit_ldi_i64(f, EJIT_GPR(0), data);
ejit_retr(f, EJIT_GPR(0));
ejit_select_compile_func(f, 1, 0, true, do_jit);
assert(ejit_run_func(f, 0, NULL) == -1);
ejit_destroy_func(f);
}
|