diff options
-rw-r--r-- | llvm/test/lit.cfg | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/test/lit.cfg b/llvm/test/lit.cfg index 9a4cfa4d388..9a2f74c21c9 100644 --- a/llvm/test/lit.cfg +++ b/llvm/test/lit.cfg @@ -175,6 +175,10 @@ for sub in ['llvmgcc', 'llvmgxx', 'emitir', 'compile_cxx', 'compile_c', # (llvm_tools_dir in lit parlance). # Don't match 'bugpoint-' or 'clang-'. # Don't match '/clang'. +if os.pathsep == ';': + pathext = os.environ.get('PATHEXT', '').split(';') +else: + pathext = [''] for pattern in [r"\bbugpoint\b(?!-)", r"(?<!/)\bclang\b(?!-)", r"\bgold\b", r"\bllc\b", r"\blli\b", @@ -204,6 +208,11 @@ for pattern in [r"\bbugpoint\b(?!-)", r"(?<!/)\bclang\b(?!-)", substitution = re.sub(r"^(\\)?((\| )?)\W+b([0-9A-Za-z-_]+)\\b\W*$", r"\2" + llvm_tools_dir + "/" + r"\4", pattern) + for ext in pathext: + substitution_ext = substitution + ext + if os.path.exists(substitution_ext): + substitution = substitution_ext + break config.substitutions.append((pattern, substitution)) excludes = [] |