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. The fuzzer must find the deep recursion.
6 // To generate a crashy input:
7 // for((i=0;i<110;i++)); do echo -n ABCDEFGHIJ >> INPUT; done
12 static volatile int Sink
;
14 void Recursive(const uint8_t *Data
, size_t Size
, int Depth
) {
15 if (Depth
> 1000) abort();
17 if (*Data
== ('A' + Depth
% 10))
18 Recursive(Data
+ 1, Size
- 1, Depth
+ 1);
22 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data
, size_t Size
) {
23 Recursive(Data
, Size
, 0);