mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-13 14:46:53 +00:00
d7ee221d4d
The adapter automates converting sequence of bytes into arbitrary arguments. Differential Revision: http://reviews.llvm.org/D17829 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262673 91177308-0d34-0410-b5e6-96231b3b80d8
22 lines
489 B
C++
22 lines
489 B
C++
// Simple test for a fuzzer Fn adapter. The fuzzer has to find two non-empty
|
|
// vectors with the same content.
|
|
|
|
#include <iostream>
|
|
#include <vector>
|
|
|
|
#include "FuzzerFnAdapter.h"
|
|
|
|
static void TestFn(std::vector<uint8_t> V1, std::vector<uint8_t> V2) {
|
|
if (V1.size() > 0 && V1 == V2) {
|
|
std::cout << "BINGO; Found the target, exiting\n";
|
|
exit(0);
|
|
}
|
|
}
|
|
|
|
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
|
fuzzer::Adapt(TestFn, Data, Size);
|
|
return 0;
|
|
}
|
|
|
|
|