[libFuzzer] Add Fuzzer to the list of sanitizers which support coverage.

Without this change, additional coverage flags specified after
-fsanitize=fuzzer would get discarded.

https://reviews.llvm.org/D34794

llvm-svn: 306734
This commit is contained in:
George Karpenkov 2017-06-29 19:58:20 +00:00
parent 2363fdd30f
commit 3f984ecb45
2 changed files with 5 additions and 1 deletions

View File

@ -32,7 +32,7 @@ enum : SanitizerMask {
RequiresPIE = DataFlow,
NeedsUnwindTables = Address | Thread | Memory | DataFlow,
SupportsCoverage = Address | KernelAddress | Memory | Leak | Undefined |
Integer | Nullability | DataFlow,
Integer | Nullability | DataFlow | Fuzzer,
RecoverableByDefault = Undefined | Integer | Nullability,
Unrecoverable = Unreachable | Return,
LegacyFsanitizeRecoverMask = Undefined | Integer,

View File

@ -15,10 +15,14 @@
//
// CHECK-LIBCXX-DARWIN: -lc++
// Check that we don't link in libFuzzer.a when producing a shared object.
// RUN: %clang -fsanitize=fuzzer %s -shared -o %t.so -### 2>&1 | FileCheck --check-prefixes=CHECK-NOLIB-SO %s
// CHECK-NOLIB-SO-NOT: libLLVMFuzzer.a
// RUN: %clang -fsanitize=fuzzer -fsanitize-coverage=trace-pc %s -### 2>&1 | FileCheck --check-prefixes=CHECK-MSG %s
// CHECK-MSG-NOT: argument unused during compilation
int LLVMFuzzerTestOneInput(const char *Data, long Size) {
return 0;
}