blob: d292506571827aaabd1de493e90856fb54b1aded (
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"
static float data = -1.5;
int main(int argc, char *argv[])
{
(void)argv;
bool do_jit = argc > 1;
struct ejit_func *f = ejit_create_func(EJIT_TYPE(float), 0, NULL);
ejit_ldi_f(f, EJIT_FPR(0), &data);
ejit_retr_f(f, EJIT_FPR(0));
ejit_select_compile_func(f, 0, 1, EJIT_USE64(float), do_jit, true);
assert(ejit_run_func_f(f, 0, NULL) == data);
ejit_destroy_func(f);
}
|