[cfe-commits] r132571 - in /cfe/trunk/test: CodeGen/2009-10-20-GlobalDebug.c lit.cfg
Galina Kistanova
gkistanova at gmail.com
Fri Jun 3 11:36:30 PDT 2011
Author: gkistanova
Date: Fri Jun 3 13:36:30 2011
New Revision: 132571
URL: http://llvm.org/viewvc/llvm-project?rev=132571&view=rev
Log:
Added registered targets for in-test dependency declarations.
Modified:
cfe/trunk/test/CodeGen/2009-10-20-GlobalDebug.c
cfe/trunk/test/lit.cfg
Modified: cfe/trunk/test/CodeGen/2009-10-20-GlobalDebug.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2009-10-20-GlobalDebug.c?rev=132571&r1=132570&r2=132571&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/2009-10-20-GlobalDebug.c (original)
+++ cfe/trunk/test/CodeGen/2009-10-20-GlobalDebug.c Fri Jun 3 13:36:30 2011
@@ -1,3 +1,4 @@
+// REQUIRES: x86-registered-target
// RUN: %clang -ccc-host-triple i386-apple-darwin10 -S -g -dA %s -o - | FileCheck %s
int global;
// CHECK: ascii "localstatic" ## DW_AT_name
Modified: cfe/trunk/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/lit.cfg?rev=132571&r1=132570&r2=132571&view=diff
==============================================================================
--- cfe/trunk/test/lit.cfg (original)
+++ cfe/trunk/test/lit.cfg Fri Jun 3 13:36:30 2011
@@ -171,3 +171,33 @@
# Shell execution
if platform.system() not in ['Windows'] or lit.getBashPath() != '':
config.available_features.add('shell')
+
+# Registered Targets
+import subprocess
+import re
+import os
+
+def getRegisteredTargets(tool):
+ set_of_targets = set()
+
+ cmd = subprocess.Popen([tool, '-version'], stdout=subprocess.PIPE)
+
+ # Parse the stdout to get the list of registered targets.
+ parse_targets = False
+ for line in cmd.stdout:
+ if parse_targets:
+ m = re.match( r'(.*) - ', line)
+ if m is not None:
+ set_of_targets.add(m.group(1).strip() + '-registered-target')
+ else:
+ break
+ elif "Registered Targets:" in line:
+ parse_targets = True
+
+ return set_of_targets
+
+registered_targets = getRegisteredTargets(os.path.join(llvm_tools_dir, 'llc'))
+if len(registered_targets) > 0:
+ config.available_features.update(registered_targets)
+else:
+ lit.fatal('No Targets Registered with the LLVM Tools!')
More information about the cfe-commits
mailing list