Skip to content

Commit

Permalink
[Fuzzer] Passthrough zlib CMake paths into the test (llvm#107926)
Browse files Browse the repository at this point in the history
We shouldn't assume that we're using system zlib installation.
  • Loading branch information
petrhosek authored Sep 10, 2024
1 parent 761bf33 commit eb0e4b1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler-rt/test/fuzzer/compressed.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ REQUIRES: zlib
# unsupported by this test.
UNSUPPORTED: i386, target=arm{{.*}}
# Custom mutator should find this bug, w/o custom -- no chance.
RUN: %cpp_compiler %S/CompressedTest.cpp -o %t-CompressedTestCustom -DCUSTOM_MUTATOR -lz
RUN: %cpp_compiler %S/CompressedTest.cpp -o %t-CompressedTestPlain -lz
RUN: %cpp_compiler %S/CompressedTest.cpp -o %t-CompressedTestCustom -DCUSTOM_MUTATOR -I%zlib_include_dir %zlib_library
RUN: %cpp_compiler %S/CompressedTest.cpp -o %t-CompressedTestPlain -I%zlib_include_dir %zlib_library
RUN: not %run %t-CompressedTestCustom -seed=1 -runs=1000000
RUN: %run %t-CompressedTestPlain -seed=1 -runs=1000000
2 changes: 2 additions & 0 deletions compiler-rt/test/lit.common.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ def push_dynamic_library_lookup_path(config, new_path):

if config.have_zlib:
config.available_features.add("zlib")
config.substitutions.append(("%zlib_include_dir", config.zlib_include_dir))
config.substitutions.append(("%zlib_library", config.zlib_library))

if config.have_internal_symbolizer:
config.available_features.add("internal_symbolizer")
Expand Down
2 changes: 2 additions & 0 deletions compiler-rt/test/lit.common.configured.in
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ else:

set_default("have_internal_symbolizer", @COMPILER_RT_ENABLE_INTERNAL_SYMBOLIZER_PYBOOL@)
set_default("have_zlib", @ZLIB_FOUND_PYBOOL@)
set_default("zlib_include_dir", "@ZLIB_INCLUDE_DIR@")
set_default("zlib_library", "@ZLIB_LIBRARY@")
set_default("libcxx_used", "@LLVM_LIBCXX_USED@")

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

0 comments on commit eb0e4b1

Please sign in to comment.