From 71d5a2540a98c81f5bcaeb48805e0e2881f530ef Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 16 Apr 2017 16:01:22 +0000 Subject: Vendor import of llvm trunk r300422: https://llvm.org/svn/llvm-project/llvm/trunk@300422 --- lib/Fuzzer/test/SingleByteInputTest.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 lib/Fuzzer/test/SingleByteInputTest.cpp (limited to 'lib/Fuzzer/test/SingleByteInputTest.cpp') diff --git a/lib/Fuzzer/test/SingleByteInputTest.cpp b/lib/Fuzzer/test/SingleByteInputTest.cpp new file mode 100644 index 000000000000..4ce819d230ce --- /dev/null +++ b/lib/Fuzzer/test/SingleByteInputTest.cpp @@ -0,0 +1,17 @@ +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +// Simple test for a fuzzer, need just one byte to crash. +#include +#include +#include +#include + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { + if (Size > 0 && Data[Size/2] == 42) { + fprintf(stderr, "BINGO\n"); + abort(); + } + return 0; +} + -- cgit v1.2.3