testsuite: Test for #6132

Closes #6132