blob: 23123277c3a4c9917f9f6f5712e2150529a24935 [file] [log] [blame]
Matt Morehousef051f5d2017-08-08 20:15:04 +00001//===-- ExampleClangProtoFuzzer.cpp - Fuzz Clang --------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9///
10/// \file
11/// \brief This file implements a function that runs Clang on a single
12/// input and uses libprotobuf-mutator to find new inputs. This function is
13/// then linked into the Fuzzer library.
14///
15//===----------------------------------------------------------------------===//
16
17#include "cxx_proto.pb.h"
18#include "handle-cxx/handle_cxx.h"
19#include "proto-to-cxx/proto_to_cxx.h"
20
21#include "src/libfuzzer/libfuzzer_macro.h"
22
23using namespace clang_fuzzer;
24
25DEFINE_BINARY_PROTO_FUZZER(const Function& input) {
26 auto S = FunctionToString(input);
27 HandleCXX(S, {"-O2"});
28}