Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame^] | 1 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 2 | // See https://llvm.org/LICENSE.txt for license information. |
| 3 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
George Karpenkov | 10ab2ac | 2017-08-21 23:25:50 +0000 | [diff] [blame] | 4 | |
| 5 | // Contains dummy functions used to avoid dependency on AFL. |
| 6 | #include <stdint.h> |
| 7 | #include <stdio.h> |
| 8 | #include <stdlib.h> |
| 9 | |
| 10 | extern "C" void __afl_manual_init() {} |
| 11 | |
| 12 | extern "C" int __afl_persistent_loop(unsigned int N) { |
| 13 | static int Count = N; |
| 14 | fprintf(stderr, "__afl_persistent_loop calle, Count = %d\n", Count); |
| 15 | if (Count--) return 1; |
| 16 | return 0; |
| 17 | } |
| 18 | |
| 19 | // This declaration exists to prevent the Darwin linker |
| 20 | // from complaining about this being a missing weak symbol. |
| 21 | extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv) { |
| 22 | fprintf(stderr, "LLVMFuzzerInitialize called\n"); |
| 23 | return 0; |
| 24 | } |
| 25 | |
| 26 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { |
| 27 | fprintf(stderr, "LLVMFuzzerTestOneInput called; Size = %zd\n", Size); |
| 28 | return 0; |
| 29 | } |