regression test for for loop bug