blob: d2937d004d13c8611b6a6b9cd3f672c72b65a83b [file] [log] [blame]
Chandler Carruth2946cd72019-01-19 08:50:56 +00001// 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 Karpenkov10ab2ac2017-08-21 23:25:50 +00004
5// Contains dummy functions used to avoid dependency on AFL.
6#include <stdint.h>
7#include <stdio.h>
8#include <stdlib.h>
9
10extern "C" void __afl_manual_init() {}
11
12extern "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.
21extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv) {
22 fprintf(stderr, "LLVMFuzzerInitialize called\n");
23 return 0;
24}
25
26extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
27 fprintf(stderr, "LLVMFuzzerTestOneInput called; Size = %zd\n", Size);
28 return 0;
29}