mirror of
https://github.com/RPCS3/llvm.git
synced 2025-05-22 21:35:57 +00:00

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299177 91177308-0d34-0410-b5e6-96231b3b80d8
19 lines
548 B
C++
19 lines
548 B
C++
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
// Simple test for a fuzzer. The fuzzer must find a particular string.
|
|
#include <cstring>
|
|
#include <cstdint>
|
|
#include <cstdio>
|
|
#include <cstdlib>
|
|
|
|
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
|
char *S = (char*)Data;
|
|
volatile auto Strncmp = &(strncmp); // Make sure strncmp is not inlined.
|
|
if (Size >= 6 && !Strncmp(S, "qwerty", 6)) {
|
|
fprintf(stderr, "BINGO\n");
|
|
exit(1);
|
|
}
|
|
return 0;
|
|
}
|