Skip to content
This repository has been archived by the owner on Apr 23, 2020. It is now read-only.

Commit

Permalink
[sanitizer] allow -fsanitize-coverage=N w/ -fsanitize=leak, clang part
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224462 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
kcc committed Dec 17, 2014
1 parent 1932961 commit 9f988c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Driver/SanitizerArgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ SanitizerArgs::SanitizerArgs(const ToolChain &TC,
}
}

// Parse -fsanitize-coverage=N
if (NeedsAsan || NeedsMsan) { // Currently asan or msan is required.
// Parse -fsanitize-coverage=N. Currently one of asan/msan/lsan is required.
if (NeedsAsan || NeedsMsan || NeedsLsan) {
if (Arg *A = Args.getLastArg(options::OPT_fsanitize_coverage)) {
StringRef S = A->getValue();
// Legal values are 0..4.
Expand Down
1 change: 1 addition & 0 deletions test/Driver/fsanitize.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
// CHECK-SANITIZE-COVERAGE-0-NOT: fsanitize-coverage
// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-coverage=1 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANITIZE-COVERAGE-1
// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-coverage=1 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANITIZE-COVERAGE-1
// RUN: %clang -target x86_64-linux-gnu -fsanitize=leak -fsanitize-coverage=1 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANITIZE-COVERAGE-1
// CHECK-SANITIZE-COVERAGE-1: fsanitize-coverage=1
// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-coverage=4 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANITIZE-COVERAGE-4
// CHECK-SANITIZE-COVERAGE-4: fsanitize-coverage=4
Expand Down

0 comments on commit 9f988c4

Please sign in to comment.