OSDN Git Service

63f6960f4e909858215f5c71b94cbfeebab79164
[android-x86/external-llvm.git] / lib / Fuzzer / test / DivTest.cpp
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 <cstdint>
7 #include <cstring>
8 #include <cstddef>
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