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 // Simple test for a fuzzer.
6 // Needs to find a string "FUZZxxxxxxxxxxxxMxxE", where 'x' is any byte.
13 extern "C" bool Func1(const uint8_t *Data
, size_t Size
);
14 extern "C" bool Func2(const uint8_t *Data
, size_t Size
);
16 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data
, size_t Size
) {
23 && Func2(Data
, Size
)) {
24 fprintf(stderr
, "BINGO\n");
31 __attribute__((noinline
))
32 bool Func1(const uint8_t *Data
, size_t Size
) {
33 // assumes Size >= 5, doesn't check it.
34 return Data
[16] == 'M';
38 __attribute__((noinline
))
39 bool Func2(const uint8_t *Data
, size_t Size
) {
40 return Size
>= 20 && Data
[19] == 'E';