From a3efbb0836531efa9e960d7fdeb8ef7fed34ba4d Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Wed, 8 Nov 2017 19:21:54 +0000 Subject: [PATCH] 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 llvm-svn: 317709 --- clang/include/clang/Driver/Options.td | 2 +- clang/test/Driver/coverage.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 clang/test/Driver/coverage.c diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 597e03b563dd..01605619e02f 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/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; def current__version : JoinedOrSeparate<["-"], "current_version">; def cxx_isystem : JoinedOrSeparate<["-"], "cxx-isystem">, Group, diff --git a/clang/test/Driver/coverage.c b/clang/test/Driver/coverage.c new file mode 100644 index 000000000000..339c4a3f3662 --- /dev/null +++ b/clang/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