Add regression test for #16347