test case for complicated constrol flow.