I've found the piece of code running on ThinLTO internalization phase which seems useless to me.
Also no test seems to depend on it. I've run check-llvm after removal and it passes flawlessly.
It looks like undefined assembly symbols are first put to GlobalResolutions by lto::addModuleToGlobalRes and than
thinLTOInternalizeAndPromoteInIndex is doing the job by setting the proper linkage in ModuleSummaryIndex.
If this code is needed can someone suggest how to write unit test for it?