r223311 - [msan] allow -fsanitize-coverage=N together with -fsanitize=memory, clang part

Kostya Serebryany kcc at google.com
Wed Dec 3 15:27:45 PST 2014


Author: kcc
Date: Wed Dec  3 17:27:45 2014
New Revision: 223311

URL: http://llvm.org/viewvc/llvm-project?rev=223311&view=rev
Log:
[msan] allow -fsanitize-coverage=N together with -fsanitize=memory, clang part

Modified:
    cfe/trunk/lib/Driver/SanitizerArgs.cpp
    cfe/trunk/test/Driver/fsanitize.c

Modified: cfe/trunk/lib/Driver/SanitizerArgs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/SanitizerArgs.cpp?rev=223311&r1=223310&r2=223311&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/SanitizerArgs.cpp (original)
+++ cfe/trunk/lib/Driver/SanitizerArgs.cpp Wed Dec  3 17:27:45 2014
@@ -298,7 +298,7 @@ SanitizerArgs::SanitizerArgs(const ToolC
   }
 
   // Parse -fsanitize-coverage=N
-  if (NeedsAsan) {  // Currently asan is required.
+  if (NeedsAsan || NeedsMsan) {  // Currently asan or msan is required.
     if (Arg *A = Args.getLastArg(options::OPT_fsanitize_coverage)) {
       StringRef S = A->getValue();
       // Legal values are 0..4.

Modified: cfe/trunk/test/Driver/fsanitize.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/fsanitize.c?rev=223311&r1=223310&r2=223311&view=diff
==============================================================================
--- cfe/trunk/test/Driver/fsanitize.c (original)
+++ cfe/trunk/test/Driver/fsanitize.c Wed Dec  3 17:27:45 2014
@@ -84,6 +84,7 @@
 // RUN: %clang -target x86_64-linux-gnu -fsanitize=address                       %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANITIZE-COVERAGE-0
 // 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
 // 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





More information about the cfe-commits mailing list