Add test for dynamic stack allocation