[lib/Fuzzer] use -fsanitize-coverage=trace-cmp when building LLVM with LLVM_USE_SANIT...
[oota-llvm.git] / lib / Fuzzer / test / dfsan / DFSanMemcmpTest.cpp
1 // Simple test for a fuzzer. The fuzzer must find a particular string.
2 #include <cstring>
3 #include <cstdint>
4 #include <cstdio>
5 #include <cstdlib>
6
7 extern "C" void LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
8   if (Size >= 8 && memcmp(Data, "01234567", 8) == 0) {
9     fprintf(stderr, "BINGO\n");
10     exit(1);
11   }
12 }