summaryrefslogtreecommitdiff
path: root/lib/Fuzzer/test/SimpleTest.cpp
diff options
context:
space:
mode:
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;
}