Add test for #5321.