Test case for #8374