summaryrefslogtreecommitdiff
path: root/lib/Fuzzer/test/SimpleTest.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-12-30 11:46:15 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-12-30 11:46:15 +0000
commitdd58ef019b700900793a1eb48b52123db01b654e (patch)
treefcfbb4df56a744f4ddc6122c50521dd3f1c5e196 /lib/Fuzzer/test/SimpleTest.cpp
parent2fe5752e3a7c345cdb59e869278d36af33c13fa4 (diff)
Notes
Diffstat (limited to 'lib/Fuzzer/test/SimpleTest.cpp')
-rw-r--r--lib/Fuzzer/test/SimpleTest.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Fuzzer/test/SimpleTest.cpp b/lib/Fuzzer/test/SimpleTest.cpp
index a891635a7f14..04225a889f5d 100644
--- a/lib/Fuzzer/test/SimpleTest.cpp
+++ b/lib/Fuzzer/test/SimpleTest.cpp
@@ -1,4 +1,5 @@
// Simple test for a fuzzer. The fuzzer must find the string "Hi!".
+#include <assert.h>
#include <cstdint>
#include <cstdlib>
#include <cstddef>
@@ -6,7 +7,8 @@
static volatile int Sink;
-extern "C" void LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
+ assert(Data);
if (Size > 0 && Data[0] == 'H') {
Sink = 1;
if (Size > 1 && Data[1] == 'i') {
@@ -17,5 +19,6 @@ extern "C" void LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
}
}
}
+ return 0;
}