2 !!DESCRIPTION!! Make sure that structs/unions know the sizes of anonymous struct/union members
3 !!ORIGIN!! cc65 regression tests
4 !!LICENCE!! Public Domain
9 see https://github.com/cc65/cc65/issues/641
14 static unsigned char fails = 0;
61 /* We use "variables" in the comparisons, so that we can avoid "constant
62 ** comparison" and "Unreachable code" warnings (the second one currently
63 ** can't be suppressed).
66 static size_t const four = 4;
67 static size_t const seven = 7;
68 static size_t const ten = 10;
72 /* Check the types' sizes. */
74 if (sizeof (s1_t) != ten) {
75 printf("s1_t size is %u; it should be 10.\n", sizeof (s1_t));
78 if (sizeof (s2_t) != seven) {
79 printf("s2_t size is %u; it should be 7.\n", sizeof (s2_t));
82 if (sizeof (u1_t) != seven) {
83 printf("u1_t size is %u; it should be 7.\n", sizeof (u1_t));
86 if (sizeof (u2_t) != four) {
87 printf("u2_t size is %u; it should be 4.\n", sizeof (u2_t));
91 /* Check the variables' sizes. */
93 if (sizeof s1 != ten) {
94 printf("s1 size is %u; it should be 10.\n", sizeof s1);
97 if (sizeof s2 != seven) {
98 printf("s2 size is %u; it should be 7.\n", sizeof s2);
101 if (sizeof u1 != seven) {
102 printf("u1 size is %u; it should be 7.\n", sizeof u1);
105 if (sizeof u2 != four) {
106 printf("u2 size is %u; it should be 4.\n", sizeof u2);