mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	These were marked IR-only, but they do pass on the old codegen too. Also add old codegen version of semantictests/revertStrings/function_entry_checks.
		
			
				
	
	
		
			21 lines
		
	
	
		
			614 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			614 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
contract C {
 | 
						|
    uint[] storageArray;
 | 
						|
    function set_get_length(uint256 len) public returns (uint256) {
 | 
						|
        while(storageArray.length < len)
 | 
						|
            storageArray.push();
 | 
						|
        while(storageArray.length > 0)
 | 
						|
            storageArray.pop();
 | 
						|
        return storageArray.length;
 | 
						|
    }
 | 
						|
}
 | 
						|
// ====
 | 
						|
// compileViaYul: also
 | 
						|
// ----
 | 
						|
// set_get_length(uint256): 0 -> 0
 | 
						|
// set_get_length(uint256): 1 -> 0
 | 
						|
// set_get_length(uint256): 10 -> 0
 | 
						|
// set_get_length(uint256): 20 -> 0
 | 
						|
// set_get_length(uint256): 0xFF -> 0
 | 
						|
// set_get_length(uint256): 0xFFF -> 0
 | 
						|
// set_get_length(uint256): 0xFFFF -> FAILURE # Out-of-gas #
 |