Home | History | Annotate | Download | only in OCaml
      1 (* RUN: cp %s %T/ext_exc.ml
      2  * RUN: %ocamlc -g -w +A -package llvm.bitreader -linkpkg %T/ext_exc.ml -o %t
      3  * RUN: %t
      4  * RUN: %ocamlopt -g -w +A -package llvm.bitreader -linkpkg %T/ext_exc.ml -o %t
      5  * RUN: %t
      6  * XFAIL: vg_leak
      7  *)
      8 
      9 let context = Llvm.global_context ()
     10 
     11 (* this used to crash, we must not use 'external' in .mli files, but 'val' if we
     12  * want the let _ bindings executed, see http://caml.inria.fr/mantis/view.php?id=4166 *)
     13 let _ =
     14     try
     15         ignore (Llvm_bitreader.get_module context (Llvm.MemoryBuffer.of_stdin ()))
     16     with
     17     Llvm_bitreader.Error _ -> ();;
     18 let _ =
     19     try
     20         ignore (Llvm.MemoryBuffer.of_file "/path/to/nonexistent/file")
     21     with
     22     Llvm.IoError _ -> ();;
     23