LLVM
5.0.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
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 <cstddef>
7
#include <cstdint>
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
llvm::Data
Definition:
SIMachineScheduler.h:59
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
llvm::AMDGPU::CodeObject::Kernel::Arg::Key::Size
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
Definition:
AMDGPUCodeObjectMetadata.h:154
C
#define C
Definition:
LargeTest.cpp:25
llvm::thread
std::thread thread
Definition:
thread.h:27
Generated on Fri Sep 1 2017 14:13:37 for LLVM by
1.8.6