blob: b949adc7de159a773468367eeb62af092d5f9a00 [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// Contains dummy functions used to avoid dependency on AFL.
5#include <stdint.h>
6#include <stdio.h>
7#include <stdlib.h>
8
9extern "C" void __afl_manual_init() {}
10
11extern "C" int __afl_persistent_loop(unsigned int N) {
12 static int Count = N;
13 fprintf(stderr, "__afl_persistent_loop calle, Count = %d\n", Count);
14 if (Count--) return 1;
15 return 0;
16}
17
18// This declaration exists to prevent the Darwin linker
19// from complaining about this being a missing weak symbol.
20extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv) {
21 fprintf(stderr, "LLVMFuzzerInitialize called\n");
22 return 0;
23}
24
25extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
26 fprintf(stderr, "LLVMFuzzerTestOneInput called; Size = %zd\n", Size);
27 return 0;
28}