This test fails on aarch64 host:
results/host/tst_bug-3393-designated.out:6:--- FAIL: "Assertion failed" on v.y == 0 at /home/sdcc-builder/build/sdcc-build/orig/sdcc/support/regression/cases/../tests/bug-3393-designated.c:127
results/host/tst_bug-3393-designated.out:7:--- FAIL: "Assertion failed" on v.w == 0 at /home/sdcc-builder/build/sdcc-build/orig/sdcc/support/regression/cases/../tests/bug-3393-designated.c:128
But at first sight, it feels like the test is wrong:
union U {
char c;
struct {
char x;
char y;
char w;
};
};
…
union U v = {.c = 5};
ASSERT (v.c == 5);
ASSERT (v.y == 0);
ASSERT (v.w == 0);
We initialize the member c of the union. That leaves the struct uninitalized (though practically, x will share storage with c, so it will get the same value as c). But I don't see why y or w would be required to be initialized (to 0 or any other value).
I had the same doubt in [patches:#508] that introduced this test:
https://sourceforge.net/p/sdcc/patches/508/#7cf3
Related
Patches:
#508