| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- # 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
- load("//bazel/fuzzing:rules.bzl", "cc_fuzz_test")
- cc_library(
- name = "ast_to_proto_lib",
- srcs = ["ast_to_proto.cpp"],
- hdrs = ["ast_to_proto.h"],
- deps = [
- "//common/fuzzing:carbon_cc_proto",
- "//executable_semantics/ast",
- "//executable_semantics/ast:declaration",
- "//executable_semantics/ast:expression",
- "@llvm-project//llvm:Support",
- ],
- )
- cc_library(
- name = "fuzzer_util",
- srcs = ["fuzzer_util.cpp"],
- hdrs = ["fuzzer_util.h"],
- deps = [
- "//common:check",
- "//common/fuzzing:carbon_cc_proto",
- "//common/fuzzing:proto_to_carbon_lib",
- "@llvm-project//llvm:Support",
- ],
- )
- cc_test(
- name = "ast_to_proto_test",
- srcs = ["ast_to_proto_test.cpp"],
- args = [
- "$(locations //executable_semantics:standard_libraries)",
- "$(locations //executable_semantics/testdata:carbon_files)",
- ],
- data = [
- "//executable_semantics:standard_libraries",
- "//executable_semantics/testdata:carbon_files",
- ],
- deps = [
- ":ast_to_proto_lib",
- "//common/fuzzing:carbon_cc_proto",
- "//executable_semantics/syntax",
- "@com_google_googletest//:gtest",
- "@com_google_protobuf//:protobuf_headers",
- "@llvm-project//llvm:Support",
- ],
- )
- cc_binary(
- name = "fuzzverter",
- srcs = ["fuzzverter.cpp"],
- deps = [
- ":ast_to_proto_lib",
- ":fuzzer_util",
- "//common:error",
- "//common/fuzzing:carbon_cc_proto",
- "//executable_semantics/common:error",
- "//executable_semantics/common:nonnull",
- "//executable_semantics/syntax",
- "@com_google_protobuf//:protobuf_headers",
- "@llvm-project//llvm:Support",
- ],
- )
- cc_test(
- name = "proto_to_carbon_test",
- srcs = ["proto_to_carbon_test.cpp"],
- args = [
- "$(locations //executable_semantics:standard_libraries)",
- "$(locations //executable_semantics/testdata:carbon_files)",
- ],
- data = [
- "//executable_semantics:standard_libraries",
- "//executable_semantics/testdata:carbon_files",
- ],
- deps = [
- ":ast_to_proto_lib",
- "//common/fuzzing:carbon_cc_proto",
- "//common/fuzzing:proto_to_carbon_lib",
- "//executable_semantics/syntax",
- "@com_google_googletest//:gtest",
- "@com_google_protobuf//:protobuf_headers",
- "@llvm-project//llvm:Support",
- ],
- )
- # Needs `--config=proto-fuzzer` for `bazel build` / `bazel test`.
- cc_fuzz_test(
- name = "executable_semantics_fuzzer",
- size = "small",
- srcs = ["executable_semantics_fuzzer.cpp"],
- corpus = glob(["fuzzer_corpus/**"]),
- tags = ["manual"],
- deps = [
- ":fuzzer_util",
- "//common/fuzzing:carbon_cc_proto",
- "//executable_semantics/interpreter:exec_program",
- "//executable_semantics/syntax",
- "//executable_semantics/syntax:prelude",
- "@com_google_libprotobuf_mutator//:libprotobuf_mutator",
- "@com_google_protobuf//:protobuf_headers",
- "@llvm-project//llvm:Support",
- ],
- )
|