Add a (linked) test case for bug 1064894

This should have been part of PR 5284.