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
+config CC_HAS_MCDC
+ def_bool $(cc-option,-fcondition-coverage)
+
# Set code alignment.
#
# Allow setting on a boolean basis, and then convert such selection to an
If unsure, say N here.
+config CONDITION_COVERAGE
+ bool "Condition coverage support"
+ depends on COVERAGE && CC_HAS_MCDC
+ help
+ Enable condition coverage support. Used for collecting MC/DC
+ (Modified Condition/Decision Coverage) metrics.
+
+ If unsure, say N here.
+
config DEBUG_LOCK_PROFILE
bool "Lock Profiling"
select DEBUG_LOCKS
subdir-y :=
CFLAGS-y :=
AFLAGS-y :=
+cov-cflags-y :=
nocov-y :=
noubsan-y :=
non-init-objects = $(filter-out %.init.o, $(obj-y) $(obj-bin-y) $(extra-y))
-ifeq ($(CONFIG_COVERAGE),y)
ifeq ($(CONFIG_CC_IS_CLANG),y)
- COV_FLAGS := -fprofile-instr-generate -fcoverage-mapping
+ cov-cflags-$(CONFIG_COVERAGE) := -fprofile-instr-generate -fcoverage-mapping
else
- COV_FLAGS := -fprofile-arcs -ftest-coverage
+ cov-cflags-$(CONFIG_COVERAGE) := -fprofile-arcs -ftest-coverage
+ cov-cflags-$(CONFIG_CONDITION_COVERAGE) += -fcondition-coverage
endif
-# Reset COV_FLAGS in cases where an objects has another one as prerequisite
+# Reset cov-cflags-y in cases where an objects has another one as prerequisite
$(nocov-y) $(filter %.init.o, $(obj-y) $(obj-bin-y) $(extra-y)): \
- COV_FLAGS :=
+ cov-cflags-y :=
-$(non-init-objects): _c_flags += $(COV_FLAGS)
-endif
+$(non-init-objects): _c_flags += $(cov-cflags-y)
ifeq ($(CONFIG_UBSAN),y)
# Any -fno-sanitize= options need to come after any -fsanitize= options