ocamlc and ocamlopt expose a distinct set of buildsystem bugs, e.g.
only ocamlc would detect -custom or -dllib-related bugs, and as all
buildbots will have ocamlopt, these bugs will stay hidden.
This change should add no more than 30 seconds of testing time.
llvm-svn: 221137
(* RUN: cp %s %T/analysis.ml
- * RUN: %ocamlcomp -g -warn-error A -package llvm.analysis -linkpkg %T/analysis.ml -o %t
+ * RUN: %ocamlc -g -warn-error A -package llvm.analysis -linkpkg %T/analysis.ml -o %t
+ * RUN: %t
+ * RUN: %ocamlopt -g -warn-error A -package llvm.analysis -linkpkg %T/analysis.ml -o %t
* RUN: %t
* XFAIL: vg_leak
*)
(* RUN: cp %s %T/bitreader.ml
- * RUN: %ocamlcomp -g -warn-error A -package llvm.bitreader -package llvm.bitwriter -linkpkg %T/bitreader.ml -o %t
+ * RUN: %ocamlc -g -warn-error A -package llvm.bitreader -package llvm.bitwriter -linkpkg %T/bitreader.ml -o %t
+ * RUN: %t %t.bc
+ * RUN: %ocamlopt -g -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
(* RUN: cp %s %T/bitwriter.ml
- * RUN: %ocamlcomp -g -warn-error A -package llvm.bitreader -package llvm.bitwriter -linkpkg %T/bitwriter.ml -o %t
+ * RUN: %ocamlc -g -w -3 -warn-error A -package llvm.bitreader -package llvm.bitwriter -linkpkg %T/bitwriter.ml -o %t
+ * RUN: %t %t.bc
+ * RUN: %ocamlopt -g -w -3 -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
-(* RUN: cp %s %T/vmcore.ml
- * RUN: %ocamlcomp -g -warn-error A -package llvm.analysis -package llvm.bitwriter -linkpkg %T/vmcore.ml -o %t
+(* RUN: cp %s %T/core.ml
+ * RUN: %ocamlc -g -warn-error A -package llvm.analysis -package llvm.bitwriter -linkpkg %T/core.ml -o %t
+ * RUN: %t %t.bc
+ * RUN: %ocamlopt -g -warn-error A -package llvm.analysis -package llvm.bitwriter -linkpkg %T/core.ml -o %t
* RUN: %t %t.bc
* RUN: llvm-dis < %t.bc > %t.ll
* RUN: FileCheck %s < %t.ll
(* RUN: cp %s %T/executionengine.ml
- * RUN: %ocamlcomp -g -warn-error A -package llvm.executionengine -linkpkg %T/executionengine.ml -o %t
+ * RUN: %ocamlc -g -warn-error A -package llvm.executionengine -linkpkg %T/executionengine.ml -o %t
+ * RUN: %t
+ * RUN: %ocamlopt -g -warn-error A -package llvm.executionengine -linkpkg %T/executionengine.ml -o %t
* RUN: %t
* REQUIRES: native, object-emission
* XFAIL: vg_leak
(* RUN: cp %s %T/ext_exc.ml
- * RUN: %ocamlcomp -g -warn-error A -package llvm.bitreader -linkpkg %T/ext_exc.ml -o %t
+ * RUN: %ocamlc -g -warn-error A -package llvm.bitreader -linkpkg %T/ext_exc.ml -o %t
+ * RUN: %t
+ * RUN: %ocamlopt -g -warn-error A -package llvm.bitreader -linkpkg %T/ext_exc.ml -o %t
* RUN: %t
* XFAIL: vg_leak
*)
(* RUN: cp %s %T/ipo_opts.ml
- * RUN: %ocamlcomp -g -warn-error A -package llvm.ipo -linkpkg %T/ipo_opts.ml -o %t
+ * RUN: %ocamlc -g -warn-error A -package llvm.ipo -linkpkg %T/ipo_opts.ml -o %t
+ * RUN: %t %t.bc
+ * RUN: %ocamlopt -g -warn-error A -package llvm.ipo -linkpkg %T/ipo_opts.ml -o %t
* RUN: %t %t.bc
* XFAIL: vg_leak
*)
(* RUN: cp %s %T/irreader.ml
- * RUN: %ocamlcomp -g -warn-error A -package llvm.irreader -linkpkg %T/irreader.ml -o %t
+ * RUN: %ocamlc -g -warn-error A -package llvm.irreader -linkpkg %T/irreader.ml -o %t
+ * RUN: %t
+ * RUN: %ocamlopt -g -warn-error A -package llvm.irreader -linkpkg %T/irreader.ml -o %t
* RUN: %t
* XFAIL: vg_leak
*)
(* RUN: cp %s %T/linker.ml
- * RUN: %ocamlcomp -g -warn-error A -package llvm.linker -linkpkg %T/linker.ml -o %t
+ * RUN: %ocamlc -g -warn-error A -package llvm.linker -linkpkg %T/linker.ml -o %t
+ * RUN: %t
+ * RUN: %ocamlopt -g -warn-error A -package llvm.linker -linkpkg %T/linker.ml -o %t
* RUN: %t
* XFAIL: vg_leak
*)
(* RUN: cp %s %T/passmgr_builder.ml
- * RUN: %ocamlcomp -g -warn-error A -package llvm.passmgr_builder -linkpkg %T/passmgr_builder.ml -o %t
+ * RUN: %ocamlc -g -warn-error A -package llvm.passmgr_builder -linkpkg %T/passmgr_builder.ml -o %t
+ * RUN: %t %t.bc
+ * RUN: %ocamlopt -g -warn-error A -package llvm.passmgr_builder -linkpkg %T/passmgr_builder.ml -o %t
* RUN: %t %t.bc
* XFAIL: vg_leak
*)
(* RUN: cp %s %T/scalar_opts.ml
- * RUN: %ocamlcomp -g -warn-error A -package llvm.scalar_opts -linkpkg %T/scalar_opts.ml -o %t
+ * RUN: %ocamlc -g -warn-error A -package llvm.scalar_opts -linkpkg %T/scalar_opts.ml -o %t
+ * RUN: %t %t.bc
+ * RUN: %ocamlopt -g -warn-error A -package llvm.scalar_opts -linkpkg %T/scalar_opts.ml -o %t
* RUN: %t %t.bc
* XFAIL: vg_leak
*)
(* RUN: cp %s %T/target.ml
- * RUN: %ocamlcomp -g -warn-error A -package llvm.target -package llvm.all_backends -linkpkg %T/target.ml -o %t
+ * RUN: %ocamlc -g -warn-error A -package llvm.target -package llvm.all_backends -linkpkg %T/target.ml -o %t
+ * RUN: %ocamlopt -g -warn-error A -package llvm.target -package llvm.all_backends -linkpkg %T/target.ml -o %t
* RUN: %t %t.bc
* XFAIL: vg_leak
*)
(* RUN: cp %s %T/vectorize_opts.ml
- * RUN: %ocamlcomp -g -warn-error A -package llvm.vectorize -linkpkg %T/vectorize_opts.ml -o %t
+ * RUN: %ocamlc -g -warn-error A -package llvm.vectorize -linkpkg %T/vectorize_opts.ml -o %t
+ * RUN: %t %t.bc
+ * RUN: %ocamlopt -g -warn-error A -package llvm.vectorize -linkpkg %T/vectorize_opts.ml -o %t
* RUN: %t %t.bc
* XFAIL: vg_leak
*)
# Set up OCAMLPATH to include newly built OCaml libraries.
llvm_lib_dir = getattr(config, 'llvm_lib_dir', None)
-if llvm_lib_dir: # empty llvm_lib_dir is falsey, reads as None
- llvm_ocaml_lib = os.path.join(llvm_lib_dir, '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
+if not llvm_lib_dir:
+ llvm_lib_dir = os.path.join(getattr(config, 'llvm_obj_root', None), 'lib')
+
+llvm_ocaml_lib = os.path.join(llvm_lib_dir, '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
+
+if 'CAML_LD_LIBRARY_PATH' in os.environ:
+ caml_ld_library_path = os.path.pathsep.join((llvm_ocaml_lib,
+ os.environ['CAML_LD_LIBRARY_PATH']))
+ config.environment['CAML_LD_LIBRARY_PATH'] = caml_ld_library_path
+else:
+ config.environment['CAML_LD_LIBRARY_PATH'] = caml_ld_library_path
# Set up OCAMLRUNPARAM to enable backtraces in OCaml tests.
config.environment['OCAMLRUNPARAM'] = 'b'
# OCaml substitutions.
# Support tests for both native and bytecode builds.
-if config.have_ocamlopt == '1':
- config.substitutions.append( ('%ocamlcomp',
+config.substitutions.append( ('%ocamlc',
+ "%s ocamlc %s" % (config.ocamlfind_executable, config.ocaml_flags)) )
+if config.have_ocamlopt in ('1', 'TRUE'):
+ config.substitutions.append( ('%ocamlopt',
"%s ocamlopt %s" % (config.ocamlfind_executable, config.ocaml_flags)) )
else:
- config.substitutions.append( ('%ocamlcomp',
- "%s ocamlc %s" % (config.ocamlfind_executable, config.ocaml_flags)) )
+ config.substitutions.append( ('%ocamlopt', "true" ) )
# 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