testsuite: add test for #8831