Add regression test for #14244.

Special thanks to @programcsharp

[skip validator]