Index: tests_lit/lit.cfg |
diff --git a/tests_lit/lit.cfg b/tests_lit/lit.cfg |
index b8bde4e6891d5d17cd261d2b2387f2b0db38445e..3817ebbbc7456f2e75e7be4fc5c210300f40ace7 100644 |
--- a/tests_lit/lit.cfg |
+++ b/tests_lit/lit.cfg |
@@ -62,10 +62,13 @@ config.substitutions.append(('%{python}', sys.executable)) |
pydir = os.path.join(bin_root, 'pydir') |
-# Finding LLVM binary tools. All tools used in the tests must be listed in |
-# the llvmbintools list. |
+# Finding LLVM binary tools. Tools used in the tests must be listed in |
+# the llvmbintools list or binutilsbintools. |
llvmbinpath = os.path.abspath(os.environ.get('LLVM_BIN_PATH')) |
+# Find binutils tools. This is used for objdump. |
+binutilsbinpath = os.path.abspath(os.environ.get('BINUTILS_BIN_PATH')) |
+ |
# Define the location of the llvm2ice tool. |
llvm2icetool = os.path.join(bin_root, 'llvm2ice') |
llvm2iceatts = shellcmd(' '.join([llvm2icetool, '--build-atts']), |
@@ -88,7 +91,8 @@ iflc2i_atts_cmd = if_atts + [if_cond_flag('allow_llvm_ir_as_input' |
# Base command for running llvm2ice |
llvm2ice_cmd = [os.path.join(pydir, 'run-llvm2ice.py'), |
'--llvm2ice', llvm2icetool, |
- '--llvm-bin-path', llvmbinpath] |
+ '--llvm-bin-path', llvmbinpath, |
+ '--binutils-bin-path', binutilsbinpath] |
# Run commands only if corresponding build attributes apply, including |
# for each compiler setup. |
@@ -109,7 +113,6 @@ config.substitutions.append(('%llvm2ice', llvm2icetool)) |
llvmbintools = [r"\bFileCheck\b", |
r"\bllvm-as\b", |
r"\bllvm-mc\b", |
- r"\bllvm-objdump\b", |
r"\bllvm-readobj\b", |
r"\bnot\b", |
r"\bpnacl-freeze\b", |
@@ -126,6 +129,16 @@ for tool in llvmbintools: |
tool) |
config.substitutions.append((tool, substitution)) |
+binutilsbintools = [r"\bobjdump\b",] |
+ |
+for tool in binutilsbintools: |
+ # The re.sub() line is adapted from one of LLVM's lit.cfg files. |
+ # Similar to the llvmbintools. |
+ substitution = re.sub(r"^(\\)?((\| )?)\W+b([0-9A-Za-z-_]+)\\b\W*$", |
+ r"\2" + binutilsbinpath + "/" + 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], |
sys.version_info[1])) |
@@ -136,4 +149,5 @@ def dbg(s): |
dbg('bin_root = %s' % bin_root) |
dbg('llvmbinpath = %s' % llvmbinpath) |
+dbg('binutilsbinpath = %s' % binutilsbinpath) |
dbg("Build attributes = %s" % llvm2iceatts) |