[compiler-rt] Use ZLIB_FOUND not LLVM_ENABLE_ZLIB

LLVM_ENABLE_ZLIB is set to On by default and does not imply that ZLIB
was actually found, only being set to FORCE_ON would imply that it was
found before control reached compiler-rt/test/CMakeLists.txt. Instead,
use ZLIB_FOUND which guarantees that zlib is available.

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

GitOrigin-RevId: fe2f0ab37c33617c23e83d4999117e54fc34c14b
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 69e17af..3106ab7 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -12,6 +12,9 @@
 pythonize_bool(COMPILER_RT_TEST_STANDALONE_BUILD_LIBS)
 
 pythonize_bool(LLVM_ENABLE_EXPENSIVE_CHECKS)
+
+pythonize_bool(ZLIB_FOUND)
+
 configure_compiler_rt_lit_site_cfg(
   ${CMAKE_CURRENT_SOURCE_DIR}/lit.common.configured.in
   ${CMAKE_CURRENT_BINARY_DIR}/lit.common.configured)
diff --git a/test/lit.common.cfg.py b/test/lit.common.cfg.py
index a6ecbd9..aeda48f 100644
--- a/test/lit.common.cfg.py
+++ b/test/lit.common.cfg.py
@@ -231,7 +231,7 @@
 
 config.available_features.add("host-byteorder-" + sys.byteorder + "-endian")
 
-if config.have_zlib == "1":
+if config.have_zlib:
     config.available_features.add("zlib")
 
 # Use ugly construction to explicitly prohibit "clang", "clang++" etc.
diff --git a/test/lit.common.configured.in b/test/lit.common.configured.in
index 2546798..6d13283 100644
--- a/test/lit.common.configured.in
+++ b/test/lit.common.configured.in
@@ -65,7 +65,7 @@
 else:
   set_default("target_suffix", "-%s" % config.target_arch)
 
-set_default("have_zlib", "@LLVM_ENABLE_ZLIB@")
+set_default("have_zlib", @ZLIB_FOUND_PYBOOL@)
 set_default("libcxx_used", "@LLVM_LIBCXX_USED@")
 
 # LLVM tools dir can be passed in lit parameters, so try to