summaryrefslogtreecommitdiff
path: root/test/Bindings/OCaml
diff options
context:
space:
mode:
authorPeter Zotov <whitequark@whitequark.org>2014-12-01 19:50:39 +0000
committerPeter Zotov <whitequark@whitequark.org>2014-12-01 19:50:39 +0000
commit787a41926a0bc0aa04091c9e908becf2fbac9289 (patch)
treea8ea3a6e8c7f82546977525f165f2d3e39397192 /test/Bindings/OCaml
parenta0a26f222bb4ac0b6cf52fd4bbce6f2ad63a4321 (diff)
[OCaml] Move Llvm.clone_module to its own Llvm_transform_utils module.
This way most code won't link this (substantially large) library, if compiled statically with LLVM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223072 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Bindings/OCaml')
-rw-r--r--test/Bindings/OCaml/transform_utils.ml21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/Bindings/OCaml/transform_utils.ml b/test/Bindings/OCaml/transform_utils.ml
new file mode 100644
index 00000000000..6b46df173b0
--- /dev/null
+++ b/test/Bindings/OCaml/transform_utils.ml
@@ -0,0 +1,21 @@
+(* RUN: cp %s %T/transform_utils.ml
+ * RUN: %ocamlc -g -warn-error A -package llvm.transform_utils -linkpkg %T/transform_utils.ml -o %t
+ * RUN: %t
+ * RUN: %ocamlopt -g -warn-error A -package llvm.transform_utils -linkpkg %T/transform_utils.ml -o %t
+ * RUN: %t
+ * XFAIL: vg_leak
+ *)
+
+open Llvm
+open Llvm_transform_utils
+
+let context = global_context ()
+
+let test_clone_module () =
+ let m = create_module context "mod" in
+ let m' = clone_module m in
+ if m == m' then failwith "m == m'";
+ if string_of_llmodule m <> string_of_llmodule m' then failwith "string_of m <> m'"
+
+let () =
+ test_clone_module ()