Add test for issue 6134

fixes #6134
Merge pull request #8416 from skirpichev/6134-test

Add test for issue 6134