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 // The fuzzer must find a string based on dictionary words:
16 static volatile int Zero
= 0;
18 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data
, size_t Size
) {
19 const char *Expected
= "ElvisPresley";
20 if (Size
< strlen(Expected
)) return 0;
22 for (size_t i
= 0; Expected
[i
]; i
++)
23 if (Expected
[i
] + Zero
== Data
[i
])
25 if (Match
== strlen(Expected
)) {
26 std::cout
<< "BINGO; Found the target, exiting\n" << std::flush
;