BUILD 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. # Exceptions. See /LICENSE for license information.
  3. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. load("//bazel/fuzzing:rules.bzl", "cc_fuzz_test")
  5. load("//bazel/testing:lit_test.bzl", "lit_test")
  6. package(default_visibility = ["//visibility:public"])
  7. cc_library(
  8. name = "driver",
  9. srcs = ["driver.cpp"],
  10. hdrs = ["driver.h"],
  11. textual_hdrs = ["flags.def"],
  12. deps = [
  13. "//toolchain/diagnostics:diagnostic_emitter",
  14. "//toolchain/lexer:tokenized_buffer",
  15. "//toolchain/parser:parse_tree",
  16. "//toolchain/source:source_buffer",
  17. "@llvm-project//llvm:Support",
  18. ],
  19. )
  20. cc_test(
  21. name = "driver_test",
  22. size = "small",
  23. srcs = ["driver_test.cpp"],
  24. deps = [
  25. ":driver",
  26. "//toolchain/common:yaml_test_helpers",
  27. "//toolchain/lexer:tokenized_buffer_test_helpers",
  28. "@com_google_googletest//:gtest_main",
  29. "@llvm-project//llvm:Support",
  30. ],
  31. )
  32. cc_fuzz_test(
  33. name = "driver_fuzzer",
  34. size = "small",
  35. srcs = ["driver_fuzzer.cpp"],
  36. corpus = glob(["fuzzer_corpus/*"]),
  37. deps = [
  38. ":driver",
  39. "@llvm-project//llvm:Support",
  40. ],
  41. )
  42. cc_binary(
  43. name = "carbon",
  44. srcs = ["driver_main.cpp"],
  45. deps = [
  46. ":driver",
  47. "@llvm-project//llvm:Support",
  48. ],
  49. )
  50. lit_test(
  51. name = "carbon_lit_test",
  52. data = [
  53. ":carbon",
  54. "@llvm-project//llvm:FileCheck",
  55. "@llvm-project//llvm:not",
  56. ],
  57. test_dir = "testdata",
  58. )