summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-03-04 09:36:50 +0000
committerJohn McCall <rjmccall@apple.com>2010-03-04 09:36:50 +0000
commitd423572e86bd5336af284e466f26f9f552898a62 (patch)
tree4bed40dc0dd48b915f7f36e33acb0950dd5fd49b /llvm/test
parent6f84d46f3329658b14bb1ca75276cd8975410c8d (diff)
downloadbcm5719-llvm-d423572e86bd5336af284e466f26f9f552898a62.tar.gz
bcm5719-llvm-d423572e86bd5336af284e466f26f9f552898a62.zip
Teach lit to honor conditional directives. The syntax is:
IF(condition(value)): If the value satisfies the condition, the line is processed by lit; otherwise it is skipped. A test with no unignored directives is resolved as Unsupported. The test suite is responsible for defining conditions; conditions are unary functions over strings. I've defined two conditions in the LLVM test suite, TARGET (with values like those in TARGETS_TO_BUILD) and BINDING (with values like those in llvm_bindings). So for example you can write: IF(BINDING(ocaml)): RUN: %blah %s -o - and the RUN line will only execute if LLVM was configured with the ocaml bindings. llvm-svn: 97726
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/lit.cfg3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/test/lit.cfg b/llvm/test/lit.cfg
index 929871a1d22..b4aec5a50ab 100644
--- a/llvm/test/lit.cfg
+++ b/llvm/test/lit.cfg
@@ -144,6 +144,9 @@ bindings = set(site_exp['llvm_bindings'].split(','))
def llvm_supports_binding(name):
return name in bindings
+config.conditions["TARGET"] = llvm_supports_target
+config.conditions["BINDING"] = llvm_supports_binding
+
# Provide on_clone hook for reading 'dg.exp'.
import os
simpleLibData = re.compile(r"""load_lib llvm.exp
OpenPOWER on IntegriCloud