Bug report: https://bugs.llvm.org/show_bug.cgi?id=45291
Patch by Tomasz Miąsko
Is it possible to write a test for this?
I'm not exactly sure. The original Rust bug report is pretty hard to extract since it seems to heavily depend on how rustc is splitting code into codegen units.
I don't have commit access, could you please commit this for me?