Regression test for #17728

Closes #17728.