OLD | NEW |
1 # Taken from utils/lit/tests in the LLVM tree and hacked together to support | 1 # Taken from utils/lit/tests in the LLVM tree and hacked together to support |
2 # our tests. | 2 # our tests. |
3 | 3 |
4 # -*- Python -*- | 4 # -*- Python -*- |
5 | 5 |
6 import os | 6 import os |
7 import re | 7 import re |
8 import sys | 8 import sys |
9 | 9 |
10 import lit.formats | 10 import lit.formats |
(...skipping 24 matching lines...) Expand all Loading... |
35 # Finding Subzero tools | 35 # Finding Subzero tools |
36 llvm2icetool = os.path.join(bin_root, 'llvm2ice') | 36 llvm2icetool = os.path.join(bin_root, 'llvm2ice') |
37 config.substitutions.append( | 37 config.substitutions.append( |
38 ('%llvm2iceinsts', ' '.join([os.path.join(bin_root, 'llvm2iceinsts.py'), | 38 ('%llvm2iceinsts', ' '.join([os.path.join(bin_root, 'llvm2iceinsts.py'), |
39 '--llvm2ice', llvm2icetool, | 39 '--llvm2ice', llvm2icetool, |
40 '--llvm-bin-path', llvmbinpath | 40 '--llvm-bin-path', llvmbinpath |
41 ]))) | 41 ]))) |
42 config.substitutions.append(('%llvm2ice', llvm2icetool)) | 42 config.substitutions.append(('%llvm2ice', llvm2icetool)) |
43 config.substitutions.append(('%szdiff', os.path.join(bin_root, 'szdiff.py'))) | 43 config.substitutions.append(('%szdiff', os.path.join(bin_root, 'szdiff.py'))) |
44 | 44 |
45 llvmbintools = [r"\bFileCheck\b", r"\bnot\b"] | 45 llvmbintools = [r"\bFileCheck\b", r"\bllvm-mc\b", r"\bnot\b"] |
46 | 46 |
47 for tool in llvmbintools: | 47 for tool in llvmbintools: |
48 # The re.sub() line is adapted from one of LLVM's lit.cfg files. | 48 # The re.sub() line is adapted from one of LLVM's lit.cfg files. |
49 # Extract the tool name from the pattern. This relies on the tool | 49 # Extract the tool name from the pattern. This relies on the tool |
50 # name being surrounded by \b word match operators. If the | 50 # name being surrounded by \b word match operators. If the |
51 # pattern starts with "| ", include it in the string to be | 51 # pattern starts with "| ", include it in the string to be |
52 # substituted. | 52 # substituted. |
53 substitution = re.sub(r"^(\\)?((\| )?)\W+b([0-9A-Za-z-_]+)\\b\W*$", | 53 substitution = re.sub(r"^(\\)?((\| )?)\W+b([0-9A-Za-z-_]+)\\b\W*$", |
54 r"\2" + llvmbinpath + "/" + r"\4", | 54 r"\2" + llvmbinpath + "/" + r"\4", |
55 tool) | 55 tool) |
56 config.substitutions.append((tool, substitution)) | 56 config.substitutions.append((tool, substitution)) |
57 | 57 |
58 # Add a feature to detect the Python version. | 58 # Add a feature to detect the Python version. |
59 config.available_features.add("python%d.%d" % (sys.version_info[0], | 59 config.available_features.add("python%d.%d" % (sys.version_info[0], |
60 sys.version_info[1])) | 60 sys.version_info[1])) |
61 | 61 |
62 # Debugging output | 62 # Debugging output |
63 def dbg(s): | 63 def dbg(s): |
64 print '[DBG] %s' % s | 64 print '[DBG] %s' % s |
65 | 65 |
66 dbg('bin_root = %s' % bin_root) | 66 dbg('bin_root = %s' % bin_root) |
67 dbg('llvmbinpath = %s' % llvmbinpath) | 67 dbg('llvmbinpath = %s' % llvmbinpath) |
OLD | NEW |