Steal the TARGET lit condition from the LLVM test suite.

llvm-svn: 97727
This commit is contained in:
John McCall 2010-03-04 09:38:07 +00:00
parent d423572e86
commit b07d8b56d2
1 changed files with 12 additions and 0 deletions

View File

@ -97,6 +97,18 @@ if config.test_exec_root is None:
###
import re
site_exp = {}
for line in open(os.path.join(config.llvm_obj_root, 'test', 'site.exp')):
m = re.match('set ([^ ]+) "([^"]*)"', line)
if m:
site_exp[m.group(1)] = m.group(2)
targets = set(site_exp['TARGETS_TO_BUILD'].split())
def llvm_supports_target(name):
return name in targets
config.conditions['TARGET'] = llvm_supports_target
# Discover the 'clang' and 'clangcc' to use.
import os