2014-10-30 08:29:45 +00:00
|
|
|
(* RUN: cp %s %T/ext_exc.ml
|
2014-11-03 09:50:53 +00:00
|
|
|
* RUN: %ocamlc -g -warn-error A -package llvm.bitreader -linkpkg %T/ext_exc.ml -o %t
|
|
|
|
* RUN: %t
|
|
|
|
* RUN: %ocamlopt -g -warn-error A -package llvm.bitreader -linkpkg %T/ext_exc.ml -o %t
|
2014-10-30 08:29:45 +00:00
|
|
|
* RUN: %t
|
2010-12-23 21:22:09 +00:00
|
|
|
* XFAIL: vg_leak
|
2010-12-23 15:49:26 +00:00
|
|
|
*)
|
2014-10-30 08:29:45 +00:00
|
|
|
|
2010-12-23 15:49:26 +00:00
|
|
|
let context = Llvm.global_context ()
|
2014-10-30 08:29:45 +00:00
|
|
|
|
2010-12-23 15:49:26 +00:00
|
|
|
(* 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 _ -> ();;
|