tests: add test for #49
Fix for-loops with shared induction variables (fixes #49)