LLVM
4.0.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
llvm.src
lib
Fuzzer
test
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
};
19
std::thread
T
[] = {
std::thread
(
C
),
std::thread
(
C
),
std::thread
(
C
),
20
std::thread
(
C
),
std::thread
(
C
),
std::thread
(
C
)};
21
for
(
auto
&
X
: T)
22
X
.join();
23
return
0;
24
}
25
X
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")
T
LLVMFuzzerTestOneInput
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
Definition:
SimpleThreadedTest.cpp:12
C
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
llvm::thread
std::thread thread
Definition:
thread.h:41
Generated on Wed Mar 8 2017 17:26:05 for LLVM by
1.8.6