Add test case for #8806.