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.
		
			
				
	
	
		
			27 lines
		
	
	
		
			621 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			621 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
| contract C {
 | |
| 	function test(uint256 len, uint idx) public returns (uint256)
 | |
| 	{
 | |
| 		uint[] memory array = new uint[](len);
 | |
| 		uint result = receiver(array, idx);
 | |
| 
 | |
| 		for (uint256 i = 0; i < array.length; i++)
 | |
| 			require(array[i] == i + 1);
 | |
| 
 | |
| 		return result;
 | |
| 	}
 | |
| 	function receiver(uint[] memory array, uint idx) public returns (uint256)
 | |
| 	{
 | |
| 		for (uint256 i = 0; i < array.length; i++)
 | |
| 			array[i] = i + 1;
 | |
| 
 | |
| 		return array[idx];
 | |
| 	}
 | |
| }
 | |
| // ====
 | |
| // compileViaYul: also
 | |
| // ----
 | |
| // test(uint256,uint256): 0,0 -> FAILURE
 | |
| // test(uint256,uint256): 1,0 -> 1
 | |
| // test(uint256,uint256): 10,5 -> 6
 | |
| // test(uint256,uint256): 10,50 -> FAILURE
 |