https://issues.dlang.org/show_bug.cgi?id=15032
Martin Nowak <c...@dawg.eu> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #4 from Martin Nowak <c...@dawg.eu> --- The _Dmain functions ends up in the wrong object file (mod_a.o) b/c it's codegen is triggered from the nested find function. https://github.com/D-Programming-Language/dmd/blob/ea5d85af7abf0b1e36fd42a8d98fd692a765dea0/src/glue.c#L900 Therefor code for _Dmain is generated before the module's coverage symbol is setup (https://github.com/D-Programming-Language/dmd/blob/ea5d85af7abf0b1e36fd42a8d98fd692a765dea0/src/glue.c#L370) and incUsageElem will silently be skipped (https://github.com/D-Programming-Language/dmd/blob/ea5d85af7abf0b1e36fd42a8d98fd692a765dea0/src/toir.c#L62). This order related bug is also fixed by https://github.com/D-Programming-Language/dmd/pull/5058 which tries to emit nested functions after their parent function. --