Add a test for #6037