Add test for #8075

fixes #8075
Merge pull request #8375 from skirpichev/8075-tests

Add test for #8075