[llvm-exegesis][NFC] Return many CodeTemplates instead of one.
[llvm-core.git] / tools / llvm-special-case-list-fuzzer / special-case-list-fuzzer.cpp
blobe7e310b3c7f2576cfa23661d180822bed2880d0b
1 //===--- special-case-list-fuzzer.cpp - Fuzzer for special case lists -----===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
10 #include "llvm/Support/MemoryBuffer.h"
11 #include "llvm/Support/SpecialCaseList.h"
13 #include <cstdlib>
15 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
16 std::unique_ptr<llvm::MemoryBuffer> Buf = llvm::MemoryBuffer::getMemBuffer(
17 llvm::StringRef(reinterpret_cast<const char *>(Data), Size), "", false);
19 if (!Buf)
20 return 0;
22 std::string Error;
23 llvm::SpecialCaseList::create(Buf.get(), Error);
25 return 0;