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