Fix https://github.com/llvm/llvm-project/issues/65061
Thank you for taking care of it. Can you please also add a test?
Add a testcase.
Thank you for the fix and the test!