1c5f01b2fSopenharmony_ci// This file is distributed under the University of Illinois Open Source
2c5f01b2fSopenharmony_ci// License. See LICENSE.TXT for details.
3c5f01b2fSopenharmony_ci
4c5f01b2fSopenharmony_ci// Test for a fuzzer: must find the case where a particular basic block is
5c5f01b2fSopenharmony_ci// executed many times.
6c5f01b2fSopenharmony_ci#include <iostream>
7c5f01b2fSopenharmony_ci
8c5f01b2fSopenharmony_ciextern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
9c5f01b2fSopenharmony_ci  int Num = 0;
10c5f01b2fSopenharmony_ci  for (size_t i = 0; i < Size; i++)
11c5f01b2fSopenharmony_ci    if (Data[i] == 'A' + i)
12c5f01b2fSopenharmony_ci      Num++;
13c5f01b2fSopenharmony_ci  if (Num >= 4) {
14c5f01b2fSopenharmony_ci    std::cerr <<  "BINGO!\n";
15c5f01b2fSopenharmony_ci    exit(1);
16c5f01b2fSopenharmony_ci  }
17c5f01b2fSopenharmony_ci  return 0;
18c5f01b2fSopenharmony_ci}
19