Test case for #2765