• Home
  • Raw
  • Download

Lines Matching +full:add +full:- +full:to +full:- +full:path

1 # -*- Python -*-
16 # Tweak PATH for Win32 to decide to use bash.exe or not.
18 # Seek sane tools in directories and set to $PATH.
19 path = getattr(config, 'lit_tools_dir', None)
20 path = lit_config.getToolsPath(path,
21 config.environment['PATH'],
23 if path is not None:
24 path = os.path.pathsep.join((path,
25 config.environment['PATH']))
26 config.environment['PATH'] = path
35 # Otherwise we default to internal on Windows and external elsewhere, as
39 # testFormat: The test format to use to interpret tests.
42 # suffixes: A list of file extensions to treat as test files. This is overriden
46 # excludes: A list of directories to exclude from the testsuite. The 'Inputs'
51 # test_source_root: The root path where tests are located.
52 config.test_source_root = os.path.dirname(__file__)
54 # test_exec_root: The root path where tests should be run.
57 config.test_exec_root = os.path.join(llvm_obj_root, 'test')
59 # Tweak the PATH to include the tools dir.
64 path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH']))
65 config.environment['PATH'] = path
93 # Propagate path to symbolizer for ASan/MSan.
98 # Set up OCAMLPATH to include newly built OCaml libraries.
102 llvm_lib_dir = os.path.join(llvm_obj_root, 'lib')
105 llvm_ocaml_lib = os.path.join(llvm_lib_dir, 'ocaml')
108 ocamlpath = os.path.pathsep.join((llvm_ocaml_lib, os.environ['OCAMLPATH']))
114 caml_ld_library_path = os.path.pathsep.join((llvm_ocaml_lib,
120 # Set up OCAMLRUNPARAM to enable backtraces in OCaml tests.
130 # probably trying to run on a test file directly, and either the site
132 # out-of-tree build situation).
136 if site_cfg and os.path.exists(site_cfg):
140 # Try to detect the situation where we are using an out-of-tree build by
141 # looking for 'llvm-config'.
143 # FIXME: I debated (i.e., wrote and threw away) adding logic to
145 # build situation. This means knowing how to invoke the build system
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()
156 # Validate that we got a tree which points to here.
157 this_src_root = os.path.dirname(config.test_source_root)
158 if os.path.realpath(llvm_src_root) != os.path.realpath(this_src_root):
162 site_cfg = os.path.join(llvm_obj_root, 'test', 'lit.site.cfg')
163 if not os.path.exists(site_cfg):
167 lit_config.note('using out-of-tree build at %r' % llvm_obj_root)
178 # difficult to obtain on Windows.
179 if re.search(r'cygwin|mingw32|windows-gnu|windows-msvc|win32', config.host_triple):
180 lli += ' -mtriple='+config.host_triple+'-elf'
183 # Similarly, have a macro to use llc with DWARF even when the host is win32.
186 llc_dwarf += ' -mtriple='+config.target_triple.replace('-win32', '-mingw32')
189 # Add site-specific substitutions.
202 "%s ocamlc -cclib -L%s %s" %
206 "%s ocamlopt -cclib -L%s -cclib -Wl,-rpath,%s %s" %
212 # with the full path to the build directory holding that tool. This
214 # tools that might happen to be in the user's PATH. Thus this list
219 # path names or options or whatever.
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"(?<!\.|-|\^|/)"
229 # pattern starts with "| ", include it in the string to be
231 tool_match = re.match(r"^(\\)?((\| )?)\W+b([0-9A-Za-z-_]+)\\b\W*$",
235 # Did the user specify the tool path + arguments? This allows things like
236 # llvm-lit "-Dllc=llc -enable-misched -verify-machineinstrs"
245 tool_path += " -verify-machineinstrs"
246 if (tool_name == "llvm-go"):
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",
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"]:
325 config.available_features.add('shell')
327 # Others/can-execute.txt
329 config.available_features.add('can-execute')
339 config.available_features.add('loadable_module')
343 config.available_features.add("asan")
345 config.available_features.add("not_asan")
347 config.available_features.add("msan")
349 config.available_features.add("not_msan")
351 config.available_features.add("ubsan")
353 config.available_features.add("not_ubsan")
357 config.available_features.add("long_tests")
361 config.available_features.add("object-emission")
364 config.available_features.add("zlib")
366 config.available_features.add("nozlib")
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")
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')
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'],
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):
460 # For tests that require Windows to run.
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')
477 # Default to not using gmalloc
480 # Allow use of an explicit path for gmalloc library.
481 # Will default to '/usr/lib/libgmalloc.dylib' if not set.
488 # Ask llvm-config about global-isel.
491 [os.path.join(llvm_tools_dir, 'llvm-config'), '--has-global-isel'],
495 print("Could not find llvm-config in " + llvm_tools_dir)
499 config.available_features.add('global-isel')
503 config.available_features.add('xar')