Add regression test to #8907