summaryrefslogtreecommitdiff
path: root/test/Bindings
diff options
context:
space:
mode:
Diffstat (limited to 'test/Bindings')
-rw-r--r--test/Bindings/Ocaml/ext_exc.ml16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Bindings/Ocaml/ext_exc.ml b/test/Bindings/Ocaml/ext_exc.ml
new file mode 100644
index 0000000000..79543515df
--- /dev/null
+++ b/test/Bindings/Ocaml/ext_exc.ml
@@ -0,0 +1,16 @@
+(* RUN: %ocamlopt -warn-error A llvm.cmxa llvm_bitreader.cmxa llvm_executionengine.cmxa %s -o %t
+ * RUN: %t </dev/null
+ *)
+let context = Llvm.global_context ()
+(* this used to crash, we must not use 'external' in .mli files, but 'val' if we
+ * want the let _ bindings executed, see http://caml.inria.fr/mantis/view.php?id=4166 *)
+let _ =
+ try
+ ignore (Llvm_bitreader.get_module context (Llvm.MemoryBuffer.of_stdin ()))
+ with
+ Llvm_bitreader.Error _ -> ();;
+let _ =
+ try
+ ignore (Llvm.MemoryBuffer.of_file "/path/to/nonexistent/file")
+ with
+ Llvm.IoError _ -> ();;