[Fuzzer] Flush std::cout before aborting in CxxStringEqTest
authorReid Kleckner <rnk@google.com>
Mon, 3 Apr 2017 23:00:25 +0000 (23:00 +0000)
committerReid Kleckner <rnk@google.com>
Mon, 3 Apr 2017 23:00:25 +0000 (23:00 +0000)
On Windows, abort() does not appear to flush std::cout. Should fix red
sanitizer-windows bot.

llvm-svn: 299398

llvm/lib/Fuzzer/test/CxxStringEqTest.cpp

index 9005ab8..e0e23c9 100644 (file)
@@ -17,6 +17,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
   Sink = Str == "123456";   // Try to confuse the fuzzer
   if (Eq) {
     std::cout << "BINGO; Found the target, exiting\n";
+    std::cout.flush();
     abort();
   }
   return 0;