Re: [PATCH v2 03/34] compiler-capability-analysis: Add test stub

2025-03-04 Thread Marco Elver
On Wed, 5 Mar 2025 at 00:52, Bart Van Assche wrote: > > On 3/4/25 1:21 AM, Marco Elver wrote: > > +#include > > + > > +/* > > + * Test that helper macros work as expected. > > + */ > > +static void __used test_common_helpers(void) > > +{ > > + BUILD_BUG_ON(capability_unsafe(3) != 3); /* plain

Re: [PATCH v2 03/34] compiler-capability-analysis: Add test stub

2025-03-04 Thread Bart Van Assche
On 3/4/25 1:21 AM, Marco Elver wrote: +#include + +/* + * Test that helper macros work as expected. + */ +static void __used test_common_helpers(void) +{ + BUILD_BUG_ON(capability_unsafe(3) != 3); /* plain expression */ + BUILD_BUG_ON(capability_unsafe((void)2; 3;) != 3); /* does not

[PATCH v2 03/34] compiler-capability-analysis: Add test stub

2025-03-04 Thread Marco Elver
Add a simple test stub where we will add common supported patterns that should not generate false positive of each new supported capability. Signed-off-by: Marco Elver --- lib/Kconfig.debug | 14 ++ lib/Makefile | 3 +++ lib/test_capability-analysis.c