summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-opt-fuzzer/DummyOptFuzzer.cpp
diff options
context:
space:
mode:
authorIgor Laevsky <igmyrj@gmail.com>2017-11-10 12:19:08 +0000
committerIgor Laevsky <igmyrj@gmail.com>2017-11-10 12:19:08 +0000
commit13cc995c3d7ce55326f255718ee1f09fb4ca8bbb (patch)
tree8047b05e438bbd44e39a3dfe4abe3ed8d8702df4 /llvm/tools/llvm-opt-fuzzer/DummyOptFuzzer.cpp
parent7ca61e31acf2107cf7cdf1782b7a1becd7c95701 (diff)
downloadbcm5719-llvm-13cc995c3d7ce55326f255718ee1f09fb4ca8bbb.tar.gz
bcm5719-llvm-13cc995c3d7ce55326f255718ee1f09fb4ca8bbb.zip
[llvm-opt-fuzzer] Introduce llvm-opt-fuzzer for fuzzing optimization passes
This change adds generic fuzzing tools capable of running libFuzzer tests on any optimization pass or combination of them. Differential Revision: https://reviews.llvm.org/D39555 llvm-svn: 317883
Diffstat (limited to 'llvm/tools/llvm-opt-fuzzer/DummyOptFuzzer.cpp')
-rw-r--r--llvm/tools/llvm-opt-fuzzer/DummyOptFuzzer.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/tools/llvm-opt-fuzzer/DummyOptFuzzer.cpp b/llvm/tools/llvm-opt-fuzzer/DummyOptFuzzer.cpp
new file mode 100644
index 00000000000..115923fe33c
--- /dev/null
+++ b/llvm/tools/llvm-opt-fuzzer/DummyOptFuzzer.cpp
@@ -0,0 +1,21 @@
+//===--- DummyOptFuzzer.cpp - Entry point to sanity check the fuzzer ------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// Implementation of main so we can build and test without linking libFuzzer.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/FuzzMutate/FuzzerCLI.h"
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size);
+extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv);
+int main(int argc, char *argv[]) {
+ return llvm::runFuzzerOnInputs(argc, argv, LLVMFuzzerTestOneInput,
+ LLVMFuzzerInitialize);
+}
OpenPOWER on IntegriCloud