79543515dfc47c78854ec0b6e799ad9bb09bb312
[oota-llvm.git] / test / Bindings / Ocaml / ext_exc.ml
1 (* RUN: %ocamlopt -warn-error A llvm.cmxa llvm_bitreader.cmxa llvm_executionengine.cmxa %s -o %t
2  * RUN: %t </dev/null
3  *)
4 let context = Llvm.global_context ()
5 (* this used to crash, we must not use 'external' in .mli files, but 'val' if we
6  * want the let _ bindings executed, see http://caml.inria.fr/mantis/view.php?id=4166 *)
7 let _ =
8     try
9         ignore (Llvm_bitreader.get_module context (Llvm.MemoryBuffer.of_stdin ()))
10     with
11     Llvm_bitreader.Error _ -> ();;
12 let _ =
13     try
14         ignore (Llvm.MemoryBuffer.of_file "/path/to/nonexistent/file")
15     with
16     Llvm.IoError _ -> ();;