[llvm] r266480 - [libFuzzer] add a better warning for command line flags with -- (two dashes)
Kostya Serebryany via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 15 14:56:29 PDT 2016
Author: kcc
Date: Fri Apr 15 16:56:29 2016
New Revision: 266480
URL: http://llvm.org/viewvc/llvm-project?rev=266480&view=rev
Log:
[libFuzzer] add a better warning for command line flags with -- (two dashes)
Modified:
llvm/trunk/lib/Fuzzer/FuzzerDriver.cpp
llvm/trunk/lib/Fuzzer/test/fuzzer.test
Modified: llvm/trunk/lib/Fuzzer/FuzzerDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/FuzzerDriver.cpp?rev=266480&r1=266479&r2=266480&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/FuzzerDriver.cpp (original)
+++ llvm/trunk/lib/Fuzzer/FuzzerDriver.cpp Fri Apr 15 16:56:29 2016
@@ -133,6 +133,9 @@ static bool ParseOneFlag(const char *Par
PrintedWarning = true;
Printf("INFO: libFuzzer ignores flags that start with '--'\n");
}
+ for (size_t F = 0; F < kNumFlags; F++)
+ if (FlagValue(Param + 1, FlagDescriptions[F].Name))
+ Printf("WARNING: did you mean '%s' (single dash)?\n", Param + 1);
return true;
}
for (size_t F = 0; F < kNumFlags; F++) {
Modified: llvm/trunk/lib/Fuzzer/test/fuzzer.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/test/fuzzer.test?rev=266480&r1=266479&r2=266480&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/test/fuzzer.test (original)
+++ llvm/trunk/lib/Fuzzer/test/fuzzer.test Fri Apr 15 16:56:29 2016
@@ -116,3 +116,5 @@ FD_MASK_3-NOT: STREAM_COUT
FD_MASK_3-NOT: STREAM_CERR
FD_MASK_3: INITED
+RUN: LLVMFuzzer-SimpleTest -runs=10 --max_len=100 2>&1 | FileCheck %s --check-prefix=DASH_DASH
+DASH_DASH: WARNING: did you mean '-max_len=100' (single dash)?
More information about the llvm-commits
mailing list