mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-30 00:32:53 +00:00
74041145bc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292646 91177308-0d34-0410-b5e6-96231b3b80d8
18 lines
596 B
C++
18 lines
596 B
C++
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
#include <stdio.h>
|
|
|
|
// Test for libFuzzer's "equivalence" fuzzing, part A.
|
|
extern "C" void LLVMFuzzerAnnounceOutput(const uint8_t *Data, size_t Size);
|
|
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
|
// fprintf(stderr, "A %zd\n", Size);
|
|
uint8_t Result[50];
|
|
if (Size > 50) Size = 50;
|
|
for (size_t i = 0; i < Size; i++)
|
|
Result[Size - i - 1] = Data[i];
|
|
LLVMFuzzerAnnounceOutput(Result, Size);
|
|
return 0;
|
|
}
|