2 * Simple test of (un)protecting a code buffer.
12 main(int argc, char *argv[])
15 jit_node_t *load, *label, *ok;
17 void (*function)(void);
18 int mmap_prot, mmap_flags;
21 _jit = jit_new_state();
25 load = jit_movi(JIT_R0, 0);
26 jit_ldr_c(JIT_R0, JIT_R0);
28 jit_patch_at(jit_beqi(JIT_R0, MARKER), ok);
32 label = jit_indirect();
33 jit_skip(1); /* Reserves enough space for a byte. */
34 jit_patch_at(load, label);
37 jit_pushargi((jit_word_t)"%s\n");
39 jit_pushargi((jit_word_t)"ok");
42 function = jit_emit();
47 ptr = jit_address (label);