testsuite: Test for #6153, closes #6153