# (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",
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 = []