[Dexter][NFC] Add Missing Commands to Commands.md Contents
[llvm-project.git] / libcxx / fuzzing / fuzz_test_template.cpp
blobba44eef7891d244d20d2cc2ad4289c827a0dcff5
1 //===------------------------- fuzz_test.cpp ------------------------------===//
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-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "fuzzing/fuzzing.h"
10 #ifdef NDEBUG
11 #undef NDEBUG
12 #endif
13 #include <cassert>
15 #ifndef TEST_FUNCTION
16 #error TEST_FUNCTION must be defined
17 #endif
19 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
20 int result = fuzzing::TEST_FUNCTION(data, size);
21 assert(result == 0); return 0;