annotate clang/tools/clang-fuzzer/ExampleClangLLVMProtoFuzzer.cpp @ 209:dd44ba33042e

merged...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:36:09 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 //===-- ExampleClangLLVMProtoFuzzer.cpp - Fuzz Clang ----------------------===//
anatofuz
parents:
diff changeset
2 //
anatofuz
parents:
diff changeset
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
anatofuz
parents:
diff changeset
4 // See https://llvm.org/LICENSE.txt for license information.
anatofuz
parents:
diff changeset
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
anatofuz
parents:
diff changeset
6 //
anatofuz
parents:
diff changeset
7 //===----------------------------------------------------------------------===//
anatofuz
parents:
diff changeset
8 ///
anatofuz
parents:
diff changeset
9 /// \file
anatofuz
parents:
diff changeset
10 /// This file implements a function that compiles a single LLVM IR string as
anatofuz
parents:
diff changeset
11 /// input and uses libprotobuf-mutator to find new inputs. This function is
anatofuz
parents:
diff changeset
12 /// then linked into the Fuzzer library.
anatofuz
parents:
diff changeset
13 ///
anatofuz
parents:
diff changeset
14 //===----------------------------------------------------------------------===//
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 #include "cxx_loop_proto.pb.h"
anatofuz
parents:
diff changeset
17 #include "fuzzer-initialize/fuzzer_initialize.h"
anatofuz
parents:
diff changeset
18 #include "handle-llvm/handle_llvm.h"
anatofuz
parents:
diff changeset
19 #include "proto-to-llvm/loop_proto_to_llvm.h"
anatofuz
parents:
diff changeset
20 #include "src/libfuzzer/libfuzzer_macro.h"
anatofuz
parents:
diff changeset
21
anatofuz
parents:
diff changeset
22 using namespace clang_fuzzer;
anatofuz
parents:
diff changeset
23
anatofuz
parents:
diff changeset
24 DEFINE_BINARY_PROTO_FUZZER(const LoopFunction &input) {
anatofuz
parents:
diff changeset
25 auto S = LoopFunctionToLLVMString(input);
anatofuz
parents:
diff changeset
26 HandleLLVM(S, GetCLArgs());
anatofuz
parents:
diff changeset
27 }