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
8 // Test for libFuzzer's "equivalence" fuzzing, part B.
9 extern "C" void LLVMFuzzerAnnounceOutput(const uint8_t *Data
, size_t Size
);
10 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data
, size_t Size
) {
11 // fprintf(stderr, "B %zd\n", Size);
13 if (Size
> 50) Size
= 50;
14 for (size_t i
= 0; i
< Size
; i
++)
15 Result
[Size
- i
- 1] = Data
[i
];
17 // Be a bit different from EquivalenceATest
18 if (Size
> 10 && Data
[5] == 'B' && Data
[6] == 'C' && Data
[7] == 'D') {
21 fprintf(stderr
, "ZZZZZZZ\n");
26 LLVMFuzzerAnnounceOutput(Result
, Size
);