test/lit.cfg: Enhance getRegisteredTargets() to retrieve +Asserts.

- s/getRegisteredTargets/get_llc_props/g
  - get_llc_props() returns dict {"set_of_targets", "enable_assertions"}
  - Enable the feature "asserts".
    test/Driver/darwin-verify-debug.c had expected it.

llvm-svn: 145231
This commit is contained in:
NAKAMURA Takumi 2011-11-28 05:09:42 +00:00
parent 8284ec46b6
commit cd9c3d6647

View File

@ -194,8 +194,9 @@ if platform.system() not in ['Windows'] or lit.getBashPath() != '':
config.available_features.add('shell')
# Registered Targets
def getRegisteredTargets(tool):
def get_llc_props(tool):
set_of_targets = set()
enable_assertions = False
cmd = subprocess.Popen([tool, '-version'], stdout=subprocess.PIPE)
@ -211,10 +212,17 @@ def getRegisteredTargets(tool):
elif "Registered Targets:" in line:
parse_targets = True
return set_of_targets
if re.search(r'with assertions', line):
enable_assertions = True
registered_targets = getRegisteredTargets(os.path.join(llvm_tools_dir, 'llc'))
if len(registered_targets) > 0:
config.available_features.update(registered_targets)
return {"set_of_targets": set_of_targets,
"enable_assertions": enable_assertions}
llc_props = get_llc_props(os.path.join(llvm_tools_dir, 'llc'))
if len(llc_props['set_of_targets']) > 0:
config.available_features.update(llc_props['set_of_targets'])
else:
lit.fatal('No Targets Registered with the LLVM Tools!')
if llc_props['enable_assertions']:
config.available_features.add('asserts')