1 //===-- ClangFuzzer.cpp - Fuzz Clang --------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 /// This file implements a function that runs Clang on a single
12 /// input. This function is then linked into the Fuzzer library.
14 //===----------------------------------------------------------------------===//
16 #include "handle-cxx/handle_cxx.h"
18 using namespace clang_fuzzer;
20 extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv) { return 0; }
22 extern "C" int LLVMFuzzerTestOneInput(uint8_t *data, size_t size) {
23 std::string s((const char *)data, size);
24 HandleCXX(s, {"-O2"});