Files
clang-p2996/libc/fuzzing/stdlib/CMakeLists.txt
Michael Jones f1990feb35 [libc] add fuzz target for strtointeger functions
The string to integer conversion functions are well suited to
differential fuzzing, and this patch adds a target to enable just that.
It also fixes a bug in the fuzzing comparison logic and changes atoi
slightly to match the behavior described in the C standard.

Reviewed By: sivachandra, lntue

Differential Revision: https://reviews.llvm.org/D140178
2022-12-20 10:48:34 -08:00

52 lines
980 B
CMake

add_libc_fuzzer(
qsort_fuzz
SRCS
qsort_fuzz.cpp
DEPENDS
libc.src.stdlib.qsort
)
add_libc_fuzzer(
atof_differential_fuzz
SRCS
atof_differential_fuzz.cpp
HDRS
StringParserOutputDiff.h
DEPENDS
libc.src.stdlib.atof
)
add_libc_fuzzer(
strtointeger_differential_fuzz
SRCS
strtointeger_differential_fuzz.cpp
HDRS
StringParserOutputDiff.h
DEPENDS
libc.src.stdlib.atoi
libc.src.stdlib.atol
libc.src.stdlib.atoll
libc.src.stdlib.strtol
libc.src.stdlib.strtoll
libc.src.stdlib.strtoul
libc.src.stdlib.strtoull
)
add_libc_fuzzer(
strtointeger_differential_fuzz_cleaner
SRCS
strtointeger_differential_fuzz.cpp
HDRS
StringParserOutputDiff.h
DEPENDS
libc.src.stdlib.atoi
libc.src.stdlib.atol
libc.src.stdlib.atoll
libc.src.stdlib.strtol
libc.src.stdlib.strtoll
libc.src.stdlib.strtoul
libc.src.stdlib.strtoull
COMPILE_OPTIONS
-DLLVM_LIBC_FUZZ_ATOI_CLEANER_INPUT
)