diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2012-04-14 13:54:10 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2012-04-14 13:54:10 +0000 |
commit | 63faed5b8e4f2755f127fcb8aa440480c0649327 (patch) | |
tree | 19c69a04768629f2d440944b71cbe90adae0b615 /test/lit.cfg | |
parent | d4c8b5d2e851b0e8a063c6bf8543a4823a26c15a (diff) | |
download | src-63faed5b8e4f2755f127fcb8aa440480c0649327.tar.gz src-63faed5b8e4f2755f127fcb8aa440480c0649327.zip |
Vendor import of llvm trunk r154661:vendor/llvm/llvm-trunk-r154661
Notes
Notes:
svn path=/vendor/llvm/dist/; revision=234285
svn path=/vendor/llvm/llvm-trunk-r154661/; revision=234286; tag=vendor/llvm/llvm-trunk-r154661
Diffstat (limited to 'test/lit.cfg')
-rw-r--r-- | test/lit.cfg | 141 |
1 files changed, 37 insertions, 104 deletions
diff --git a/test/lit.cfg b/test/lit.cfg index 91abb636f479..c58935956a4f 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -42,18 +42,6 @@ if llvm_obj_root is not None: # Tweak the PATH to include the scripts dir, the tools dir, and the llvm-gcc bin # dir (if available). if llvm_obj_root is not None: - # Include llvm-gcc first, as the llvm-gcc binaryies will not appear - # neither in the tools nor in the scripts dir. However it might be - # possible, that some old llvm tools are in the llvm-gcc dir. Adding - # llvm-gcc dir first ensures, that those will always be overwritten - # by the new tools in llvm_tools_dir. So now outdated tools are used - # for testing - llvmgcc_dir = getattr(config, 'llvmgcc_dir', None) - if llvmgcc_dir: - path = os.path.pathsep.join((os.path.join(llvmgcc_dir, 'bin'), - config.environment['PATH'])) - config.environment['PATH'] = path - llvm_src_root = getattr(config, 'llvm_src_root', None) if not llvm_src_root: lit.fatal('No LLVM source root set!') @@ -153,22 +141,32 @@ for line in open(os.path.join(config.llvm_obj_root, 'test', 'site.exp')): if m: site_exp[m.group(1)] = m.group(2) +# Provide target_triple for use in XFAIL and XTARGET. +config.target_triple = site_exp['target_triplet'] + +# When running under valgrind, we mangle '-vg' or '-vg_leak' onto the end of the +# triple so we can check it with XFAIL and XTARGET. +config.target_triple += lit.valgrindTriple + +# Process jit implementation option +jit_impl_cfg = lit.params.get('jit_impl', None) +if jit_impl_cfg == 'mcjit': + # When running with mcjit, mangle -mcjit into target triple + # and add -use-mcjit flag to lli invocation + if 'i686' in config.target_triple: + config.target_triple += jit_impl_cfg + '-ia32' + elif 'x86_64' in config.target_triple: + config.target_triple += jit_impl_cfg + '-ia64' + else: + config.target_triple += jit_impl_cfg + + config.substitutions.append( ('%lli', 'lli -use-mcjit') ) +else: + config.substitutions.append( ('%lli', 'lli') ) + # Add substitutions. -config.substitutions.append(('%llvmgcc_only', site_exp['llvmgcc'])) -for sub in ['llvmgcc', 'llvmgxx', 'emitir', 'compile_cxx', 'compile_c', - 'link', 'shlibext', 'ocamlopt', 'llvmdsymutil', 'llvmlibsdir', - 'llvmshlibdir', - 'bugpoint_topts']: - if sub in ('llvmgcc', 'llvmgxx'): - config.substitutions.append(('%' + sub, - site_exp[sub] + ' %emitir -w')) - # FIXME: This is a hack to avoid LLVMC tests failing due to a clang driver - # warning when passing in "-fexceptions -fno-exceptions". - elif sub == 'compile_cxx': - config.substitutions.append(('%' + sub, - site_exp[sub].replace('-fno-exceptions', ''))) - else: - config.substitutions.append(('%' + sub, site_exp[sub])) +for sub in ['link', 'shlibext', 'ocamlopt', 'llvmshlibdir']: + config.substitutions.append(('%' + sub, site_exp[sub])) # For each occurrence of an llvm tool name as its own word, replace it # with the full path to the build directory holding that tool. This @@ -187,12 +185,14 @@ for pattern in [r"\bbugpoint\b(?!-)", r"(?<!/|-)\bclang\b(?!-)", r"\bllc\b", r"\blli\b", r"\bllvm-ar\b", r"\bllvm-as\b", r"\bllvm-bcanalyzer\b", r"\bllvm-config\b", - r"\bllvm-diff\b", r"\bllvm-dis\b", + r"\bllvm-cov\b", r"\bllvm-diff\b", + r"\bllvm-dis\b", r"\bllvm-dwarfdump\b", r"\bllvm-extract\b", r"\bllvm-ld\b", r"\bllvm-link\b", r"\bllvm-mc\b", - r"\bllvm-nm\b", r"\bllvm-prof\b", - r"\bllvm-ranlib\b", r"\bllvm-shlib\b", - r"\bllvm-stub\b", r"\bllvm2cpp\b", + r"\bllvm-nm\b", r"\bllvm-objdump\b", + r"\bllvm-prof\b", r"\bllvm-ranlib\b", + r"\bllvm-rtdyld\b", r"\bllvm-shlib\b", + r"\bllvm-size\b", r"\bllvm-stub\b", # Don't match '-llvmc'. r"(?<!-)\bllvmc\b", r"\blto\b", # Don't match '.opt', '-opt', @@ -218,78 +218,6 @@ for pattern in [r"\bbugpoint\b(?!-)", r"(?<!/|-)\bclang\b(?!-)", break config.substitutions.append((pattern, substitution)) -excludes = [] - -# Provide target_triple for use in XFAIL and XTARGET. -config.target_triple = site_exp['target_triplet'] - -# When running under valgrind, we mangle '-vg' or '-vg_leak' onto the end of the -# triple so we can check it with XFAIL and XTARGET. -config.target_triple += lit.valgrindTriple - -# Provide llvm_supports_target for use in local configs. -targets = set(site_exp["TARGETS_TO_BUILD"].split()) -def llvm_supports_target(name): - return name in targets - -def llvm_supports_darwin_and_target(name): - return 'darwin' in config.target_triple and llvm_supports_target(name) - -bindings = set([s.strip() for s in site_exp['llvm_bindings'].split(',')]) -def llvm_supports_binding(name): - return name.strip() in bindings - -# Provide on_clone hook for reading 'dg.exp'. -import os -simpleLibData = re.compile(r"""load_lib llvm.exp - -RunLLVMTests \[lsort \[glob -nocomplain \$srcdir/\$subdir/\*\.(.*)\]\]""", - re.MULTILINE) -conditionalLibData = re.compile(r"""load_lib llvm.exp - -if.*\[ ?(llvm[^ ]*) ([^ ]*) ?\].*{ - *RunLLVMTests \[lsort \[glob -nocomplain \$srcdir/\$subdir/\*\.(.*)\]\] -\}""", re.MULTILINE) -def on_clone(parent, cfg, for_path): - def addSuffixes(match): - if match[0] == '{' and match[-1] == '}': - cfg.suffixes = ['.' + s for s in match[1:-1].split(',')] - else: - cfg.suffixes = ['.' + match] - - libPath = os.path.join(os.path.dirname(for_path), - 'dg.exp') - if not os.path.exists(libPath): - cfg.unsupported = True - return - - # Reset unsupported, in case we inherited it. - cfg.unsupported = False - lib = open(libPath).read().strip() - - # Check for a simple library. - m = simpleLibData.match(lib) - if m: - addSuffixes(m.group(1)) - return - - # Check for a conditional test set. - m = conditionalLibData.match(lib) - if m: - funcname,arg,match = m.groups() - addSuffixes(match) - - func = globals().get(funcname) - if not func: - lit.error('unsupported predicate %r' % funcname) - elif not func(arg): - cfg.unsupported = True - return - # Otherwise, give up. - lit.error('unable to understand %r:\n%s' % (libPath, lib)) - -config.on_clone = on_clone - ### Features # Shell execution @@ -306,5 +234,10 @@ else: if loadable_module: config.available_features.add('loadable_module') -if config.enable_assertions: +# llc knows whether he is compiled with -DNDEBUG. +import subprocess +llc_cmd = subprocess.Popen([os.path.join(llvm_tools_dir, 'llc'), '-version'], + stdout = subprocess.PIPE) +if re.search(r'with assertions', llc_cmd.stdout.read()): config.available_features.add('asserts') +llc_cmd.wait() |