aboutsummaryrefslogtreecommitdiff
path: root/tests/ldi_d.c
blob: 7c9b36c9faf1a8ab39e6f623e5571683ed75cd54 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <ejit/ejit.h>
#include <assert.h>
#include "do_jit.h"

static double data = -1.5;

int main()
{
	struct ejit_func *f = ejit_create_func(EJIT_TYPE(double), 0, NULL);
	ejit_ldi_d(f, EJIT_FPR(0), &data);
	ejit_retr_f(f, EJIT_FPR(0));

	ejit_select_compile_func(f, 1, 0, EJIT_USE64(double), do_jit);

	assert(ejit_run_func_f(f, 0, NULL) == data);

	ejit_destroy_func(f);
}