-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add libfuzzer compatible fuzz harness (#7512)
- Loading branch information
1 parent
244e72c
commit 044a8cf
Showing
4 changed files
with
117 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
tests(GROUPS fuzz | ||
SOURCES | ||
simplify.cpp | ||
) | ||
|
||
|
||
# By default we are going to use the libfuzzer engine. However if | ||
# LIB_FUZZING_ENGINE is declared you can override the fuzzing engine to one of; | ||
# - Centipede | ||
# - Hongfuzz | ||
# - AFL++ | ||
# - etc. | ||
set(LIB_FUZZING_ENGINE "$ENV{LIB_FUZZING_ENGINE}" | ||
CACHE STRING "Compiler flags necessary to link the fuzzing engine of choice e.g. libfuzzer, afl etc.") | ||
|
||
target_link_libraries(fuzz_simplify PRIVATE Halide::Halide) | ||
|
||
# Allow OSS-fuzz to manage flags directly | ||
if (LIB_FUZZING_ENGINE) | ||
target_link_libraries(fuzz_simplify PRIVATE "${LIB_FUZZING_ENGINE}") | ||
else () | ||
# By default just build with address-sanitizers/libfuzzer for local testing | ||
target_compile_options(fuzz_simplify PRIVATE -fsanitize=fuzzer-no-link,address) | ||
target_link_options(fuzz_simplify PRIVATE -fsanitize=fuzzer,address) | ||
endif () | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters