1
0
mirror of https://github.com/c64scene-ar/llvm-6502.git synced 2025-03-20 11:32:33 +00:00

[OCaml] Run tests twice, with ocamlc and ocamlopt (if available)

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221137 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Peter Zotov 2014-11-03 09:50:53 +00:00
parent 7158970d0d
commit 95a8dca3db
14 changed files with 60 additions and 25 deletions

@ -1,5 +1,7 @@
(* 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
*)

@ -1,5 +1,7 @@
(* 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

@ -1,5 +1,7 @@
(* 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

@ -1,5 +1,7 @@
(* 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

@ -1,5 +1,7 @@
(* 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

@ -1,5 +1,7 @@
(* 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
*)

@ -1,5 +1,7 @@
(* 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
*)

@ -1,5 +1,7 @@
(* 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
*)

@ -1,5 +1,7 @@
(* 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
*)

@ -1,5 +1,7 @@
(* 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
*)

@ -1,5 +1,7 @@
(* 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
*)

@ -1,5 +1,6 @@
(* 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
*)

@ -1,5 +1,7 @@
(* 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
*)

@ -102,13 +102,22 @@ for options in ['ASAN_OPTIONS', 'UBSAN_OPTIONS']:
# 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'
@ -188,12 +197,13 @@ config.substitutions.append( ('%python', config.python_executable) )
# 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