This reapplies e1933a0488a50eb939210808fc895d374570d891 (which was reverted in f55ba3525eb19baed7d3f23638cbbd880246a370 due to bot failures, e.g. https://lab.llvm.org/buildbot/#/builders/117/builds/2768). The bot failures were due to a missing symbol error: We use the input object's mangling to decide how to mangle the debug-info registration function name. This caused lookup of the registration function to fail when the input object mangling didn't match the host mangling. Disbaling the test on non-Darwin platforms is the easiest short-term solution. I have filed https://llvm.org/PR52503 with a proposed longer term solution.