2008-10-22 12:41:54 +00:00
|
|
|
(* RUN: %ocamlc -warn-error A llvm.cma llvm_bitwriter.cma %s -o %t 2> /dev/null
|
2007-09-18 12:49:39 +00:00
|
|
|
* RUN: ./%t %t.bc
|
|
|
|
* RUN: llvm-dis < %t.bc | grep caml_int_ty
|
|
|
|
*)
|
|
|
|
|
|
|
|
(* Note that this takes a moment to link, so it's best to keep the number of
|
|
|
|
individual tests low. *)
|
|
|
|
|
2009-08-19 17:32:24 +00:00
|
|
|
let context = Llvm.global_context ()
|
|
|
|
|
2007-09-18 12:49:39 +00:00
|
|
|
let test x = if not x then exit 1 else ()
|
|
|
|
|
|
|
|
let _ =
|
2009-08-19 17:32:24 +00:00
|
|
|
let m = Llvm.create_module context "ocaml_test_module" in
|
2007-09-18 12:49:39 +00:00
|
|
|
|
2009-08-19 17:32:24 +00:00
|
|
|
ignore (Llvm.define_type_name "caml_int_ty" (Llvm.i32_type context) m);
|
2007-09-18 12:49:39 +00:00
|
|
|
|
|
|
|
test (Llvm_bitwriter.write_bitcode_file m Sys.argv.(1))
|