In the debug info, thread local variables, whether they're at module, class, or function scope should have record types of S_LTHREAD32 and S_GTHREAD32. Right now they're stored as shared globals using the record type S_GDATA32.
I've patched dmd to emit these records correctly, but they are removed by optlink when creating the executable.
OMF compiler output looks ok, but optlink screws it. Building COFF and linking with the MS linker is ok.
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18297 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB