Add zlib feature test to lit configuration

Some new tests in libfuzzer have dependencies on zlib: add a feature test
for zlib so that we can add a REQUIRES field to the relevant tests.

Patch by Matthew Voss.

Differential Revision: https://reviews.llvm.org/D57366

llvm-svn: 352483
This commit is contained in:
Jeremy Morse 2019-01-29 12:00:01 +00:00
parent ff193c473e
commit 2601aa5406
2 changed files with 5 additions and 0 deletions

View File

@ -98,6 +98,9 @@ config.available_features.add(config.host_os.lower())
if re.match(r'^x86_64.*-linux', config.target_triple):
config.available_features.add("x86_64-linux")
if config.have_zlib == "1":
config.available_features.add("zlib")
# Use ugly construction to explicitly prohibit "clang", "clang++" etc.
# in RUN lines.
config.substitutions.append(

View File

@ -46,6 +46,8 @@ if config.enable_per_target_runtime_dir:
else:
set_default("target_suffix", "-%s" % config.target_arch)
set_default("have_zlib", "@HAVE_LIBZ@")
# LLVM tools dir can be passed in lit parameters, so try to
# apply substitution.
try: