From: Kostya Serebryany Date: Wed, 3 Dec 2014 23:27:45 +0000 (+0000) Subject: [msan] allow -fsanitize-coverage=N together with -fsanitize=memory, clang part X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bed8da2e3b6505375155e6ae9568d912cdb223d1;p=platform%2Fupstream%2Fllvm.git [msan] allow -fsanitize-coverage=N together with -fsanitize=memory, clang part llvm-svn: 223311 --- diff --git a/clang/lib/Driver/SanitizerArgs.cpp b/clang/lib/Driver/SanitizerArgs.cpp index 1e7487f..4d288f7 100644 --- a/clang/lib/Driver/SanitizerArgs.cpp +++ b/clang/lib/Driver/SanitizerArgs.cpp @@ -298,7 +298,7 @@ SanitizerArgs::SanitizerArgs(const ToolChain &TC, } // 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. diff --git a/clang/test/Driver/fsanitize.c b/clang/test/Driver/fsanitize.c index e8e91dc..45f8ff0 100644 --- a/clang/test/Driver/fsanitize.c +++ b/clang/test/Driver/fsanitize.c @@ -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