]> granicus.if.org Git - clang/commitdiff
Added registered targets for in-test dependency declarations.
authorGalina Kistanova <gkistanova@gmail.com>
Fri, 3 Jun 2011 18:36:30 +0000 (18:36 +0000)
committerGalina Kistanova <gkistanova@gmail.com>
Fri, 3 Jun 2011 18:36:30 +0000 (18:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132571 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGen/2009-10-20-GlobalDebug.c
test/lit.cfg

index 3c46bea37986f0a1a3a04efdf2e76ab4c3444837..42f020e39e8892ff15db494c757af34a59849f7d 100644 (file)
@@ -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
index 4b9d529b7d268fe4bc94c6fd7e9e3cf566ce2b5d..e18105df1916e911093360bf90b707f0b8098d74 100644 (file)
@@ -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!')