aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGalina Kistanova <gkistanova@gmail.com>2011-06-03 18:36:30 +0000
committerGalina Kistanova <gkistanova@gmail.com>2011-06-03 18:36:30 +0000
commitee22697a56f3035419e71762134ff7ea0d8f1eb8 (patch)
treee97fd730425699027361614e724dee7ea6fea9e6
parent5a4cca2cc576bb42309e3e86befaa904283e9c8c (diff)
Added registered targets for in-test dependency declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132571 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/CodeGen/2009-10-20-GlobalDebug.c1
-rw-r--r--test/lit.cfg30
2 files changed, 31 insertions, 0 deletions
diff --git a/test/CodeGen/2009-10-20-GlobalDebug.c b/test/CodeGen/2009-10-20-GlobalDebug.c
index 3c46bea379..42f020e39e 100644
--- a/test/CodeGen/2009-10-20-GlobalDebug.c
+++ b/test/CodeGen/2009-10-20-GlobalDebug.c
@@ -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
diff --git a/test/lit.cfg b/test/lit.cfg
index 4b9d529b7d..e18105df19 100644
--- a/test/lit.cfg
+++ b/test/lit.cfg
@@ -171,3 +171,33 @@ if platform.system() != 'Windows':
# 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!')