Reduced version of the test from master/#20861 by John Newbery. Github-Pull: #20861 Rebased-From: fe5e495c31
fe5e495c31