aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Fuzzer/test/CounterTest.cpp
blob: 332ccfe7b029cd62b6b30bef39014fb567a0b64f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Test for a fuzzer: must find the case where a particular basic block is
// executed many times.
#include <iostream>

extern "C" void TestOneInput(const uint8_t *Data, size_t Size) {
  int Num = 0;
  for (size_t i = 0; i < Size; i++)
    if (Data[i] == 'A' + i)
      Num++;
  if (Num >= 4) {
    std::cerr <<  "BINGO!\n";
    exit(1);
  }
}