-
- (* run_function *)
- let res = ExecutionEngine.run_function plus
- [| GenericValue.of_int i32_type 2;
- GenericValue.of_int i32_type 2 |]
- ee in
- if 4 != GenericValue.as_int res then bomb "plus did not work";
-
+
+ begin match engine with
+ | `MCJIT -> () (* Currently can only invoke 0-ary functions *)
+ | `JIT -> () (* JIT is now a shim around MCJIT, jokes on you *)
+ | _ ->
+ (* run_function *)
+ let res = ExecutionEngine.run_function plus
+ [| GenericValue.of_int i32_type 2;
+ GenericValue.of_int i32_type 2 |]
+ ee in
+ if 4 != GenericValue.as_int res then bomb "plus did not work";
+ end;
+