1 (* RUN: rm -rf %t && mkdir -p %t && cp %s %t/ext_exc.ml
2 * RUN: %ocamlc -g -w +A -package llvm.bitreader -linkpkg %t/ext_exc.ml -o %t/executable
4 * RUN: %ocamlopt -g -w +A -package llvm.bitreader -linkpkg %t/ext_exc.ml -o %t/executable
9 let context = Llvm.global_context
()
11 let diagnostic_handler _
= ()
13 (* This used to crash, we must not use 'external' in .mli files, but 'val' if we
14 * want the let _ bindings executed, see http://caml.inria.fr/mantis/view.php?id=4166 *)
16 Llvm.set_diagnostic_handler
context (Some
diagnostic_handler);
18 ignore
(Llvm_bitreader.get_module
context (Llvm.MemoryBuffer.of_stdin
()))
20 Llvm_bitreader.Error
_ -> ();;
23 ignore
(Llvm.MemoryBuffer.of_file
"/path/to/nonexistent/file")
25 Llvm.IoError
_ -> ();;