Commit e7985ed2 happened to fix #12850, so let's add a regression test for the program reported in #12850.