Commit cc27a53a by Jim Stichnoth

Subzero: Add 'not' to the list of LLVM commands in lit.cfg.

Without this being in the command substitutions list, lit will rely on the 'not' command being in $PATH. The substitution code is adapted from llvm/test/lit.cfg to add word-break regexps to the list. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/344063004
parent 5cd240df
......@@ -4,6 +4,7 @@
# -*- Python -*-
import os
import re
import sys
import lit.formats
......@@ -41,10 +42,18 @@ config.substitutions.append(
config.substitutions.append(('%llvm2ice', llvm2icetool))
config.substitutions.append(('%szdiff', os.path.join(bin_root, 'szdiff.py')))
llvmbintools = ['FileCheck']
llvmbintools = [r"\bFileCheck\b", r"\bnot\b"]
for tool in llvmbintools:
config.substitutions.append((tool, os.path.join(llvmbinpath, tool)))
# The re.sub() line is adapted from one of LLVM's lit.cfg files.
# Extract the tool name from the pattern. This relies on the tool
# name being surrounded by \b word match operators. If the
# pattern starts with "| ", include it in the string to be
# substituted.
substitution = re.sub(r"^(\\)?((\| )?)\W+b([0-9A-Za-z-_]+)\\b\W*$",
r"\2" + llvmbinpath + "/" + r"\4",
tool)
config.substitutions.append((tool, substitution))
# Add a feature to detect the Python version.
config.available_features.add("python%d.%d" % (sys.version_info[0],
......@@ -56,5 +65,3 @@ def dbg(s):
dbg('bin_root = %s' % bin_root)
dbg('llvmbinpath = %s' % llvmbinpath)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment