[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3] XEN: enable MC/DC coverage for Clang
- To: Saman Dehghan <samaan.dehghan@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- Date: Mon, 24 Nov 2025 14:19:45 +0000
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xnpZ3hxL8RiHUbCNBMSio7JIKqnPzE8WMF0NOXWLH5k=; b=PRwwRkSi0vnjhgxTwHZ1H0+R3lT2n5DrwposR7P0O5lr0pIRA1Ua7ZCeAYoIU+QdbWoA2Yelc42/VnaJEQGFn6284+dt/zvfJ9JnewruL6T9iT6DkeO9ygJ2EFJsDh+Ku3WovfdqA0aljVf0FYOiErVwZVSUgF/sSv65e5um7mi2wWdaYwPmk6Fkuz3WJoULnFwf01gCa63e0VmUM57K8J7x+BH77Kcs42Dcz6/FTY4sDyUqAWbJb1Z7PKRhVTdrYWWifSjuCM2G/TwImKOVXTPkj1czLyJ2RikEHj6E1g1vi9Jn/yj+O3D7znamJW+6CQfQo06jMZ+QGd1Zc44bpg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KOT8lQK5znWymOGy1kbZiTqVqsxBWG0t1P83dNTEhK45rhkZpJCa0GzUGVfVcMlGk6jnXVt6UN7h4GU4yJOMZ0S2R15OcjRta8vT4Toq8M/GH0iNXC7xHR/M/F7XZbequfwndX7saSOyvMxiDoDdvAJ55NNa7brCvSrO4a7ThilVi3b8dXPyIaqLHFi6tSVtA5HEdLgc/K0lVPUIElBCqC4/vGk3DOyFKrMmi3rylEDpuWVWMYLhbrSkDfaaYF3up9L2WFKREwz1hDBo3k3/JO/zfvE1Y+OLz60pJejg03LnnK1xvgkSR6ERQGOJcico5jcD8T1iKzTJuLdNwx9n5Q==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
- Delivery-date: Mon, 24 Nov 2025 14:20:03 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 24/11/2025 1:17 pm, Saman Dehghan wrote:
> diff --git a/xen/Kconfig b/xen/Kconfig
> index a5e5af3b76..8f2cc111cd 100644
> --- a/xen/Kconfig
> +++ b/xen/Kconfig
> @@ -51,9 +51,14 @@ config CC_HAS_ASM_GOTO_OUTPUT
> depends on !GCC_ASM_GOTO_OUTPUT_BROKEN
> depends on $(success,echo 'int foo(int x) { asm goto ("": "=r"(x) :::
> bar); return x; bar: return 0; }' | $(CC) -x c - -c -o /dev/null)
>
> -# Compiler supports -fcondition-coverage aka MC/DC
> +# Compiler supports Modified Condition/Decision Coverage (MC/DC).
Ah sorry, I only meant for this line. Enough for someone to usefully
google.
Otherwise, Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
I can trim this down on commit if you're happy.
~Andrew
> +# MC/DC is a rigorous code coverage metric that requires every condition
> +# within a decision (boolean expression) to be shown to independently
> +# influence the decision's final outcome.
> +#
> +# Minimum toolchain baseline: GCC >= 14, or Clang >= 18.
> config CC_HAS_MCDC
> - def_bool $(cc-option,-fcondition-coverage)
> + def_bool $(cc-option,-fcondition-coverage) ||
> $(cc-option,-fprofile-instr-generate -fcoverage-mapping -fcoverage-mcdc)
>
> # Set code alignment.
> #
>
|