if options in os.environ:
config.environment[options] = os.environ[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
+
+# Set up OCAMLRUNPARAM to enable backtraces in OCaml tests.
+config.environment['OCAMLRUNPARAM'] = 'b'
+
###
import os
config.substitutions.append( ('%llc_dwarf', llc_dwarf) )
# Add site-specific substitutions.
-config.substitutions.append( ('%ocamlopt', config.ocamlopt_executable) )
+config.substitutions.append( ('%go', config.go_executable) )
config.substitutions.append( ('%llvmshlibdir', config.llvm_shlib_dir) )
config.substitutions.append( ('%shlibext', config.llvm_shlib_ext) )
config.substitutions.append( ('%exeext', config.llvm_exe_ext) )
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',
+ "%s ocamlopt %s" % (config.ocamlfind_executable, config.ocaml_flags)) )
+else:
+ config.substitutions.append( ('%ocamlcomp',
+ "%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
# ensures that we are testing the tools just built and not some random
r"\bllvm-dis\b",
r"\bllvm-dwarfdump\b",
r"\bllvm-extract\b",
+ r"\bllvm-go\b",
r"\bllvm-link\b",
r"\bllvm-lto\b",
r"\bllvm-mc\b",
config.available_features.add("not_ubsan")
# Direct object generation
-if not 'hexagon' in config.target_triple:
+# Suppress x86_64-mingw32 while investigating since r219108.
+if not 'hexagon' in config.target_triple and not re.match(r'^x86_64.*-(mingw32|win32)', config.target_triple):
config.available_features.add("object-emission")
if config.have_zlib == "1":
try:
llvm_config_cmd = subprocess.Popen(
[os.path.join(llvm_tools_dir, 'llvm-config'), '--assertion-mode'],
- stdout = subprocess.PIPE)
+ stdout = subprocess.PIPE,
+ env=config.environment)
except OSError:
print("Could not find llvm-config in " + llvm_tools_dir)
exit(42)