Test case for #7961.