Test for the bug #3111