1*65132e21SKostya Serebryany // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
2*65132e21SKostya Serebryany // See https://llvm.org/LICENSE.txt for license information.
3*65132e21SKostya Serebryany // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4*65132e21SKostya Serebryany 
5*65132e21SKostya Serebryany // Simple test for a fuzzer. The fuzzer must find the string "Hi" and cause an
6*65132e21SKostya Serebryany // integer overflow.
7*65132e21SKostya Serebryany #include <cstddef>
8*65132e21SKostya Serebryany #include <cstdint>
9*65132e21SKostya Serebryany 
10*65132e21SKostya Serebryany static int Val = 1 << 30;
11*65132e21SKostya Serebryany 
LLVMFuzzerTestOneInput(const uint8_t * Data,size_t Size)12*65132e21SKostya Serebryany extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
13*65132e21SKostya Serebryany   if (Size >= 2 && Data[0] == 'H' && Data[1] == 'i')
14*65132e21SKostya Serebryany     Val += Val;
15*65132e21SKostya Serebryany   return 0;
16*65132e21SKostya Serebryany }
17*65132e21SKostya Serebryany 
18