There are places where a case that debug label scope has an extra lexical block file is not considered properly. The modified test won't pass without this patch.
Might be helpful to have (at least for the review, doesn't necessarily need to be formalized into a lit test and checked in) a minimal source reproduction so we can more readily see what's happening here?
@dblaikie Thank you for the comment. I encountered this problem while manipulating LLVM IR, and not sure how realistic the code can be if I synthesize one to reproduce this problem. Still, I think this is worth fixing unless we can guarantee that debug label scope won't have a DILexicalBlockFile.
(I'm approaching this from the point of "if the verifier accepts the IR, the backend has to deal with it", but David is right in pointing out that there may be a bug further up the pipeline and that perhaps it should be fixed and made illegal in IR.)