diff options
-rw-r--r-- | llvm/test/lit.cfg | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/test/lit.cfg b/llvm/test/lit.cfg index 6dc021c9af9..c1a4499db29 100644 --- a/llvm/test/lit.cfg +++ b/llvm/test/lit.cfg @@ -482,3 +482,17 @@ gmalloc_path_str = lit_config.params.get('gmalloc_path', if use_gmalloc: config.environment.update({'DYLD_INSERT_LIBRARIES' : gmalloc_path_str}) + +# Ask llvm-config about global-isel. +try: + llvm_config_cmd = subprocess.Popen( + [os.path.join(llvm_tools_dir, 'llvm-config'), '--has-global-isel'], + stdout = subprocess.PIPE, + env=config.environment) +except OSError: + print("Could not find llvm-config in " + llvm_tools_dir) + exit(42) + +if re.search(r'ON', llvm_config_cmd.stdout.read().decode('ascii')): + config.available_features.add('global-isel') +llvm_config_cmd.wait() |