Added final flag to var declarations in the IR
Added test to check if the final flag appears correctly when generated