| 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 21 matching lines...) Expand all Loading... |
| 32 config.substitutions.append(('%{python}', sys.executable)) | 32 config.substitutions.append(('%{python}', sys.executable)) |
| 33 | 33 |
| 34 pydir = os.path.join(bin_root, 'pydir') | 34 pydir = os.path.join(bin_root, 'pydir') |
| 35 | 35 |
| 36 # Finding LLVM binary tools. All tools used in the tests must be listed in | 36 # Finding LLVM binary tools. All tools used in the tests must be listed in |
| 37 # the llvmbintools list. | 37 # the llvmbintools list. |
| 38 llvmbinpath = os.path.abspath(os.environ.get('LLVM_BIN_PATH')) | 38 llvmbinpath = os.path.abspath(os.environ.get('LLVM_BIN_PATH')) |
| 39 | 39 |
| 40 # Finding Subzero tools | 40 # Finding Subzero tools |
| 41 llvm2icetool = os.path.join(bin_root, 'llvm2ice') | 41 llvm2icetool = os.path.join(bin_root, 'llvm2ice') |
| 42 minllvm2icetool = os.path.join(bin_root, 'minllvm2ice') |
| 42 | 43 |
| 43 # Convert LLVM source to PNaCl bitcode, read using the | 44 # Convert LLVM source to PNaCl bitcode, read using the |
| 44 # Subzero bitcode reader, and then translate. | 45 # Subzero bitcode reader, and then translate. |
| 45 config.substitutions.append( | 46 config.substitutions.append( |
| 46 ('%p2i', ' '.join([os.path.join(pydir, 'run-llvm2ice.py'), | 47 ('%p2i', ' '.join([os.path.join(pydir, 'run-llvm2ice.py'), |
| 47 '--llvm2ice', llvm2icetool, | 48 '--llvm2ice', llvm2icetool, |
| 48 '--llvm-bin-path', llvmbinpath | 49 '--llvm-bin-path', llvmbinpath |
| 49 ]))) | 50 ]))) |
| 50 | 51 |
| 52 # Using min Subzero, convert LLVM source to PNaCl bitcode, read using |
| 53 # the Subzero bitcode reader, and then translate. |
| 54 config.substitutions.append( |
| 55 ('%minp2i', ' '.join([os.path.join(pydir, 'run-llvm2ice.py'), |
| 56 '--llvm2ice', minllvm2icetool, |
| 57 '--llvm-bin-path', llvmbinpath |
| 58 ]))) |
| 59 |
| 51 # Convert LLVM source to PNaCl bitcode, read using the PNaCl bitcode reader, | 60 # Convert LLVM source to PNaCl bitcode, read using the PNaCl bitcode reader, |
| 52 # convert to ICE using the ICE Converter, and then translate. | 61 # convert to ICE using the ICE Converter, and then translate. |
| 53 # TODO(kschimpf) Deprecated, remove once p2i working. | 62 # TODO(kschimpf) Deprecated, remove once p2i working. |
| 54 config.substitutions.append( | 63 config.substitutions.append( |
| 55 ('%l2i', ' '.join([os.path.join(pydir, 'run-llvm2ice.py'), | 64 ('%l2i', ' '.join([os.path.join(pydir, 'run-llvm2ice.py'), |
| 56 '--llvm', '--llvm2ice', llvm2icetool, | 65 '--llvm', '--llvm2ice', llvm2icetool, |
| 57 '--llvm-bin-path', llvmbinpath | 66 '--llvm-bin-path', llvmbinpath |
| 58 ]))) | 67 ]))) |
| 59 | 68 |
| 60 # Read LLVM source, convert to ICE using the ICE converter, and then translate. | 69 # Read LLVM source, convert to ICE using the ICE converter, and then translate. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 87 # Add a feature to detect the Python version. | 96 # Add a feature to detect the Python version. |
| 88 config.available_features.add("python%d.%d" % (sys.version_info[0], | 97 config.available_features.add("python%d.%d" % (sys.version_info[0], |
| 89 sys.version_info[1])) | 98 sys.version_info[1])) |
| 90 | 99 |
| 91 # Debugging output | 100 # Debugging output |
| 92 def dbg(s): | 101 def dbg(s): |
| 93 print '[DBG] %s' % s | 102 print '[DBG] %s' % s |
| 94 | 103 |
| 95 dbg('bin_root = %s' % bin_root) | 104 dbg('bin_root = %s' % bin_root) |
| 96 dbg('llvmbinpath = %s' % llvmbinpath) | 105 dbg('llvmbinpath = %s' % llvmbinpath) |
| OLD | NEW |