@@ -101,6 +101,7 @@ static bool stackinit_range_contains(char *haystack_start, size_t haystack_size,
101
101
102
102
#define INIT_STRUCT_none (var_type ) /**/
103
103
#define INIT_STRUCT_zero (var_type ) = { }
104
+ #define INIT_STRUCT_old_zero (var_type ) = { 0 }
104
105
105
106
106
107
#define __static_partial { .two = 0, }
@@ -346,6 +347,7 @@ struct test_user {
346
347
/* These should be fully initialized all the time! */
347
348
DEFINE_SCALAR_TESTS (zero , ALWAYS_PASS );
348
349
DEFINE_STRUCT_TESTS (zero , ALWAYS_PASS );
350
+ DEFINE_STRUCT_TESTS (old_zero , ALWAYS_PASS );
349
351
/* Struct initializers: padding may be left uninitialized. */
350
352
DEFINE_STRUCT_INITIALIZER_TESTS (static , STRONG_PASS );
351
353
DEFINE_STRUCT_INITIALIZER_TESTS (dynamic , STRONG_PASS );
@@ -440,6 +442,7 @@ static struct kunit_case stackinit_test_cases[] = {
440
442
/* These are explicitly initialized and should always pass. */
441
443
KUNIT_test_scalars (zero ),
442
444
KUNIT_test_structs (zero ),
445
+ KUNIT_test_structs (old_zero ),
443
446
/* Padding here appears to be accidentally always initialized? */
444
447
KUNIT_test_structs (dynamic_partial ),
445
448
KUNIT_test_structs (assigned_dynamic_partial ),
0 commit comments