LLVM  4.0.0
ThreadedTest.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 not crash.
5 #include <assert.h>
6 #include <cstdint>
7 #include <cstddef>
8 #include <cstring>
9 #include <thread>
10 
11 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
12  if (Size < 8) return 0;
13  assert(Data);
14  auto C = [&] {
15  size_t Res = 0;
16  for (size_t i = 0; i < Size / 2; i++)
17  Res += memcmp(Data, Data + Size / 2, 4);
18  return Res;
19  };
22  for (auto &X : T)
23  X.join();
24  return 0;
25 }
26 
size_t i
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
std::thread thread
Definition: thread.h:41