-(* RUN: %ocamlopt -warn-error A llvm.cmxa llvm_target.cmxa llvm_executionengine.cmxa %s -o %t
- * RUN: ./%t %t.bc
+(* RUN: rm -rf %t.builddir
+ * RUN: mkdir -p %t.builddir
+ * RUN: cp %s %t.builddir
+ * RUN: %ocamlopt -warn-error A llvm.cmxa llvm_target.cmxa llvm_executionengine.cmxa %t.builddir/executionengine.ml -o %t
+ * RUN: %t
+ * XFAIL: vg_leak
*)
open Llvm
let m2 = create_module (global_context ()) "test_module2" in
define_plus m2;
- let ee = ExecutionEngine.create (ModuleProvider.create m) in
- let mp2 = ModuleProvider.create m2 in
- ExecutionEngine.add_module_provider mp2 ee;
+ let ee = ExecutionEngine.create m in
+ ExecutionEngine.add_module m2 ee;
(* run_static_ctors *)
ExecutionEngine.run_static_ctors ee;
ee in
if 4 != GenericValue.as_int res then bomb "plus did not work";
- (* remove_module_provider *)
- Llvm.dispose_module (ExecutionEngine.remove_module_provider mp2 ee);
+ (* remove_module *)
+ Llvm.dispose_module (ExecutionEngine.remove_module m2 ee);
(* run_static_dtors *)
ExecutionEngine.run_static_dtors ee;
- (* Show that the target data binding links and runs.*)
- let td = ExecutionEngine.target_data ee in
+ (* Show that the data layout binding links and runs.*)
+ let dl = ExecutionEngine.data_layout ee in
(* Demonstrate that a garbage pointer wasn't returned. *)
- let ty = intptr_type td in
+ let ty = DataLayout.intptr_type context dl in
if ty != i32_type && ty != i64_type then bomb "target_data did not work";
(* dispose *)