Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(504)

Side by Side Diff: tests_lit/lit.cfg

Issue 1210013005: Fixes case where terminator instruction is missing at end of function. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: fix nits. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/PNaClTranslator.cpp ('k') | tests_lit/llvm2ice_tests/Input/no-terminator-inst.tbc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # -*- Python -*- 1 # -*- Python -*-
2 # Taken from utils/lit/tests in the LLVM tree and hacked together to support 2 # Taken from utils/lit/tests in the LLVM tree and hacked together to support
3 # our tests. 3 # our tests.
4 # 4 #
5 # Note: This configuration has simple commands to run Subzero's translator. 5 # Note: This configuration has simple commands to run Subzero's translator.
6 # They have the form %X2i (i.e. %p2i, %l2i, and %lc2i) where X is defined 6 # They have the form %X2i (i.e. %p2i, %l2i, and %lc2i) where X is defined
7 # as follows: 7 # as follows:
8 # 8 #
9 # p : Run Subzero's translator, building ICE from PNaCl bitcode directly. 9 # p : Run Subzero's translator, building ICE from PNaCl bitcode directly.
10 # l : Run Subzero's translator, converting the .ll file to a PNaCl bitcode 10 # l : Run Subzero's translator, converting the .ll file to a PNaCl bitcode
(...skipping 30 matching lines...) Expand all
41 sys.path.insert(0, 'pydir') 41 sys.path.insert(0, 'pydir')
42 from utils import FindBaseNaCl, shellcmd 42 from utils import FindBaseNaCl, shellcmd
43 43
44 # name: The name of this test suite. 44 # name: The name of this test suite.
45 config.name = 'subzero' 45 config.name = 'subzero'
46 46
47 # testFormat: The test format to use to interpret tests. 47 # testFormat: The test format to use to interpret tests.
48 config.test_format = lit.formats.ShTest() 48 config.test_format = lit.formats.ShTest()
49 49
50 # suffixes: A list of file extensions to treat as test files. 50 # suffixes: A list of file extensions to treat as test files.
51 config.suffixes = ['.ll'] 51 config.suffixes = ['.ll', '.test']
52 52
53 # test_source_root: The root path where tests are located. 53 # test_source_root: The root path where tests are located.
54 config.test_source_root = os.path.dirname(__file__) 54 config.test_source_root = os.path.dirname(__file__)
55 config.test_exec_root = config.test_source_root 55 config.test_exec_root = config.test_source_root
56 config.target_triple = '(unused)' 56 config.target_triple = '(unused)'
57 57
58 src_root = os.path.join(FindBaseNaCl(), 'toolchain_build/src/subzero') 58 src_root = os.path.join(FindBaseNaCl(), 'toolchain_build/src/subzero')
59 bin_root = src_root 59 bin_root = src_root
60 config.substitutions.append(('%{src_root}', src_root)) 60 config.substitutions.append(('%{src_root}', src_root))
61 config.substitutions.append(('%{python}', sys.executable)) 61 config.substitutions.append(('%{python}', sys.executable))
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 # Translate LLVM source for each compiler setup. 100 # Translate LLVM source for each compiler setup.
101 config.substitutions.append(('%p2i', ' '.join(pnacl_sz_cmd))) 101 config.substitutions.append(('%p2i', ' '.join(pnacl_sz_cmd)))
102 config.substitutions.append(('%l2i', ' '.join(ifl2i_atts_cmd + pnacl_sz_cmd 102 config.substitutions.append(('%l2i', ' '.join(ifl2i_atts_cmd + pnacl_sz_cmd
103 + ['--llvm']))) 103 + ['--llvm'])))
104 config.substitutions.append(('%lc2i', ' '.join(iflc2i_atts_cmd + pnacl_sz_cmd 104 config.substitutions.append(('%lc2i', ' '.join(iflc2i_atts_cmd + pnacl_sz_cmd
105 + ['--llvm-source']))) 105 + ['--llvm-source'])))
106 106
107 config.substitutions.append(('%pnacl_sz', pnacl_sz_tool)) 107 config.substitutions.append(('%pnacl_sz', pnacl_sz_tool))
108 108
109 pnaclbintools = [r"\bFileCheck\b", 109 pnaclbintools = [r'\b' + x + r'\b' for x in
110 r"\ble32-nacl-objdump\b", 110 ['FileCheck',
111 r"\bllvm-as\b", 111 'le32-nacl-objdump',
112 r"\bllvm-mc\b", 112 'llvm-as',
113 r"\bllvm-readobj\b", 113 'llvm-mc',
114 r"\bnot\b", 114 'llvm-readobj',
115 r"\bpnacl-freeze\b", 115 'not',
116 r"\bpnacl-bcdis\b"] 116 'pnacl-bcdis',
117 'pnacl-bcfuzz',
118 'pnacl-freeze']]
117 119
118 for tool in pnaclbintools: 120 for tool in pnaclbintools:
119 # The re.sub() line is adapted from one of LLVM's lit.cfg files. 121 # The re.sub() line is adapted from one of LLVM's lit.cfg files.
120 # Extract the tool name from the pattern. This relies on the tool 122 # Extract the tool name from the pattern. This relies on the tool
121 # name being surrounded by \b word match operators. If the 123 # name being surrounded by \b word match operators. If the
122 # pattern starts with "| ", include it in the string to be 124 # pattern starts with "| ", include it in the string to be
123 # substituted. 125 # substituted.
124 substitution = re.sub(r"^(\\)?((\| )?)\W+b([0-9A-Za-z-_]+)\\b\W*$", 126 substitution = re.sub(r"^(\\)?((\| )?)\W+b([0-9A-Za-z-_]+)\\b\W*$",
125 r"\2" + pnaclbinpath + "/" + r"\4", 127 r"\2" + pnaclbinpath + "/" + r"\4",
126 tool) 128 tool)
127 config.substitutions.append((tool, substitution)) 129 config.substitutions.append((tool, substitution))
128 130
129 # Add a feature to detect the Python version. 131 # Add a feature to detect the Python version.
130 config.available_features.add("python%d.%d" % (sys.version_info[0], 132 config.available_features.add("python%d.%d" % (sys.version_info[0],
131 sys.version_info[1])) 133 sys.version_info[1]))
132 134
133 # Debugging output 135 # Debugging output
134 def dbg(s): 136 def dbg(s):
135 print '[DBG] %s' % s 137 print '[DBG] %s' % s
136 138
137 dbg('bin_root = %s' % bin_root) 139 dbg('bin_root = %s' % bin_root)
138 dbg('pnaclbinpath = %s' % pnaclbinpath) 140 dbg('pnaclbinpath = %s' % pnaclbinpath)
139 dbg("Build attributes = %s" % pnacl_sz_atts) 141 dbg("Build attributes = %s" % pnacl_sz_atts)
OLDNEW
« no previous file with comments | « src/PNaClTranslator.cpp ('k') | tests_lit/llvm2ice_tests/Input/no-terminator-inst.tbc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698