@Test
public void testCloneInvoke() {

	SymbolicAddressMap m1 = map1();
	SymbolicAddressMap m2 = map2();
	SymbolicAddressMap top = SymbolicAddressMap.top();
	// Trivial
	assertEquals(m1, m1.cloneInvoke(0));
	int framePtr = 2;
	// Stack[2] -> Stack[0]
	SymbolicAddressMap m1i = m1.cloneInvoke(framePtr);
	SymbolicAddressMap m1a = new SymbolicAddressMap(bsf2);
	m1a.addStackUpto(m1, framePtr);
	
	// m1i: Stack[0] -> Stack[2] and merge
	m1a.joinReturned(m1i, framePtr);
	assertEquals(m1,m1a);
	framePtr = 1;
	SymbolicAddressMap m2i = m2.cloneInvoke(framePtr);
	SymbolicAddressMap m2a = new SymbolicAddressMap(bsf2);
	m2a.addStackUpto(m2, framePtr);
	m2a.joinReturned(m2i, framePtr);
	assertEquals(m2,m2a);
	
	try {
		m1a.joinReturned(null, 0);
		fail("joinReturned(null) should throw AssertionError");
	} catch (AssertionError _) {}
	assertEquals(m1,m1a);
	m1a.joinReturned(SymbolicAddressMap.top(), 1);
	assertEquals(m1a,top);
	top.joinReturned(m1i, 1);
	assertEquals(SymbolicAddressMap.top(),top);		
}