Closed
Description
Zig Version
0.11.0-dev.1898+36d47dd19
Steps to Reproduce and Observed Behavior
This test case is incorrect: https://github.com/ziglang/zig/blob/36d47dd1991f0ccd7a9673075624f09500cc415e/test/link/wasm/bss/build.zig
The global variable has value undefined
:
zig/test/link/wasm/bss/lib.zig
Line 1 in 36d47dd
So it should not go into the bss section in debug mode.
Furthermore, when I change the value to 0
it should definitely go into bss, however in this case the test fails.
Expected Behavior
Zig is technically allowed to lower undefined
in any way it wants to, however the linker test can test the actual behavior of the linker. It should do the following for undefined
:
- Debug, ReleaseSafe: lower to 0xaa bytes
- ReleaseFast, ReleaseSmall: lower to bss
For zero values, it must lower to bss.
cc @Luukdegram and @kubkon