[llvm] [OCaml][NPM] Add OCaml bindings to new pass manager (PR #66421)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 14 15:53:29 PDT 2023
================
@@ -0,0 +1,50 @@
+(* RUN: rm -rf %t && mkdir -p %t && cp %s %t/passbuilder.ml
+ * RUN: %ocamlc -g -w +A -package llvm.passbuilder -package llvm.all_backends -linkpkg %t/passbuilder.ml -o %t/executable
+ * RUN: %t/executable
+ * RUN: %ocamlopt -g -w +A -package llvm.passbuilder -package llvm.all_backends -linkpkg %t/passbuilder.ml -o %t/executable
+ * RUN: %t/executable
+ * XFAIL: vg_leak
+ *)
+
+let () = Llvm_all_backends.initialize ()
+
+(*===-- Fixture -----------------------------------------------------------===*)
+
+let context = Llvm.global_context ()
+
+let m = Llvm.create_module context "mymodule"
----------------
alan-j-hu wrote:
I couldn't figure out how to manipulate the OCaml test infrastructure to read `llvm/test/Other/new-pass-manager.ll `, so I recreated it via the OCaml API. After all, the actual LLVM IR in that file is just a small function, and the rest of it is test scripts irrelevant to testing the OCaml bindings.
https://github.com/llvm/llvm-project/pull/66421
More information about the llvm-commits
mailing list