libfuzzer.h 890 B

12345678910111213141516171819202122
  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. #ifndef CARBON_TESTING_FUZZING_LIBFUZZER_H_
  5. #define CARBON_TESTING_FUZZING_LIBFUZZER_H_
  6. #include <cstddef>
  7. namespace Carbon::Testing {
  8. // Declaration for the LLVM libfuzzer API that we implement in our fuzz tests.
  9. // This is useful to ensure we get the API correct and avoid warnings about
  10. // defining an undeclared extern function due to a Clang warning bug:
  11. // https://github.com/llvm/llvm-project/issues/94138
  12. // NOLINTNEXTLINE: Match the documented fuzzer entry point declaration style.
  13. extern "C" int LLVMFuzzerTestOneInput(const unsigned char* data,
  14. std::size_t size);
  15. } // namespace Carbon::Testing
  16. #endif // CARBON_TESTING_FUZZING_LIBFUZZER_H_