[libFuzzer] make LLVMFuzzerTestOneInput (the fuzzer target function) return int inste...
[oota-llvm.git] / lib / Fuzzer / test / SwitchTest.cpp
index 9f921fb6098628fc20363935c288836b19e8c281..5de7fff745257c4e38db36519cb904dfc3c504db 100644 (file)
@@ -42,7 +42,7 @@ bool ShortSwitch(const uint8_t *Data, size_t Size) {
   return false;
 }
 
   return false;
 }
 
-extern "C" void LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
   if (Size >= 4  && Switch<int>(Data, Size) &&
       Size >= 12 && Switch<uint64_t>(Data + 4, Size - 4) &&
       Size >= 14 && ShortSwitch(Data + 12, 2)
   if (Size >= 4  && Switch<int>(Data, Size) &&
       Size >= 12 && Switch<uint64_t>(Data + 4, Size - 4) &&
       Size >= 14 && ShortSwitch(Data + 12, 2)
@@ -50,5 +50,6 @@ extern "C" void LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
     fprintf(stderr, "BINGO; Found the target, exiting\n");
     exit(1);
   }
     fprintf(stderr, "BINGO; Found the target, exiting\n");
     exit(1);
   }
+  return 0;
 }
 
 }