summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Castelluccio <mcastelluccio@mozilla.com>2017-11-08 19:21:54 +0000
committerMarco Castelluccio <mcastelluccio@mozilla.com>2017-11-08 19:21:54 +0000
commit8f15f3c70065372ce412075f5f369847b55351d2 (patch)
tree553929efed4b1a9052e613c0baed714471a45cad
parent299a2452998f3ff3c6587d0c5b1c11e8f717d52d (diff)
downloadclang-8f15f3c70065372ce412075f5f369847b55351d2.tar.gz
Add CoreOption flag to "-coverage" option to make it available for clang-cl
Summary: The -coverage option is not a CoreOption, so it is not available to clang-cl. This patch adds the CoreOption flag to "-coverage" to allow it to be used with clang-cl. Reviewers: rnk Reviewed By: rnk Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D38221 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317709 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Driver/Options.td2
-rw-r--r--test/Driver/coverage.c7
2 files changed, 8 insertions, 1 deletions
diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td
index 597e03b563..01605619e0 100644
--- a/include/clang/Driver/Options.td
+++ b/include/clang/Driver/Options.td
@@ -519,7 +519,7 @@ def cl_fp32_correctly_rounded_divide_sqrt : Flag<["-"], "cl-fp32-correctly-round
def client__name : JoinedOrSeparate<["-"], "client_name">;
def combine : Flag<["-", "--"], "combine">, Flags<[DriverOption, Unsupported]>;
def compatibility__version : JoinedOrSeparate<["-"], "compatibility_version">;
-def coverage : Flag<["-", "--"], "coverage">;
+def coverage : Flag<["-", "--"], "coverage">, Flags<[CoreOption]>;
def cpp_precomp : Flag<["-"], "cpp-precomp">, Group<clang_ignored_f_Group>;
def current__version : JoinedOrSeparate<["-"], "current_version">;
def cxx_isystem : JoinedOrSeparate<["-"], "cxx-isystem">, Group<clang_i_Group>,
diff --git a/test/Driver/coverage.c b/test/Driver/coverage.c
new file mode 100644
index 0000000000..339c4a3f36
--- /dev/null
+++ b/test/Driver/coverage.c
@@ -0,0 +1,7 @@
+// Test coverage flag.
+//
+// RUN: %clang_cl -### -coverage %s -o foo/bar.o 2>&1 | FileCheck -check-prefix=CLANG-CL-COVERAGE %s
+// CLANG-CL-COVERAGE-NOT: error:
+// CLANG-CL-COVERAGE-NOT: warning:
+// CLANG-CL-COVERAGE-NOT: argument unused
+// CLANG-CL-COVERAGE-NOT: unknown argument