mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-03 19:32:35 +00:00
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:
parent
8284ec46b6
commit
cd9c3d6647
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user