mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 20:30:14 +01:00
This does some more work to the run_clang_tidy.py wrapper script, and runs an example pass. "again" because it's really the proto fuzzer changes that broke it, it had been working before. "mostly" because there's still an issue within the proto fuzzer that it can't find "port/protobuf.h", i.e. https://github.com/google/libprotobuf-mutator/tree/master/port, but I'm still hesitant to add an include path there.
19 lines
640 B
C++
19 lines
640 B
C++
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
#include <libfuzzer/libfuzzer_macro.h>
|
|
|
|
#include "common/error.h"
|
|
#include "explorer/fuzzing/fuzzer_util.h"
|
|
#include "llvm/Support/raw_ostream.h"
|
|
|
|
DEFINE_TEXT_PROTO_FUZZER(const Carbon::Fuzzing::Carbon& input) {
|
|
const auto result = Carbon::ParseAndExecute(input.compilation_unit());
|
|
if (result.ok()) {
|
|
llvm::outs() << "Executed OK: " << *result << "\n";
|
|
} else {
|
|
llvm::errs() << "Execution failed: " << result.error() << "\n";
|
|
}
|
|
}
|