Lines Matching +full:llvm +full:- +full:config
1 # -*- Python -*-
14 config.name = 'LLVM'
19 path = getattr(config, 'lit_tools_dir', None)
21 config.environment['PATH'],
25 config.environment['PATH']))
26 config.environment['PATH'] = path
40 config.test_format = lit.formats.ShTest(execute_external)
44 config.suffixes = ['.ll', '.c', '.cxx', '.test', '.txt', '.s', '.mir']
49 config.excludes = ['Inputs', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt']
52 config.test_source_root = os.path.dirname(__file__)
55 llvm_obj_root = getattr(config, 'llvm_obj_root', None)
57 config.test_exec_root = os.path.join(llvm_obj_root, 'test')
61 llvm_tools_dir = getattr(config, 'llvm_tools_dir', None)
63 lit_config.fatal('No LLVM tools dir set!')
64 path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH']))
65 config.environment['PATH'] = path
69 config.environment['HOME'] = os.environ['HOME']
73 config.environment['INCLUDE'] = os.environ['INCLUDE']
77 config.environment['LIB'] = os.environ['LIB']
82 config.environment['TMP'] = os.environ['TMP']
84 config.environment['TEMP'] = os.environ['TEMP']
87 config.environment['LLVM_SRC_ROOT'] = getattr(config, 'llvm_src_root', '')
90 config.environment['PYTHON_EXECUTABLE'] = getattr(config, 'python_executable',
96 config.environment[symbolizer] = os.environ[symbolizer]
99 llvm_lib_dir = getattr(config, 'llvm_lib_dir', None)
109 config.environment['OCAMLPATH'] = ocamlpath
111 config.environment['OCAMLPATH'] = llvm_ocaml_lib
116 config.environment['CAML_LD_LIBRARY_PATH'] = caml_ld_library_path
118 config.environment['CAML_LD_LIBRARY_PATH'] = llvm_ocaml_lib
121 config.environment['OCAMLRUNPARAM'] = 'b'
128 if config.test_exec_root is None:
132 # out-of-tree build situation).
137 lit_config.load_config(config, site_cfg)
140 # Try to detect the situation where we are using an out-of-tree build by
141 # looking for 'llvm-config'.
148 llvm_config = lit.util.which('llvm-config', config.environment['PATH'])
153 llvm_src_root = lit.util.capture(['llvm-config', '--src-root']).strip()
154 llvm_obj_root = lit.util.capture(['llvm-config', '--obj-root']).strip()
157 this_src_root = os.path.dirname(config.test_source_root)
167 lit_config.note('using out-of-tree build at %r' % llvm_obj_root)
168 lit_config.load_config(config, site_cfg)
179 if re.search(r'cygwin|mingw32|windows-gnu|windows-msvc|win32', config.host_triple):
180 lli += ' -mtriple='+config.host_triple+'-elf'
181 config.substitutions.append( ('%lli', lli ) )
185 if re.search(r'win32', config.target_triple):
186 llc_dwarf += ' -mtriple='+config.target_triple.replace('-win32', '-mingw32')
187 config.substitutions.append( ('%llc_dwarf', llc_dwarf) )
189 # Add site-specific substitutions.
190 config.substitutions.append( ('%gold', config.gold_executable) )
191 config.substitutions.append( ('%ld64', config.ld64_executable) )
192 config.substitutions.append( ('%go', config.go_executable) )
193 config.substitutions.append( ('%llvmshlibdir', config.llvm_shlib_dir) )
194 config.substitutions.append( ('%shlibext', config.llvm_shlib_ext) )
195 config.substitutions.append( ('%exeext', config.llvm_exe_ext) )
196 config.substitutions.append( ('%python', config.python_executable) )
197 config.substitutions.append( ('%host_cc', config.host_cc) )
201 config.substitutions.append( ('%ocamlc',
202 "%s ocamlc -cclib -L%s %s" %
203 (config.ocamlfind_executable, llvm_lib_dir, config.ocaml_flags)) )
204 if config.have_ocamlopt in ('1', 'TRUE'):
205 config.substitutions.append( ('%ocamlopt',
206 "%s ocamlopt -cclib -L%s -cclib -Wl,-rpath,%s %s" %
207 (config.ocamlfind_executable, llvm_lib_dir, llvm_lib_dir, config.ocaml_flags)) )
209 config.substitutions.append( ('%ocamlopt', "true" ) )
211 # For each occurrence of an llvm tool name as its own word, replace it
220 # The regex is a pre-assertion to avoid matching a preceding
221 # dot, hyphen, carat, or slash (.foo, -foo, etc.). Some patterns
222 # also have a post-assertion to not match a trailing hyphen (foo-).
223 NOJUNK = r"(?<!\.|-|\^|/)"
231 tool_match = re.match(r"^(\\)?((\| )?)\W+b([0-9A-Za-z-_]+)\\b\W*$",
236 # llvm-lit "-Dllc=llc -enable-misched -verify-machineinstrs"
245 tool_path += " -verify-machineinstrs"
246 if (tool_name == "llvm-go"):
247 tool_path += " go=" + config.go_executable
251 for pattern in [r"\bbugpoint\b(?!-)",
254 r"\bllvm-ar\b",
255 r"\bllvm-as\b",
256 r"\bllvm-bcanalyzer\b",
257 r"\bllvm-config\b",
258 r"\bllvm-cov\b",
259 r"\bllvm-cxxdump\b",
260 r"\bllvm-diff\b",
261 r"\bllvm-dis\b",
262 r"\bllvm-dsymutil\b",
263 r"\bllvm-dwarfdump\b",
264 r"\bllvm-extract\b",
265 r"\bllvm-lib\b",
266 r"\bllvm-link\b",
267 r"\bllvm-lto\b",
268 r"\bllvm-mc\b",
269 r"\bllvm-mcmarkup\b",
270 r"\bllvm-nm\b",
271 r"\bllvm-objdump\b",
272 r"\bllvm-pdbdump\b",
273 r"\bllvm-profdata\b",
274 r"\bllvm-ranlib\b",
275 r"\bllvm-readobj\b",
276 r"\bllvm-rtdyld\b",
277 r"\bllvm-size\b",
278 r"\bllvm-split\b",
279 r"\bllvm-tblgen\b",
280 r"\bllvm-c-test\b",
281 NOJUNK + r"\bllvm-symbolizer\b",
288 r"\byaml-bench\b",
289 r"\bverify-uselistorder\b",
299 config.substitutions.append((pattern, tool_pipe + tool_path))
301 # For tools that are optional depending on the config, we won't warn
303 for pattern in [r"\bllvm-go\b",
304 r"\bKaleidoscope-Ch3\b",
305 r"\bKaleidoscope-Ch4\b",
306 r"\bKaleidoscope-Ch5\b",
307 r"\bKaleidoscope-Ch6\b",
308 r"\bKaleidoscope-Ch7\b",
309 r"\bKaleidoscope-Ch8\b"]:
314 config.substitutions.append((pattern, tool_pipe + tool_path))
319 config.targets = frozenset(config.targets_to_build.split())
325 config.available_features.add('shell')
327 # Others/can-execute.txt
329 config.available_features.add('can-execute')
334 loadable_module = (config.enable_shared == 1)
339 config.available_features.add('loadable_module')
342 if 'Address' in config.llvm_use_sanitizer:
343 config.available_features.add("asan")
345 config.available_features.add("not_asan")
346 if 'Memory' in config.llvm_use_sanitizer:
347 config.available_features.add("msan")
349 config.available_features.add("not_msan")
350 if 'Undefined' in config.llvm_use_sanitizer:
351 config.available_features.add("ubsan")
353 config.available_features.add("not_ubsan")
357 config.available_features.add("long_tests")
360 if not 'hexagon' in config.target_triple:
361 config.available_features.add("object-emission")
363 if config.have_zlib == "1":
364 config.available_features.add("zlib")
366 config.available_features.add("nozlib")
368 # LLVM can be configured with an empty default triple
370 if config.target_triple:
371 config.available_features.add("default_triple")
372 if re.match(r'^x86_64.*-linux', config.target_triple):
373 config.available_features.add("x86_64-linux")
378 if config.host_triple == config.target_triple:
379 config.available_features.add("native")
384 if not os.path.exists(os.path.join(config.llvm_shlib_dir, 'LLVMgold.so')):
387 …ld_cmd = subprocess.Popen([config.gold_executable, '--help'], stdout = subprocess.PIPE, env={'LANG…
391 if not '-plugin' in ld_out:
406 config.available_features.add('ld_emu_elf32ppc')
408 …ld_version = subprocess.Popen([config.gold_executable, '--version'], stdout = subprocess.PIPE, env…
416 config.available_features.add('ld_plugin')
419 if config.ld64_executable == '':
422 ld_cmd = subprocess.Popen([config.ld64_executable, '-v'], stderr = subprocess.PIPE)
432 config.available_features.add('ld64_plugin')
434 # Ask llvm-config about assertion mode.
437 [os.path.join(llvm_tools_dir, 'llvm-config'), '--assertion-mode'],
439 env=config.environment)
441 print("Could not find llvm-config in " + llvm_tools_dir)
445 config.available_features.add('asserts')
455 if -1 != result.find("hw.optional.fma: 1"):
456 config.available_features.add('fma3')
459 if platform.system() in ['Windows'] and re.match(r'.*-win32$', config.target_triple):
461 config.available_features.add('system-windows')
464 if not re.match(r'^x86_64.*-(mingw32|windows-gnu|win32)', config.target_triple):
465 config.available_features.add('debug_frame')
486 config.environment.update({'DYLD_INSERT_LIBRARIES' : gmalloc_path_str})
488 # Ask llvm-config about global-isel.
491 [os.path.join(llvm_tools_dir, 'llvm-config'), '--has-global-isel'],
493 env=config.environment)
495 print("Could not find llvm-config in " + llvm_tools_dir)
499 config.available_features.add('global-isel')
502 if config.have_libxar:
503 config.available_features.add('xar')