mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			35 lines
		
	
	
		
			662 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			662 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
| contract E {
 | |
| 	uint public e;
 | |
| 	function setE(uint _e) public {
 | |
| 		e = _e;
 | |
| 	}
 | |
| }
 | |
| 
 | |
| contract D {
 | |
| 	E e;
 | |
| 	constructor(E _e) {
 | |
| 		e = _e;
 | |
| 	}
 | |
| 	function setE(uint x) public {
 | |
| 		e.setE(x);
 | |
| 	}
 | |
| }
 | |
| 
 | |
| contract C {
 | |
| 	function f() public {
 | |
| 		E e = new E();
 | |
| 		D d = new D(e);
 | |
| 		assert(e.e() == 0); // should hold
 | |
| 		d.setE(42);
 | |
| 		assert(e.e() == 42); // should hold
 | |
| 		assert(e.e() == 2); // should fail
 | |
| 	}
 | |
| }
 | |
| // ====
 | |
| // SMTEngine: chc
 | |
| // SMTExtCalls: trusted
 | |
| // SMTTargets: assert
 | |
| // ----
 | |
| // Warning 6328: (344-362): CHC: Assertion violation happens here.
 | |
| // Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.
 |