George Karpenkov | 10ab2ac | 2017-08-21 23:25:50 +0000 | [diff] [blame] | 1 | // This file is distributed under the University of Illinois Open Source |
| 2 | // License. See LICENSE.TXT for details. |
| 3 | |
| 4 | // Simple test for a fuzzer: find the interesting argument for div. |
| 5 | #include <assert.h> |
| 6 | #include <cstddef> |
| 7 | #include <cstdint> |
| 8 | #include <cstring> |
| 9 | #include <iostream> |
| 10 | |
| 11 | static volatile int Sink; |
| 12 | |
| 13 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { |
| 14 | if (Size < 4) return 0; |
| 15 | int a; |
| 16 | memcpy(&a, Data, 4); |
| 17 | Sink = 12345678 / (987654 - a); |
| 18 | return 0; |
| 19 | } |
| 20 | |