Kostya Serebryany | be5e0ed | 2015-03-03 23:27:02 +0000 | [diff] [blame] | 1 | // Test for a fuzzer: must find the case where a particular basic block is |
| 2 | // executed many times. |
| 3 | #include <iostream> |
| 4 | |
Kostya Serebryany | 20bb5e7 | 2015-10-02 23:34:06 +0000 | [diff] [blame] | 5 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { |
Kostya Serebryany | be5e0ed | 2015-03-03 23:27:02 +0000 | [diff] [blame] | 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 | } |
Kostya Serebryany | 20bb5e7 | 2015-10-02 23:34:06 +0000 | [diff] [blame] | 14 | return 0; |
Kostya Serebryany | be5e0ed | 2015-03-03 23:27:02 +0000 | [diff] [blame] | 15 | } |