Skip to content

Commit eb0e4b1

Browse files
authored
[Fuzzer] Passthrough zlib CMake paths into the test (#107926)
We shouldn't assume that we're using system zlib installation.
1 parent 761bf33 commit eb0e4b1

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

compiler-rt/test/fuzzer/compressed.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ REQUIRES: zlib
44
# unsupported by this test.
55
UNSUPPORTED: i386, target=arm{{.*}}
66
# Custom mutator should find this bug, w/o custom -- no chance.
7-
RUN: %cpp_compiler %S/CompressedTest.cpp -o %t-CompressedTestCustom -DCUSTOM_MUTATOR -lz
8-
RUN: %cpp_compiler %S/CompressedTest.cpp -o %t-CompressedTestPlain -lz
7+
RUN: %cpp_compiler %S/CompressedTest.cpp -o %t-CompressedTestCustom -DCUSTOM_MUTATOR -I%zlib_include_dir %zlib_library
8+
RUN: %cpp_compiler %S/CompressedTest.cpp -o %t-CompressedTestPlain -I%zlib_include_dir %zlib_library
99
RUN: not %run %t-CompressedTestCustom -seed=1 -runs=1000000
1010
RUN: %run %t-CompressedTestPlain -seed=1 -runs=1000000

compiler-rt/test/lit.common.cfg.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,8 @@ def push_dynamic_library_lookup_path(config, new_path):
312312

313313
if config.have_zlib:
314314
config.available_features.add("zlib")
315+
config.substitutions.append(("%zlib_include_dir", config.zlib_include_dir))
316+
config.substitutions.append(("%zlib_library", config.zlib_library))
315317

316318
if config.have_internal_symbolizer:
317319
config.available_features.add("internal_symbolizer")

compiler-rt/test/lit.common.configured.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ else:
7171

7272
set_default("have_internal_symbolizer", @COMPILER_RT_ENABLE_INTERNAL_SYMBOLIZER_PYBOOL@)
7373
set_default("have_zlib", @ZLIB_FOUND_PYBOOL@)
74+
set_default("zlib_include_dir", "@ZLIB_INCLUDE_DIR@")
75+
set_default("zlib_library", "@ZLIB_LIBRARY@")
7476
set_default("libcxx_used", "@LLVM_LIBCXX_USED@")
7577

7678
# LLVM tools dir can be passed in lit parameters, so try to

0 commit comments

Comments
 (0)