summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer/FuzzerMain.cpp
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2015-01-28 23:48:39 +0000
committerKostya Serebryany <kcc@google.com>2015-01-28 23:48:39 +0000
commit265cf04f9c738f3be7a941d87eaee80d928be39e (patch)
treeb75dca4aea21f52a9af650086b596194f120dfab /llvm/lib/Fuzzer/FuzzerMain.cpp
parent1689d3f732a410dd6a09961f0e8a9fbe0d62c4ac (diff)
downloadbcm5719-llvm-265cf04f9c738f3be7a941d87eaee80d928be39e.tar.gz
bcm5719-llvm-265cf04f9c738f3be7a941d87eaee80d928be39e.zip
[fuzzer] add option -save_minimized_corpus
llvm-svn: 227395
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerMain.cpp')
-rw-r--r--llvm/lib/Fuzzer/FuzzerMain.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerMain.cpp b/llvm/lib/Fuzzer/FuzzerMain.cpp
index 9d4004e951d..6031fc835b9 100644
--- a/llvm/lib/Fuzzer/FuzzerMain.cpp
+++ b/llvm/lib/Fuzzer/FuzzerMain.cpp
@@ -139,6 +139,8 @@ int main(int argc, char **argv) {
if (F.CorpusSize() == 0)
F.AddToCorpus(Unit()); // Can't fuzz empty corpus, so add an empty input.
F.ShuffleAndMinimize();
+ if (Flags.save_minimized_corpus)
+ F.SaveCorpus();
F.Loop(Flags.iterations < 0 ? INT_MAX : Flags.iterations);
if (Flags.verbosity)
std::cerr << "Done\n";
OpenPOWER on IntegriCloud