add testcase for #5759 (crash) which was fixed by reverting fix for #5605