brintos

brintos / llvm-project-archived public Read only

0
0
Text · 936 B · 40fb07d Raw
27 lines · cpp
1//===-- ClangObjectiveCFuzzer.cpp - Fuzz Clang ----------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8///9/// \file10/// This file implements a function that runs Clang on a single Objective-C11///   input. This function is then linked into the Fuzzer library.12///13//===----------------------------------------------------------------------===//14 15#include "handle-cxx/handle_cxx.h"16 17using namespace clang_fuzzer;18 19extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv) { return 0; }20 21extern "C" int LLVMFuzzerTestOneInput(uint8_t *data, size_t size) {22  std::string s(reinterpret_cast<const char *>(data), size);23  HandleCXX(s, "./test.m", {"-O2"});24  return 0;25}26 27