[libFuzzer] add a better warning for command line flags with -- (two dashes)

llvm-svn: 266480
This commit is contained in:
Kostya Serebryany 2016-04-15 21:56:29 +00:00
parent dc4376ad48
commit c84bd01bcd
2 changed files with 5 additions and 0 deletions

View File

@ -133,6 +133,9 @@ static bool ParseOneFlag(const char *Param) {
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++) {

View File

@ -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)?