Add test cases for #7503, #14451