summaryrefslogtreecommitdiff
path: root/testing/hstox/fuzz_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'testing/hstox/fuzz_main.c')
-rw-r--r--testing/hstox/fuzz_main.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/testing/hstox/fuzz_main.c b/testing/hstox/fuzz_main.c
new file mode 100644
index 00000000..ff66a166
--- /dev/null
+++ b/testing/hstox/fuzz_main.c
@@ -0,0 +1,23 @@
1#include "driver.h"
2
3#include <unistd.h>
4
5// The number of afl iterations before terminating the process and starting a
6// new one.
7// See https://github.com/mcarpenter/afl/blob/master/llvm_mode/README.llvm.
8#define ITERATIONS 1000
9
10#ifdef __GLASGOW_HASKELL__
11#define main fuzz_main
12#endif
13int main(int argc, char **argv)
14{
15 struct settings cfg = {false, false};
16#ifdef __AFL_LOOP
17
18 while (__AFL_LOOP(ITERATIONS))
19#endif
20 communicate(cfg, STDIN_FILENO, STDOUT_FILENO);
21
22 return 0;
23}