Added unit test for register allocation