george.karpenkov | 29efa6d | 2017-08-21 23:25:50 +0000 | [diff] [blame] | 1 | //===- FuzzerMain.cpp - main() function and flags -------------------------===// |
| 2 | // |
chandlerc | 4028449 | 2019-01-19 08:50:56 +0000 | [diff] [blame] | 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 |
george.karpenkov | 29efa6d | 2017-08-21 23:25:50 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // main() and flags. |
| 9 | //===----------------------------------------------------------------------===// |
| 10 | |
| 11 | #include "FuzzerDefs.h" |
| 12 | |
| 13 | extern "C" { |
| 14 | // This function should be defined by the user. |
| 15 | int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size); |
| 16 | } // extern "C" |
| 17 | |
metzman | 2fe66e6 | 2019-01-17 16:36:05 +0000 | [diff] [blame] | 18 | ATTRIBUTE_INTERFACE int main(int argc, char **argv) { |
george.karpenkov | 29efa6d | 2017-08-21 23:25:50 +0000 | [diff] [blame] | 19 | return fuzzer::FuzzerDriver(&argc, &argv, LLVMFuzzerTestOneInput); |
| 20 | } |