It seems this isn't allowed: the IR dumper would render it as !{void <badref>}
and it would assert when serialized to bitcode.
The specifc case that triggers the wrong behavior is related to debug
information (as shown in the testcase), but the fix is in the general metadata
code.