On 24.11.2025 12:04, Saman Dehghan wrote: > Clang >= 18 supports Modified Condition/Decision Coverage (MC/DC). > This patch enables the detection and usage of this feature when > compiling Xen with Clang. > > - Update detection logic in Kconfig to check for the required set of > Clang flags for MC/DC: > '-fprofile-instr-generate -fcoverage-mapping -fcoverage-mcdc'. > This bundle is necessary because '-fcoverage-mcdc' requires > '-fcoverage-mapping', which in turn requires '-fprofile-instr-generate'. > - Update llvm.c to handle the profile format changes (bitmap section) > required for MC/DC. > - Guard -Wno-error=coverage-too-many-conditions with CONFIG_CC_IS_GCC > to avoid passing a GCC-only warning option to Clang > > Signed-off-by: Saman Dehghan <[email protected]>
Acked-by: Jan Beulich <[email protected]> ideally with ... > --- a/xen/Rules.mk > +++ b/xen/Rules.mk > @@ -136,6 +136,7 @@ non-init-objects = $(filter-out %.init.o, $(obj-y) > $(obj-bin-y) $(extra-y)) > > ifeq ($(CONFIG_CC_IS_CLANG),y) > cov-cflags-$(CONFIG_COVERAGE) := -fprofile-instr-generate > -fcoverage-mapping > + cov-cflags-$(CONFIG_CONDITION_COVERAGE) += -fcoverage-mcdc ... the excess (double) blank here dropped (can likely be done while committing, if no other need for a v3 arises). Jan
