Add test for #6861