[libFuzzer] make sure that 2-byte arguments of switch() are handled properly
[oota-llvm.git] / lib / Fuzzer / test / CounterTest.cpp
1 // Test for a fuzzer: must find the case where a particular basic block is
2 // executed many times.
3 #include <iostream>
4
5 extern "C" void LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
6   int Num = 0;
7   for (size_t i = 0; i < Size; i++)
8     if (Data[i] == 'A' + i)
9       Num++;
10   if (Num >= 4) {
11     std::cerr <<  "BINGO!\n";
12     exit(1);
13   }
14 }