annotate clang/tools/clang-fuzzer/ExampleClangLoopProtoFuzzer.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 //===-- ExampleClangLoopProtoFuzzer.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 runs Clang on a single
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. This file differs from
anatofuz
parents:
diff changeset
13 /// ExampleClangProtoFuzzer in that it uses a different protobuf that includes
anatofuz
parents:
diff changeset
14 /// C++ code with a single for loop.
anatofuz
parents:
diff changeset
15 ///
anatofuz
parents:
diff changeset
16 //===----------------------------------------------------------------------===//
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 #include "cxx_loop_proto.pb.h"
anatofuz
parents:
diff changeset
19 #include "fuzzer-initialize/fuzzer_initialize.h"
anatofuz
parents:
diff changeset
20 #include "handle-cxx/handle_cxx.h"
anatofuz
parents:
diff changeset
21 #include "proto-to-cxx/proto_to_cxx.h"
anatofuz
parents:
diff changeset
22 #include "src/libfuzzer/libfuzzer_macro.h"
anatofuz
parents:
diff changeset
23
anatofuz
parents:
diff changeset
24 using namespace clang_fuzzer;
anatofuz
parents:
diff changeset
25
anatofuz
parents:
diff changeset
26 DEFINE_BINARY_PROTO_FUZZER(const LoopFunction &input) {
anatofuz
parents:
diff changeset
27 auto S = LoopFunctionToString(input);
anatofuz
parents:
diff changeset
28 HandleCXX(S, GetCLArgs());
anatofuz
parents:
diff changeset
29 }