[libFuzzer] make LLVMFuzzerTestOneInput (the fuzzer target function) return int inste...
[oota-llvm.git] / lib / Fuzzer / test / SimpleHashTest.cpp
index a541d6813b5dabd46f6a64bdc6f6400b6ac700c6..5bab3fa7f6494e0992bfbe63b2ff208e2cbfade9 100644 (file)
@@ -22,15 +22,16 @@ static uint32_t simple_hash(const uint8_t *Data, size_t Size) {
   return Hash;
 }
 
-extern "C" void LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
   if (Size < 14)
-    return;
+    return 0;
 
   uint32_t Hash = simple_hash(&Data[0], Size - 4);
   uint32_t Want = reinterpret_cast<const uint32_t *>(&Data[Size - 4])[0];
   if (Hash != Want)
-    return;
+    return 0;
   fprintf(stderr, "BINGO; simple_hash defeated: %x == %x\n", (unsigned int)Hash,
           (unsigned int)Want);
   exit(1);
+  return 0;
 }