summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/lit.common.cfg
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/test/lit.common.cfg')
-rw-r--r--compiler-rt/test/lit.common.cfg11
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler-rt/test/lit.common.cfg b/compiler-rt/test/lit.common.cfg
index 6c07ca66195..4f23ab28550 100644
--- a/compiler-rt/test/lit.common.cfg
+++ b/compiler-rt/test/lit.common.cfg
@@ -73,9 +73,10 @@ for name in possibly_dangerous_env_vars:
del config.environment[name]
# Tweak PATH to include llvm tools dir.
-if (not config.llvm_tools_dir) or (not os.path.exists(config.llvm_tools_dir)):
- lit_config.fatal("Invalid llvm_tools_dir config attribute: %r" % config.llvm_tools_dir)
-path = os.path.pathsep.join((config.llvm_tools_dir, config.environment['PATH']))
+llvm_tools_dir = getattr(config, 'llvm_tools_dir', None)
+if (not llvm_tools_dir) or (not os.path.exists(llvm_tools_dir)):
+ lit_config.fatal("Invalid llvm_tools_dir config attribute: %r" % llvm_tools_dir)
+path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH']))
config.environment['PATH'] = path
# Help MSVS link.exe find the standard libraries.
@@ -192,7 +193,7 @@ if config.host_os == 'Darwin':
else:
config.substitutions.append( ("%macos_min_target_10_11", "") )
-sancovcc_path = os.path.join(config.llvm_tools_dir, "sancov")
+sancovcc_path = os.path.join(llvm_tools_dir, "sancov")
if os.path.exists(sancovcc_path):
config.available_features.add("has_sancovcc")
config.substitutions.append( ("%sancovcc ", sancovcc_path) )
@@ -253,7 +254,7 @@ try:
stdout = subprocess.PIPE,
env=config.environment)
except OSError:
- print("Could not find llvm-config in " + config.llvm_tools_dir)
+ print("Could not find llvm-config in " + llvm_tools_dir)
exit(42)
if re.search(r'ON', llvm_config_cmd.stdout.read().decode('ascii')):
OpenPOWER on IntegriCloud