Add test case from bug #8366 (it was fixed in master, not in 2-10)