aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-09-13 01:41:18 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-09-13 01:41:18 +0000
commit3324882bda68403c4723a6856f937320c3428849 (patch)
tree7c7cb3b6fda9be66070b1bdb7087bfb1b3bbb8dc
parent282ae0b0efbe5ce5ce81c00cb4d89e813b78efc6 (diff)
downloadexternal_llvm-3324882bda68403c4723a6856f937320c3428849.zip
external_llvm-3324882bda68403c4723a6856f937320c3428849.tar.gz
external_llvm-3324882bda68403c4723a6856f937320c3428849.tar.bz2
tests: Add llvm_supports_binding predicate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81664 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Makefile1
-rw-r--r--test/lib/llvm.exp12
-rw-r--r--test/lit.cfg4
3 files changed, 17 insertions, 0 deletions
diff --git a/test/Makefile b/test/Makefile
index 813ce57..1b3c866 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -135,6 +135,7 @@ site.exp: FORCE
@echo 'set llvmgcc_version "$(LLVMGCC_VERSION)"' >> site.tmp
@echo 'set llvmtoolsdir "$(ToolDir)"' >>site.tmp
@echo 'set llvmlibsdir "$(LibDir)"' >>site.tmp
+ @echo 'set llvm_bindings "$(BINDINGS_TO_BUILD)"' >> site.tmp
@echo 'set srcroot "$(LLVM_SRC_ROOT)"' >>site.tmp
@echo 'set objroot "$(LLVM_OBJ_ROOT)"' >>site.tmp
@echo 'set srcdir "$(LLVM_SRC_ROOT)/test"' >>site.tmp
diff --git a/test/lib/llvm.exp b/test/lib/llvm.exp
index f5ec6f3..2c1bef9 100644
--- a/test/lib/llvm.exp
+++ b/test/lib/llvm.exp
@@ -300,3 +300,15 @@ proc llvm_supports_target { tgtName } {
}
return 0
}
+
+# This procedure provides an interface to check the BINDINGS_TO_BUILD makefile
+# variable to see if a particular binding has been configured to build.
+proc llvm_supports_binding { name } {
+ global llvm_bindings
+ foreach item [split $llvm_bindings] {
+ if { [regexp $name $item match] } {
+ return 1
+ }
+ }
+ return 0
+}
diff --git a/test/lit.cfg b/test/lit.cfg
index 546984d..7eac5c6 100644
--- a/test/lit.cfg
+++ b/test/lit.cfg
@@ -99,6 +99,10 @@ langs = set(site_exp['llvmgcc_langs'].split(','))
def llvm_gcc_supports(name):
return name in langs
+bindings = set(site_exp['llvm_bindings'].split(','))
+def llvm_supports_binding(name):
+ return name in langs
+
# Provide on_clone hook for reading 'dg.exp'.
import os
simpleLibData = re.compile(r"""load_lib llvm.exp