aboutsummaryrefslogtreecommitdiff
path: root/clang/test/lit.cfg.py
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/lit.cfg.py')
-rw-r--r--clang/test/lit.cfg.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/clang/test/lit.cfg.py b/clang/test/lit.cfg.py
index 4a5d9e5..64e2bba 100644
--- a/clang/test/lit.cfg.py
+++ b/clang/test/lit.cfg.py
@@ -140,7 +140,8 @@ def have_host_out_of_process_jit_feature_support():
return False
-def have_host_jit_feature_support(feature_name):
+
+def run_clang_repl(args):
clang_repl_exe = lit.util.which("clang-repl", config.clang_tools_dir)
if not clang_repl_exe:
@@ -148,7 +149,7 @@ def have_host_jit_feature_support(feature_name):
try:
clang_repl_cmd = subprocess.Popen(
- [clang_repl_exe, "--host-supports-" + feature_name], stdout=subprocess.PIPE
+ [clang_repl_exe, args], stdout=subprocess.PIPE
)
except OSError:
print("could not exec clang-repl")
@@ -157,7 +158,11 @@ def have_host_jit_feature_support(feature_name):
clang_repl_out = clang_repl_cmd.stdout.read().decode("ascii")
clang_repl_cmd.wait()
- return "true" in clang_repl_out
+ return clang_repl_out
+
+
+def have_host_jit_feature_support(feature_name):
+ return "true" in run_clang_repl("--host-supports-" + feature_name)
def have_host_clang_repl_cuda():
clang_repl_exe = lit.util.which('clang-repl', config.clang_tools_dir)
@@ -191,6 +196,8 @@ if have_host_jit_feature_support('jit'):
if have_host_clang_repl_cuda():
config.available_features.add('host-supports-cuda')
+ hosttriple = run_clang_repl("--host-jit-triple")
+ config.substitutions.append(("%host-jit-triple", hosttriple.strip()))
if have_host_out_of_process_jit_feature_support():
config.available_features.add("host-supports-out-of-process-jit")