1 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
2 // See https://llvm.org/LICENSE.txt for license information.
3 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5 // Test that fuzzer we can reload artifacts with any bytes inside.
12 extern "C" size_t LLVMFuzzerCustomMutator(uint8_t *Data
, size_t Size
,
13 size_t MaxSize
, unsigned int Seed
) {
15 std::generate(Data
, Data
+ MaxSize
, std::rand
);
19 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data
, size_t Size
) {
20 if (Size
> 5000 && std::set
<uint8_t>(Data
, Data
+ Size
).size() > 255 &&
21 (uint8_t)std::accumulate(Data
, Data
+ Size
, uint8_t(Size
)) == 0)