# Pastebin FdNjcm7R fernando@fernando-OptiPlex-9020:~$ cat jit.p6 use NativeCall; sub gcc_jit_context_acquire() returns Pointer is native("gccjit") { * } sub gcc_jit_context_get_type(Pointer, int16) returns Pointer is native("gccjit") { * } sub gcc_jit_context_new_param(Pointer, Pointer, Pointer, Str) returns Pointer is native("gccjit") { * } sub gcc_jit_context_new_binary_op(Pointer, Pointer, int16, Pointer, Pointer, Pointer) returns Pointer is native("gccjit") { * } sub gcc_jit_param_as_rvalue(Pointer) returns Pointer is native("gccjit") { * }; sub gcc_jit_context_new_function(Pointer, int16, Pointer, Str, int16, CArray[Pointer], int16) returns Pointer is native("gccjit") { * } my Pointer $context = gcc_jit_context_acquire; my Pointer $int-type = gcc_jit_context_get_type($context, 8); my Pointer $param-a = gcc_jit_context_new_param($context, Pointer, $int-type, "a"); my Pointer $param-b = gcc_jit_context_new_param($context, Pointer, $int-type, "b"); my Pointer $a-plus-b = gcc_jit_context_new_binary_op($context, Pointer, 0, $int-type, gcc_jit_param_as_rvalue($param-a), gcc_jit_param_as_rvalue($param-b)); my Pointer $add-func = gcc_jit_context_new_function($context, 2, $int-type, "add", 2, CArray[Pointer].new($param-a, $param-b), 0); fernando@fernando-OptiPlex-9020:~$ perl6 jit.p6 Falha de segmentação (imagem do núcleo gravada)