LLVM  4.0.0
SimpleThreadedTest.cpp
Go to the documentation of this file.
1 // This file is distributed under the University of Illinois Open Source
2 // License. See LICENSE.TXT for details.
3 
4 // Threaded test for a fuzzer. The fuzzer should find "H"
5 #include <assert.h>
6 #include <cstdint>
7 #include <cstddef>
8 #include <cstring>
9 #include <iostream>
10 #include <thread>
11 
12 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
13  auto C = [&] {
14  if (Size >= 2 && Data[0] == 'H') {
15  std::cout << "BINGO; Found the target, exiting\n";
16  abort();
17  }
18  };
21  for (auto &X : T)
22  X.join();
23  return 0;
24 }
25 
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
std::thread thread
Definition: thread.h:41