@@ -101,6 +101,7 @@ static bool stackinit_range_contains(char *haystack_start, size_t haystack_size,
101101
102102#define INIT_STRUCT_none (var_type ) /**/
103103#define INIT_STRUCT_zero (var_type ) = { }
104+ #define INIT_STRUCT_old_zero (var_type ) = { 0 }
104105
105106
106107#define __static_partial { .two = 0, }
@@ -346,6 +347,7 @@ struct test_user {
346347/* These should be fully initialized all the time! */
347348DEFINE_SCALAR_TESTS (zero , ALWAYS_PASS );
348349DEFINE_STRUCT_TESTS (zero , ALWAYS_PASS );
350+ DEFINE_STRUCT_TESTS (old_zero , ALWAYS_PASS );
349351/* Struct initializers: padding may be left uninitialized. */
350352DEFINE_STRUCT_INITIALIZER_TESTS (static , STRONG_PASS );
351353DEFINE_STRUCT_INITIALIZER_TESTS (dynamic , STRONG_PASS );
@@ -440,6 +442,7 @@ static struct kunit_case stackinit_test_cases[] = {
440442 /* These are explicitly initialized and should always pass. */
441443 KUNIT_test_scalars (zero ),
442444 KUNIT_test_structs (zero ),
445+ KUNIT_test_structs (old_zero ),
443446 /* Padding here appears to be accidentally always initialized? */
444447 KUNIT_test_structs (dynamic_partial ),
445448 KUNIT_test_structs (assigned_dynamic_partial ),
0 commit comments