1 (* RUN: cp %s %T/vectorize_opts.ml
2 * RUN: %ocamlcomp -g -warn-error A -package llvm.vectorize -linkpkg %T/vectorize_opts.ml -o %t
7 (* Note: It takes several seconds for ocamlopt to link an executable with
8 libLLVMCore.a, so it's better to write a big test than a bunch of
15 let context = global_context ()
16 let void_type = Llvm.void_type context
18 (* Tiny unit test framework - really just to help find which line is busted *)
19 let print_checkpoints = false
22 if print_checkpoints then
23 prerr_endline (name ^ ":");
27 (*===-- Fixture -----------------------------------------------------------===*)
29 let filename = Sys.argv.(1)
30 let m = create_module context filename
33 (*===-- Transforms --------------------------------------------------------===*)
35 let test_transforms () =
36 let (++) x f = f x; x in
38 let fty = function_type void_type [| |] in
39 let fn = define_function "fn" fty m in
40 ignore (build_ret_void (builder_at_end context (entry_block fn)));
42 ignore (PassManager.create ()
46 ++ PassManager.run_module m
47 ++ PassManager.dispose)
50 (*===-- Driver ------------------------------------------------------------===*)
53 suite "transforms" test_transforms;