Exemplo n.º 1
0
    llvm_config.with_environment('_NT_SYMBOL_PATH', '')
    tools.append(ToolSubst('%cdb', '"%s"' % os.path.join(win_sdk, 'Debuggers',
                                                         arch, 'cdb.exe')))

# clang_src_dir is not used by these tests, but is required by
# use_clang(), so set it to "".
if not hasattr(config, 'clang_src_dir'):
    config.clang_src_dir = ""
llvm_config.use_clang()

if config.llvm_use_sanitizer:
    # Propagate path to symbolizer for ASan/MSan.
    llvm_config.with_system_environment(
        ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH'])
llvm_config.with_environment('PATHTOCLANG', llvm_config.config.clang)
llvm_config.with_environment('PATHTOCLANGPP', llvm_config.use_llvm_tool('clang++'))
llvm_config.with_environment('PATHTOCLANGCL', llvm_config.use_llvm_tool('clang-cl'))

# Check which debuggers are available:
built_lldb = llvm_config.use_llvm_tool('lldb', search_env='CLANG')
lldb_path = None
if built_lldb is not None:
    lldb_path = built_lldb
elif lit.util.which('lldb') is not None:
    lldb_path = lit.util.which('lldb')

if lldb_path is not None:
    config.available_features.add('lldb')

# Produce dexter path, lldb path, and combine into the %dexter substitution
# for running a test.
Exemplo n.º 2
0
    return any(config.host_triple.lower().startswith(x.lower())
               for x in targets)


# Dexter tests run on the host machine. If the host arch is supported add
# 'dexter' as an available feature and force the dexter tests to use the host
# triple.
if can_target_host():
    config.available_features.add('dexter')
    if config.host_triple != config.target_triple:
        print('Forcing dexter tests to use host triple {}.'.format(
            config.host_triple))
    llvm_config.with_environment('PATHTOCLANG',
                                 add_host_triple(llvm_config.config.clang))
    llvm_config.with_environment(
        'PATHTOCLANGPP', add_host_triple(llvm_config.use_llvm_tool('clang++')))
    llvm_config.with_environment(
        'PATHTOCLANGCL',
        add_host_triple(llvm_config.use_llvm_tool('clang-cl')))
else:
    print('Host triple {} not supported. Skipping dexter tests in the '
          'debuginfo-tests project.'.format(config.host_triple))

# Check which debuggers are available:
built_lldb = llvm_config.use_llvm_tool('lldb', search_env='CLANG')
lldb_path = None
if built_lldb is not None:
    lldb_path = built_lldb
elif lit.util.which('lldb') is not None:
    lldb_path = lit.util.which('lldb')
Exemplo n.º 3
0
        ToolSubst('%cdb', '"%s"' %
                  os.path.join(win_sdk, 'Debuggers', arch, 'cdb.exe')))

# clang_src_dir is not used by these tests, but is required by
# use_clang(), so set it to "".
if not hasattr(config, 'clang_src_dir'):
    config.clang_src_dir = ""
llvm_config.use_clang()

if config.llvm_use_sanitizer:
    # Propagate path to symbolizer for ASan/MSan.
    llvm_config.with_system_environment(
        ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH'])
llvm_config.with_environment('PATHTOCLANG', llvm_config.config.clang)
llvm_config.with_environment('PATHTOCLANGPP',
                             llvm_config.use_llvm_tool('clang++'))
llvm_config.with_environment('PATHTOCLANGCL',
                             llvm_config.use_llvm_tool('clang-cl'))

# Check which debuggers are available:
built_lldb = llvm_config.use_llvm_tool('lldb', search_env='CLANG')
lldb_path = None
if built_lldb is not None:
    lldb_path = built_lldb
elif lit.util.which('lldb') is not None:
    lldb_path = lit.util.which('lldb')

if lldb_path is not None:
    config.available_features.add('lldb')

# Produce dexter path, lldb path, and combine into the %dexter substitution
Exemplo n.º 4
0
config.excludes = ['Inputs', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt']

# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)

# test_exec_root: The root path where tests should be run.
config.test_exec_root = os.path.join(config.bolt_obj_root, 'test')

llvm_config.use_default_substitutions()

config.substitutions.append(('%host_cc', config.host_cc))

tool_dirs = [config.llvm_tools_dir,
             config.test_source_root]

linker_tool = llvm_config.use_llvm_tool('ld', required=True)
tools = [
    ToolSubst('llvm-bolt', unresolved='fatal'),
    ToolSubst('perf2bolt', unresolved='fatal'),
    ToolSubst('yaml2obj', unresolved='fatal'),
    ToolSubst('llvm-mc', unresolved='fatal'),
    ToolSubst('linker', command=linker_tool, unresolved='fatal'),
    ToolSubst('link_fdata', command=FindTool('link_fdata.sh'), unresolved='fatal'),
]
llvm_config.add_tool_substitutions(tools, tool_dirs)

# Propagate path to symbolizer for ASan/MSan.
llvm_config.with_system_environment(
    ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH'])

config.substitutions.append(('%PATH%', config.environment['PATH']))
Exemplo n.º 5
0
                       errormsg + ' Some tests will be skipped.')

if config.bolt_enable_runtime:
    config.available_features.add("bolt-runtime")

if config.gnu_ld:
    config.available_features.add("gnu_ld")

llvm_config.use_default_substitutions()

llvm_config.config.environment['CLANG'] = config.bolt_clang
llvm_config.use_clang()

llvm_config.config.environment['LD_LLD'] = config.bolt_lld
ld_lld = llvm_config.use_llvm_tool('ld.lld',
                                   required=True,
                                   search_env='LD_LLD')
llvm_config.config.available_features.add('ld.lld')
llvm_config.add_tool_substitutions([ToolSubst(r'ld\.lld', command=ld_lld)])

config.substitutions.append(('%cflags', ''))
config.substitutions.append(('%cxxflags', ''))

link_fdata_cmd = os.path.join(config.test_source_root, 'link_fdata.py')

tool_dirs = [config.llvm_tools_dir, config.test_source_root]

tools = [
    ToolSubst('llc', unresolved='fatal'),
    ToolSubst('llvm-dwarfdump', unresolved='fatal'),
    ToolSubst('llvm-bolt', unresolved='fatal'),
Exemplo n.º 6
0
  # The arch name in the triple and targets set may be spelled differently
  # (e.g. x86 vs X86).
  return any(config.host_triple.lower().startswith(x.lower())
             for x in targets)

# Dexter tests run on the host machine. If the host arch is supported add
# 'dexter' as an available feature and force the dexter tests to use the host
# triple.
if can_target_host():
  config.available_features.add('dexter')
  if config.host_triple != config.target_triple:
    print('Forcing dexter tests to use host triple {}.'.format(config.host_triple))
  llvm_config.with_environment('PATHTOCLANG',
                               add_host_triple(llvm_config.config.clang))
  llvm_config.with_environment('PATHTOCLANGPP',
                               add_host_triple(llvm_config.use_llvm_tool('clang++')))
  llvm_config.with_environment('PATHTOCLANGCL',
                               add_host_triple(llvm_config.use_llvm_tool('clang-cl')))
else:
  print('Host triple {} not supported. Skipping dexter tests in the '
        'debuginfo-tests project.'.format(config.host_triple))

# Check which debuggers are available:
lldb_path = llvm_config.use_llvm_tool('lldb', search_env='LLDB')

if lldb_path is not None:
    config.available_features.add('lldb')

# Produce dexter path, lldb path, and combine into the %dexter substitution
# for running a test.
dexter_path = os.path.join(config.cross_project_tests_src_root,
Exemplo n.º 7
0
if supported:
    config.available_features.add("lit-max-individual-test-time")
    lit_config.maxIndividualTestTime = 60
else:
    lit_config.warning('Setting a timeout per test not supported. ' +
                       errormsg + ' Some tests will be skipped.')

if config.bolt_enable_runtime:
    config.available_features.add("bolt-runtime")

llvm_config.use_default_substitutions()

llvm_config.config.environment['CLANG'] = config.bolt_clang
llvm_config.config.environment['LLD'] = config.bolt_lld
llvm_config.use_clang()
llvm_config.use_llvm_tool('lld', required=True, search_env='LLD')

config.substitutions.append(('%cflags', '-no-pie -gdwarf-4'))
config.substitutions.append(('%cxxflags', '-no-pie -gdwarf-4'))

link_fdata_cmd = os.path.join(config.test_source_root, 'link_fdata.py')

tool_dirs = [config.llvm_tools_dir, config.test_source_root]

tools = [
    ToolSubst('llc', unresolved='fatal'),
    ToolSubst('llvm-dwarfdump', unresolved='fatal'),
    ToolSubst('llvm-bolt', unresolved='fatal'),
    ToolSubst('llvm-boltdiff', unresolved='fatal'),
    ToolSubst('perf2bolt', unresolved='fatal'),
    ToolSubst('yaml2obj', unresolved='fatal'),