https://github.com/NagyDonat approved this pull request. LGTM, thanks for fixing these testcases! I suggested one minor simplification in an inline comment, but overall I'm satisfied with the code. https://github.com/llvm/llvm-project/pull/146597