Lines Matching +full:llvm +full:- +full:config

1 # -*- Python -*-
10 config.name = 'LLVM'
13 config.test_format = lit.formats.TclTest()
16 #config.test_format = lit.formats.TclTest(ignoreStdErr=True)
20 config.suffixes = []
23 config.test_source_root = os.path.dirname(__file__)
28 path = getattr(config, 'lit_tools_dir', None)
30 config.environment['PATH'],
34 config.environment['PATH']))
35 config.environment['PATH'] = path
38 llvm_obj_root = getattr(config, 'llvm_obj_root', None)
40 config.test_exec_root = os.path.join(llvm_obj_root, 'test')
42 # Tweak the PATH to include the scripts dir, the tools dir, and the llvm-gcc bin
45 # Include llvm-gcc first, as the llvm-gcc binaryies will not appear
47 # possible, that some old llvm tools are in the llvm-gcc dir. Adding
48 # llvm-gcc dir first ensures, that those will always be overwritten
51 llvmgcc_dir = getattr(config, 'llvmgcc_dir', None)
54 config.environment['PATH']))
55 config.environment['PATH'] = path
57 llvm_src_root = getattr(config, 'llvm_src_root', None)
59 lit.fatal('No LLVM source root set!')
62 config.environment['PATH']))
63 config.environment['PATH'] = path
65 llvm_tools_dir = getattr(config, 'llvm_tools_dir', None)
67 lit.fatal('No LLVM tools dir set!')
68 path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH']))
69 config.environment['PATH'] = path
73 config.environment['HOME'] = os.environ['HOME']
77 config.environment['INCLUDE'] = os.environ['INCLUDE']
81 config.environment['LIB'] = os.environ['LIB']
86 config.environment['TMP'] = os.environ['TMP']
88 config.environment['TEMP'] = os.environ['TEMP']
91 config.environment['LLVM_SRC_ROOT'] = getattr(config, 'llvm_src_root', '')
94 config.environment['PYTHON_EXECUTABLE'] = getattr(config, 'python_executable',
102 if config.test_exec_root is None:
106 # out-of-tree build situation).
111 lit.load_config(config, site_cfg)
114 # Try to detect the situation where we are using an out-of-tree build by
115 # looking for 'llvm-config'.
122 llvm_config = lit.util.which('llvm-config', config.environment['PATH'])
127 llvm_src_root = lit.util.capture(['llvm-config', '--src-root']).strip()
128 llvm_obj_root = lit.util.capture(['llvm-config', '--obj-root']).strip()
131 this_src_root = os.path.dirname(config.test_source_root)
141 lit.note('using out-of-tree build at %r' % llvm_obj_root)
142 lit.load_config(config, site_cfg)
151 for line in open(os.path.join(config.llvm_obj_root, 'test', 'site.exp')):
157 config.substitutions.append(('%llvmgcc_only', site_exp['llvmgcc']))
163 config.substitutions.append(('%' + sub,
164 site_exp[sub] + ' %emitir -w'))
166 # warning when passing in "-fexceptions -fno-exceptions".
168 config.substitutions.append(('%' + sub,
169 site_exp[sub].replace('-fno-exceptions', '')))
171 config.substitutions.append(('%' + sub, site_exp[sub]))
173 # For each occurrence of an llvm tool name as its own word, replace it
179 # Don't match 'bugpoint-' or 'clang-'.
180 # Don't match '/clang' or '-clang'.
185 for pattern in [r"\bbugpoint\b(?!-)", r"(?<!/|-)\bclang\b(?!-)",
188 r"\bllvm-ar\b", r"\bllvm-as\b",
189 r"\bllvm-bcanalyzer\b", r"\bllvm-config\b",
190 r"\bllvm-diff\b", r"\bllvm-dis\b",
191 r"\bllvm-extract\b", r"\bllvm-ld\b",
192 r"\bllvm-link\b", r"\bllvm-mc\b",
193 r"\bllvm-nm\b", r"\bllvm-prof\b",
194 r"\bllvm-ranlib\b", r"\bllvm-shlib\b",
195 r"\bllvm-stub\b", r"\bllvm2cpp\b",
196 # Don't match '-llvmc'.
197 r"(?<!-)\bllvmc\b", r"\blto\b",
198 # Don't match '.opt', '-opt',
200 r"\bmacho-dump\b", r"(?<!\.|-|\^|/)\bopt\b",
201 r"\bllvm-tblgen\b", r"\bFileCheck\b",
202 r"\bFileUpdate\b", r"\bc-index-test\b",
203 r"\bfpcmp\b", r"\bllvm-PerfectShuffle\b",
211 substitution = re.sub(r"^(\\)?((\| )?)\W+b([0-9A-Za-z-_]+)\\b\W*$",
219 config.substitutions.append((pattern, substitution))
224 config.target_triple = site_exp['target_triplet']
226 # When running under valgrind, we mangle '-vg' or '-vg_leak' onto the end of the
228 config.target_triple += lit.valgrindTriple
236 return 'darwin' in config.target_triple and llvm_supports_target(name)
244 simpleLibData = re.compile(r"""load_lib llvm.exp
246 RunLLVMTests \[lsort \[glob -nocomplain \$srcdir/\$subdir/\*\.(.*)\]\]""",
248 conditionalLibData = re.compile(r"""load_lib llvm.exp
250 if.*\[ ?(llvm[^ ]*) ([^ ]*) ?\].*{
251 *RunLLVMTests \[lsort \[glob -nocomplain \$srcdir/\$subdir/\*\.(.*)\]\]
255 if match[0] == '{' and match[-1] == '}':
256 cfg.suffixes = ['.' + s for s in match[1:-1].split(',')]
291 config.on_clone = on_clone
297 config.available_features.add('shell')
302 loadable_module = (config.enable_shared == 1)
307 config.available_features.add('loadable_module')
309 if config.enable_assertions:
310 config.available_features.add('asserts')