Test for #2666.