Add a test for #7859