Index: test/lit.cfg =================================================================== --- test/lit.cfg +++ test/lit.cfg @@ -66,18 +66,24 @@ # Tweak the PATH to include the tools dir and the scripts dir. if lld_obj_root is not None: + lld_tools_dir = getattr(config, 'lld_tools_dir', None) + if not lld_tools_dir: + lit_config.fatal('No LLD tools dir set!') llvm_tools_dir = getattr(config, 'llvm_tools_dir', None) if not llvm_tools_dir: lit_config.fatal('No LLVM tools dir set!') - path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH'])) + path = os.path.pathsep.join((lld_tools_dir, llvm_tools_dir, config.environment['PATH'])) path = os.path.pathsep.join((os.path.join(getattr(config, 'llvm_src_root', None),'test','Scripts'),path)) config.environment['PATH'] = path + lld_libs_dir = getattr(config, 'lld_libs_dir', None) + if not lld_libs_dir: + lit_config.fatal('No LLD libs dir set!') llvm_libs_dir = getattr(config, 'llvm_libs_dir', None) if not llvm_libs_dir: lit_config.fatal('No LLVM libs dir set!') - path = os.path.pathsep.join((llvm_libs_dir, + path = os.path.pathsep.join((lld_libs_dir, llvm_libs_dir, config.environment.get('LD_LIBRARY_PATH',''))) config.environment['LD_LIBRARY_PATH'] = path @@ -174,10 +180,10 @@ pattern) tool_pipe = tool_match.group(2) tool_name = tool_match.group(4) - tool_path = lit.util.which(tool_name, llvm_tools_dir) + tool_path = lit.util.which(tool_name, config.environment['PATH']) if not tool_path: # Warn, but still provide a substitution. - lit_config.note('Did not find ' + tool_name + ' in ' + llvm_tools_dir) + lit_config.note('Did not find ' + tool_name + ' in ' + path) tool_path = llvm_tools_dir + '/' + tool_name config.substitutions.append((pattern, tool_pipe + tool_path)) Index: test/lit.site.cfg.in =================================================================== --- test/lit.site.cfg.in +++ test/lit.site.cfg.in @@ -6,6 +6,8 @@ config.llvm_libs_dir = "@LLVM_LIBS_DIR@" config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.lld_obj_root = "@LLD_BINARY_DIR@" +config.lld_libs_dir = "@LLVM_LIBRARY_OUTPUT_INTDIR@" +config.lld_tools_dir = "@LLVM_RUNTIME_OUTPUT_INTDIR@" config.target_triple = "@TARGET_TRIPLE@" config.python_executable = "@PYTHON_EXECUTABLE@" config.have_zlib = "@HAVE_LIBZ@"