Implement test for gc-managed allocation