blob: 26cdc8f17adf348b754be83b90ddc162e3be984c [file] [log] [blame]
George Karpenkov10ab2ac2017-08-21 23:25:50 +00001// This file is distributed under the University of Illinois Open Source
2// License. See LICENSE.TXT for details.
3
4// Crash on the N-th execution.
5#include <cstddef>
6#include <cstdint>
7#include <iostream>
8#include <ostream>
9
10static int Counter;
11
12extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
13 if (Counter++ == 1000) {
14 std::cout << "BINGO; Found the target, exiting\n" << std::flush;
15 exit(1);
16 }
17 return 0;
18}
19