summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer/FuzzerLoop.cpp
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2016-06-08 01:46:13 +0000
committerKostya Serebryany <kcc@google.com>2016-06-08 01:46:13 +0000
commit76f425211e83cd387e93390f53c8a9b56cfeb231 (patch)
treec7240e260993a7cefb7b3a4195f7a2a8437ebccc /llvm/lib/Fuzzer/FuzzerLoop.cpp
parent33b8b64aef936b142ebdc536db0cb3210ae93787 (diff)
downloadbcm5719-llvm-76f425211e83cd387e93390f53c8a9b56cfeb231.tar.gz
bcm5719-llvm-76f425211e83cd387e93390f53c8a9b56cfeb231.zip
[libFuzzer] add a test that is built w/o coverage instrumentation but has the coverage rt (it should now fail with a descriptive message)
llvm-svn: 272090
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerLoop.cpp')
-rw-r--r--llvm/lib/Fuzzer/FuzzerLoop.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerLoop.cpp b/llvm/lib/Fuzzer/FuzzerLoop.cpp
index 5cfbad4c327..e397645782e 100644
--- a/llvm/lib/Fuzzer/FuzzerLoop.cpp
+++ b/llvm/lib/Fuzzer/FuzzerLoop.cpp
@@ -391,6 +391,11 @@ void Fuzzer::ShuffleAndMinimize() {
for (auto &X : Corpus)
UnitHashesAddedToCorpus.insert(Hash(X));
PrintStats("INITED");
+ if (Corpus.empty()) {
+ Printf("ERROR: no interesting inputs were found. "
+ "Is the code instrumented for coverage? Exiting.\n");
+ exit(1);
+ }
}
bool Fuzzer::UpdateMaxCoverage() {
OpenPOWER on IntegriCloud