Regression test for ICE.  Fix #5153.

r? anyone