Add test case for #1140