From: Sasha Levin <sashal@kernel.org>
To: oberpar@linux.ibm.com
Cc: corbet@lwn.net, skhan@linuxfoundation.org, nathan@kernel.org,
linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-doc@vger.kernel.org, Sasha Levin <sashal@kernel.org>
Subject: [PATCH 2/4] kconfig: add CC_HAS_CONDITION_COVERAGE for MC/DC support detection
Date: Sat, 14 Mar 2026 10:17:47 -0400 [thread overview]
Message-ID: <20260314141749.3382679-3-sashal@kernel.org> (raw)
In-Reply-To: <20260314141749.3382679-1-sashal@kernel.org>
Add a Kconfig symbol to detect compiler support for -fcondition-coverage,
which enables MC/DC (Modified Condition/Decision Coverage) instrumentation.
This flag is available since GCC 14.
Assisted-by: Claude:claude-opus-4-6
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
init/Kconfig | 3 +++
1 file changed, 3 insertions(+)
diff --git a/init/Kconfig b/init/Kconfig
index 444ce811ea674..38c8e06ad6d08 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -132,6 +132,9 @@ config CC_HAS_ASSUME
config CC_HAS_NO_PROFILE_FN_ATTR
def_bool $(success,echo '__attribute__((no_profile_instrument_function)) int x();' | $(CC) -x c - -c -o /dev/null -Werror)
+config CC_HAS_CONDITION_COVERAGE
+ def_bool $(cc-option,-fcondition-coverage)
+
config CC_HAS_COUNTED_BY
bool
# clang needs to be at least 20.1.0 to avoid potential crashes
--
2.51.0
next prev parent reply other threads:[~2026-03-14 14:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-14 14:17 [PATCH 0/4] gcov: Add MC/DC condition coverage support Sasha Levin
2026-03-14 14:17 ` [PATCH 1/4] gcov: fix gcov_info_add() merge semantics for IOR counters Sasha Levin
2026-03-14 14:17 ` Sasha Levin [this message]
2026-03-14 14:17 ` [PATCH 3/4] gcov: add MC/DC condition coverage support Sasha Levin
2026-03-14 14:17 ` [PATCH 4/4] Documentation: gcov: document " Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260314141749.3382679-3-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=oberpar@linux.ibm.com \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox