[cfe-commits] r145231 - /cfe/trunk/test/lit.cfg
NAKAMURA Takumi
geek4civic at gmail.com
Sun Nov 27 21:09:42 PST 2011
Author: chapuni
Date: Sun Nov 27 23:09:42 2011
New Revision: 145231
URL: http://llvm.org/viewvc/llvm-project?rev=145231&view=rev
Log:
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.
Modified:
cfe/trunk/test/lit.cfg
Modified: cfe/trunk/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/lit.cfg?rev=145231&r1=145230&r2=145231&view=diff
==============================================================================
--- cfe/trunk/test/lit.cfg (original)
+++ cfe/trunk/test/lit.cfg Sun Nov 27 23:09:42 2011
@@ -194,8 +194,9 @@
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 @@
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')
More information about the cfe-commits
mailing list