Add functional tests for loop call