26 lines · plain
1(* RUN: rm -rf %t && mkdir -p %t && cp %s %t/ext_exc.ml2 * RUN: %ocamlc -g -w +A -package llvm.bitreader -linkpkg %t/ext_exc.ml -o %t/executable3 * RUN: %t/executable4 * RUN: %ocamlopt -g -w +A -package llvm.bitreader -linkpkg %t/ext_exc.ml -o %t/executable5 * RUN: %t/executable6 * XFAIL: vg_leak7 *)8 9let context = Llvm.global_context ()10 11let diagnostic_handler _ = ()12 13(* This used to crash, we must not use 'external' in .mli files, but 'val' if we14 * want the let _ bindings executed, see http://caml.inria.fr/mantis/view.php?id=4166 *)15let _ =16 Llvm.set_diagnostic_handler context (Some diagnostic_handler);17 try18 ignore (Llvm_bitreader.get_module context (Llvm.MemoryBuffer.of_stdin ()))19 with20 Llvm_bitreader.Error _ -> ();;21let _ =22 try23 ignore (Llvm.MemoryBuffer.of_file "/path/to/nonexistent/file")24 with25 Llvm.IoError _ -> ();;26