summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Bindings/Ocaml/analysis.ml6
-rw-r--r--llvm/test/Bindings/Ocaml/bitreader.ml6
-rw-r--r--llvm/test/Bindings/Ocaml/bitwriter.ml6
-rw-r--r--llvm/test/Bindings/Ocaml/executionengine.ml9
-rw-r--r--llvm/test/Bindings/Ocaml/ext_exc.ml10
-rw-r--r--llvm/test/Bindings/Ocaml/ipo_opts.ml6
-rw-r--r--llvm/test/Bindings/Ocaml/irreader.ml6
-rw-r--r--llvm/test/Bindings/Ocaml/linker.ml6
-rw-r--r--llvm/test/Bindings/Ocaml/lit.local.cfg3
-rw-r--r--llvm/test/Bindings/Ocaml/passmgr_builder.ml6
-rw-r--r--llvm/test/Bindings/Ocaml/scalar_opts.ml6
-rw-r--r--llvm/test/Bindings/Ocaml/target.ml6
-rw-r--r--llvm/test/Bindings/Ocaml/vectorize_opts.ml6
-rw-r--r--llvm/test/Bindings/Ocaml/vmcore.ml6
-rw-r--r--llvm/test/Makefile8
-rw-r--r--llvm/test/lit.cfg16
-rw-r--r--llvm/test/lit.site.cfg.in6
17 files changed, 54 insertions, 64 deletions
diff --git a/llvm/test/Bindings/Ocaml/analysis.ml b/llvm/test/Bindings/Ocaml/analysis.ml
index 0694ed1774f..84e1429279a 100644
--- a/llvm/test/Bindings/Ocaml/analysis.ml
+++ b/llvm/test/Bindings/Ocaml/analysis.ml
@@ -1,7 +1,5 @@
-(* RUN: rm -rf %t.builddir
- * RUN: mkdir -p %t.builddir
- * RUN: cp %s %t.builddir
- * RUN: %ocamlcomp -warn-error A llvm.%cma llvm_analysis.%cma %t.builddir/analysis.ml -o %t
+(* RUN: cp %s %T/analysis.ml
+ * RUN: %ocamlcomp -warn-error A -package llvm.analysis -linkpkg %T/analysis.ml -o %t
* RUN: %t
* XFAIL: vg_leak
*)
diff --git a/llvm/test/Bindings/Ocaml/bitreader.ml b/llvm/test/Bindings/Ocaml/bitreader.ml
index 973c8a77bcb..28c04a6abc0 100644
--- a/llvm/test/Bindings/Ocaml/bitreader.ml
+++ b/llvm/test/Bindings/Ocaml/bitreader.ml
@@ -1,7 +1,5 @@
-(* RUN: rm -rf %t.builddir
- * RUN: mkdir -p %t.builddir
- * RUN: cp %s %t.builddir
- * RUN: %ocamlcomp -warn-error A llvm.%cma llvm_bitreader.%cma llvm_bitwriter.%cma %t.builddir/bitreader.ml -o %t
+(* RUN: cp %s %T/bitreader.ml
+ * RUN: %ocamlcomp -warn-error A -package llvm.bitreader -package llvm.bitwriter -linkpkg %T/bitreader.ml -o %t
* RUN: %t %t.bc
* RUN: llvm-dis < %t.bc
* XFAIL: vg_leak
diff --git a/llvm/test/Bindings/Ocaml/bitwriter.ml b/llvm/test/Bindings/Ocaml/bitwriter.ml
index 98c04172a26..746836508eb 100644
--- a/llvm/test/Bindings/Ocaml/bitwriter.ml
+++ b/llvm/test/Bindings/Ocaml/bitwriter.ml
@@ -1,7 +1,5 @@
-(* RUN: rm -rf %t.builddir
- * RUN: mkdir -p %t.builddir
- * RUN: cp %s %t.builddir
- * RUN: %ocamlcomp -warn-error A-3 unix.%cma llvm.%cma llvm_bitwriter.%cma %t.builddir/bitwriter.ml -o %t
+(* RUN: cp %s %T/bitwriter.ml
+ * RUN: %ocamlcomp -warn-error A -package llvm.bitreader -package llvm.bitwriter -linkpkg %T/bitwriter.ml -o %t
* RUN: %t %t.bc
* RUN: llvm-dis < %t.bc
* XFAIL: vg_leak
diff --git a/llvm/test/Bindings/Ocaml/executionengine.ml b/llvm/test/Bindings/Ocaml/executionengine.ml
index fa325ebc1df..7d64f9f7f76 100644
--- a/llvm/test/Bindings/Ocaml/executionengine.ml
+++ b/llvm/test/Bindings/Ocaml/executionengine.ml
@@ -1,9 +1,8 @@
-(* RUN: rm -rf %t.builddir
- * RUN: mkdir -p %t.builddir
- * RUN: cp %s %t.builddir
- * RUN: %ocamlcomp -warn-error A llvm.%cma llvm_target.%cma llvm_executionengine.%cma %t.builddir/executionengine.ml -o %t
+(* RUN: cp %s %T/executionengine.ml
+ * RUN: %ocamlcomp -warn-error A -package llvm.executionengine -linkpkg %T/executionengine.ml -o %t
* RUN: %t
- * XFAIL: vg_leak hexagon
+ * REQUIRES: native, object-emission
+ * XFAIL: vg_leak
*)
open Llvm
diff --git a/llvm/test/Bindings/Ocaml/ext_exc.ml b/llvm/test/Bindings/Ocaml/ext_exc.ml
index 80924387110..c99bc04333f 100644
--- a/llvm/test/Bindings/Ocaml/ext_exc.ml
+++ b/llvm/test/Bindings/Ocaml/ext_exc.ml
@@ -1,11 +1,11 @@
-(* RUN: rm -rf %t.builddir
- * RUN: mkdir -p %t.builddir
- * RUN: cp %s %t.builddir
- * RUN: %ocamlcomp -warn-error A llvm.%cma llvm_bitreader.%cma llvm_executionengine.%cma %t.builddir/ext_exc.ml -o %t
- * RUN: %t </dev/null
+(* RUN: cp %s %T/ext_exc.ml
+ * RUN: %ocamlcomp -warn-error A -package llvm.bitreader -linkpkg %T/ext_exc.ml -o %t
+ * RUN: %t
* XFAIL: vg_leak
*)
+
let context = Llvm.global_context ()
+
(* 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 _ =
diff --git a/llvm/test/Bindings/Ocaml/ipo_opts.ml b/llvm/test/Bindings/Ocaml/ipo_opts.ml
index d79006e5610..26037f2fd93 100644
--- a/llvm/test/Bindings/Ocaml/ipo_opts.ml
+++ b/llvm/test/Bindings/Ocaml/ipo_opts.ml
@@ -1,7 +1,5 @@
-(* RUN: rm -rf %t.builddir
- * RUN: mkdir -p %t.builddir
- * RUN: cp %s %t.builddir
- * RUN: %ocamlcomp -warn-error A llvm.%cma llvm_ipo.%cma llvm_target.%cma %t.builddir/ipo_opts.ml -o %t
+(* RUN: cp %s %T/ipo_opts.ml
+ * RUN: %ocamlcomp -warn-error A -package llvm.ipo -linkpkg %T/ipo_opts.ml -o %t
* RUN: %t %t.bc
* XFAIL: vg_leak
*)
diff --git a/llvm/test/Bindings/Ocaml/irreader.ml b/llvm/test/Bindings/Ocaml/irreader.ml
index efe9df6d593..52956c9fee4 100644
--- a/llvm/test/Bindings/Ocaml/irreader.ml
+++ b/llvm/test/Bindings/Ocaml/irreader.ml
@@ -1,7 +1,5 @@
-(* RUN: rm -rf %t.builddir
- * RUN: mkdir -p %t.builddir
- * RUN: cp %s %t.builddir
- * RUN: %ocamlcomp -g -warn-error A llvm.%cma llvm_irreader.%cma %t.builddir/irreader.ml -o %t
+(* RUN: cp %s %T/irreader.ml
+ * RUN: %ocamlcomp -warn-error A -package llvm.irreader -linkpkg %T/irreader.ml -o %t
* RUN: %t
* XFAIL: vg_leak
*)
diff --git a/llvm/test/Bindings/Ocaml/linker.ml b/llvm/test/Bindings/Ocaml/linker.ml
index c187afa49af..f859fdc5cf6 100644
--- a/llvm/test/Bindings/Ocaml/linker.ml
+++ b/llvm/test/Bindings/Ocaml/linker.ml
@@ -1,7 +1,5 @@
-(* RUN: rm -rf %t.builddir
- * RUN: mkdir -p %t.builddir
- * RUN: cp %s %t.builddir
- * RUN: %ocamlcomp -warn-error A llvm.%cma llvm_linker.%cma %t.builddir/linker.ml -o %t
+(* RUN: cp %s %T/linker.ml
+ * RUN: %ocamlcomp -warn-error A -package llvm.linker -linkpkg %T/linker.ml -o %t
* RUN: %t
* XFAIL: vg_leak
*)
diff --git a/llvm/test/Bindings/Ocaml/lit.local.cfg b/llvm/test/Bindings/Ocaml/lit.local.cfg
index 364b97c632e..bca5d39d249 100644
--- a/llvm/test/Bindings/Ocaml/lit.local.cfg
+++ b/llvm/test/Bindings/Ocaml/lit.local.cfg
@@ -2,3 +2,6 @@ config.suffixes = ['.ml']
if not 'ocaml' in config.root.llvm_bindings:
config.unsupported = True
+
+if config.root.have_ocaml_ounit != '1':
+ config.unsupported = True
diff --git a/llvm/test/Bindings/Ocaml/passmgr_builder.ml b/llvm/test/Bindings/Ocaml/passmgr_builder.ml
index cd431fa5580..a7112231562 100644
--- a/llvm/test/Bindings/Ocaml/passmgr_builder.ml
+++ b/llvm/test/Bindings/Ocaml/passmgr_builder.ml
@@ -1,7 +1,5 @@
-(* RUN: rm -rf %t.builddir
- * RUN: mkdir -p %t.builddir
- * RUN: cp %s %t.builddir
- * RUN: %ocamlcomp -warn-error A llvm.%cma llvm_passmgr_builder.%cma %t.builddir/passmgr_builder.ml -o %t
+(* RUN: cp %s %T/passmgr_builder.ml
+ * RUN: %ocamlcomp -warn-error A -package llvm.passmgr_builder -linkpkg %T/passmgr_builder.ml -o %t
* RUN: %t %t.bc
* XFAIL: vg_leak
*)
diff --git a/llvm/test/Bindings/Ocaml/scalar_opts.ml b/llvm/test/Bindings/Ocaml/scalar_opts.ml
index 1ae4fe9d2a9..9ca53616dc4 100644
--- a/llvm/test/Bindings/Ocaml/scalar_opts.ml
+++ b/llvm/test/Bindings/Ocaml/scalar_opts.ml
@@ -1,7 +1,5 @@
-(* RUN: rm -rf %t.builddir
- * RUN: mkdir -p %t.builddir
- * RUN: cp %s %t.builddir
- * RUN: %ocamlcomp -warn-error A llvm.%cma llvm_scalar_opts.%cma llvm_target.%cma %t.builddir/scalar_opts.ml -o %t
+(* RUN: cp %s %T/scalar_opts.ml
+ * RUN: %ocamlcomp -warn-error A -package llvm.scalar_opts -linkpkg %T/scalar_opts.ml -o %t
* RUN: %t %t.bc
* XFAIL: vg_leak
*)
diff --git a/llvm/test/Bindings/Ocaml/target.ml b/llvm/test/Bindings/Ocaml/target.ml
index e431fa4a254..0a9738a35f4 100644
--- a/llvm/test/Bindings/Ocaml/target.ml
+++ b/llvm/test/Bindings/Ocaml/target.ml
@@ -1,7 +1,5 @@
-(* RUN: rm -rf %t.builddir
- * RUN: mkdir -p %t.builddir
- * RUN: cp %s %t.builddir
- * RUN: %ocamlcomp -g -warn-error A llvm.%cma llvm_target.%cma llvm_executionengine.%cma %t.builddir/target.ml -o %t
+(* RUN: cp %s %T/target.ml
+ * RUN: %ocamlcomp -warn-error A -package llvm.target -package llvm.executionengine -linkpkg %T/target.ml -o %t
* RUN: %t %t.bc
* REQUIRES: native, object-emission
* XFAIL: vg_leak
diff --git a/llvm/test/Bindings/Ocaml/vectorize_opts.ml b/llvm/test/Bindings/Ocaml/vectorize_opts.ml
index 08f15d37a1b..9c5e7d00575 100644
--- a/llvm/test/Bindings/Ocaml/vectorize_opts.ml
+++ b/llvm/test/Bindings/Ocaml/vectorize_opts.ml
@@ -1,7 +1,5 @@
-(* RUN: rm -rf %t.builddir
- * RUN: mkdir -p %t.builddir
- * RUN: cp %s %t.builddir
- * RUN: %ocamlcomp -warn-error A llvm.%cma llvm_vectorize.%cma llvm_target.%cma %t.builddir/vectorize_opts.ml -o %t
+(* RUN: cp %s %T/vectorize_opts.ml
+ * RUN: %ocamlcomp -warn-error A -package llvm.vectorize -linkpkg %T/vectorize_opts.ml -o %t
* RUN: %t %t.bc
* XFAIL: vg_leak
*)
diff --git a/llvm/test/Bindings/Ocaml/vmcore.ml b/llvm/test/Bindings/Ocaml/vmcore.ml
index ed75c87ac9c..f1d27b47a2a 100644
--- a/llvm/test/Bindings/Ocaml/vmcore.ml
+++ b/llvm/test/Bindings/Ocaml/vmcore.ml
@@ -1,7 +1,5 @@
-(* RUN: rm -rf %t.builddir
- * RUN: mkdir -p %t.builddir
- * RUN: cp %s %t.builddir
- * RUN: %ocamlcomp -warn-error A llvm.%cma llvm_analysis.%cma llvm_bitwriter.%cma %t.builddir/vmcore.ml -o %t
+(* RUN: cp %s %T/vmcore.ml
+ * RUN: %ocamlcomp -warn-error A -package llvm.analysis -package llvm.bitwriter -linkpkg %T/vmcore.ml -o %t
* RUN: %t %t.bc
* RUN: llvm-dis < %t.bc > %t.ll
* RUN: FileCheck %s < %t.ll
diff --git a/llvm/test/Makefile b/llvm/test/Makefile
index 40fcd616ab2..126f128a950 100644
--- a/llvm/test/Makefile
+++ b/llvm/test/Makefile
@@ -123,13 +123,15 @@ lit.site.cfg: FORCE
@$(ECHOPATH) s=@LLVM_SOURCE_DIR@=$(LLVM_SRC_ROOT)=g >> lit.tmp
@$(ECHOPATH) s=@LLVM_BINARY_DIR@=$(LLVM_OBJ_ROOT)=g >> lit.tmp
@$(ECHOPATH) s=@LLVM_TOOLS_DIR@=$(ToolDir)=g >> lit.tmp
+ @$(ECHOPATH) s=@LIBDIR@=$(LibDir)=g >> lit.tmp
@$(ECHOPATH) s=@SHLIBDIR@=$(SharedLibDir)=g >> lit.tmp
@$(ECHOPATH) s=@SHLIBEXT@=$(SHLIBEXT)=g >> lit.tmp
@$(ECHOPATH) s=@EXEEXT@=$(EXEEXT)=g >> lit.tmp
@$(ECHOPATH) s=@PYTHON_EXECUTABLE@=$(PYTHON)=g >> lit.tmp
- @$(ECHOPATH) s=@OCAMLC@=$(OCAMLC)=g >> lit.tmp
- @$(ECHOPATH) s=@OCAMLOPT@=$(OCAMLOPT)=g >> lit.tmp
- @$(ECHOPATH) s=@OCAMLFLAGS@=-cclib -L$(LibDir) -I $(LibDir)/ocaml $(addprefix -cclib ,$(LDFLAGS))=g >> lit.tmp
+ @$(ECHOPATH) s=@OCAMLFIND@=$(OCAMLFIND)=g >> lit.tmp
+ @$(ECHOPATH) s=@OCAMLFLAGS@=$(addprefix -cclib ,$(LDFLAGS))=g >> lit.tmp
+ @$(ECHOPATH) s=@HAVE_OCAMLOPT@=$(HAVE_OCAMLOPT)=g >> lit.tmp
+ @$(ECHOPATH) s=@HAVE_OCAML_OUNIT@=$(HAVE_OCAML_OUNIT)=g >> lit.tmp
@$(ECHOPATH) s=@GO_EXECUTABLE@=$(GO)=g >> lit.tmp
@$(ECHOPATH) s!@HOST_CC@!$(CC)!g >> lit.tmp
@$(ECHOPATH) s!@HOST_CXX@!$(CXX)!g >> lit.tmp
diff --git a/llvm/test/lit.cfg b/llvm/test/lit.cfg
index 63880d0dac7..4e9a5ad6efa 100644
--- a/llvm/test/lit.cfg
+++ b/llvm/test/lit.cfg
@@ -100,6 +100,14 @@ for options in ['ASAN_OPTIONS', 'UBSAN_OPTIONS']:
if options in os.environ:
config.environment[options] = os.environ[options]
+# Set up OCAMLPATH to include newly built OCaml libraries.
+llvm_ocaml_lib = os.path.join(getattr(config, 'llvm_lib_dir', None), 'ocaml')
+if 'OCAMLPATH' in os.environ:
+ ocamlpath = os.path.pathsep.join((llvm_ocaml_lib, os.environ['OCAMLPATH']))
+ config.environment['OCAMLPATH'] = ocamlpath
+else:
+ config.environment['OCAMLPATH'] = llvm_ocaml_lib
+
###
import os
@@ -175,14 +183,12 @@ config.substitutions.append( ('%python', config.python_executable) )
# OCaml substitutions.
# Support tests for both native and bytecode builds.
-if config.ocamlopt_executable != "":
+if config.have_ocamlopt == '1':
config.substitutions.append( ('%ocamlcomp',
- "%s %s" % (config.ocamlopt_executable, config.ocaml_flags)) )
- config.substitutions.append( ('%cma', 'cmxa') )
+ "%s ocamlopt %s" % (config.ocamlfind_executable, config.ocaml_flags)) )
else:
config.substitutions.append( ('%ocamlcomp',
- "%s %s" % (config.ocamlc_executable, config.ocaml_flags)) )
- config.substitutions.append( ('%cma', 'cma') )
+ "%s ocamlc %s" % (config.ocamlfind_executable, config.ocaml_flags)) )
# For each occurrence of an llvm tool name as its own word, replace it
# with the full path to the build directory holding that tool. This
diff --git a/llvm/test/lit.site.cfg.in b/llvm/test/lit.site.cfg.in
index 2a058e9fa3b..7d2c8330531 100644
--- a/llvm/test/lit.site.cfg.in
+++ b/llvm/test/lit.site.cfg.in
@@ -7,13 +7,15 @@ config.target_triple = "@TARGET_TRIPLE@"
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
+config.llvm_lib_dir = "@LIBDIR@"
config.llvm_shlib_dir = "@SHLIBDIR@"
config.llvm_shlib_ext = "@SHLIBEXT@"
config.llvm_exe_ext = "@EXEEXT@"
config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
config.python_executable = "@PYTHON_EXECUTABLE@"
-config.ocamlc_executable = "@OCAMLC@"
-config.ocamlopt_executable = "@OCAMLOPT@"
+config.ocamlfind_executable = "@OCAMLFIND@"
+config.have_ocamlopt = "@HAVE_OCAMLOPT@"
+config.have_ocaml_ounit = "@HAVE_OCAML_OUNIT@"
config.ocaml_flags = "@OCAMLFLAGS@"
config.go_executable = "@GO_EXECUTABLE@"
config.enable_shared = @ENABLE_SHARED@
OpenPOWER on IntegriCloud