Test for #5333.