Add test for issue 7181. Fixes #7181.
Merge pull request #7695 from debugger22/7181

Add test for issue 7181.