Regression test for #1062.

Regression tests to show #1062 fails.

The branch is merged into #1051 to show it passes there.