Add UnusedVariable test of for loop; issue #3603257