[lib/Fuzzer] add a fuzzer test for memcmp (does not work yet)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236656 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Kostya Serebryany 2015-05-06 22:36:00 +00:00
parent ea89afbb84
commit b350776f03
2 changed files with 9 additions and 0 deletions

View File

@ -16,6 +16,7 @@ set(Tests
)
set(DFSanTests
DFSanMemcmpTest
DFSanSimpleCmpTest
)

View File

@ -0,0 +1,8 @@
// Simple test for a fuzzer. The fuzzer must find a particular string.
#include <cstring>
#include <cstdint>
extern "C" void LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
if (Size >= 10 && memcmp(Data, "0123456789", 10) == 0)
__builtin_trap();
}