mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	Merge pull request #10394 from ethereum/viayul-tests
Switch compileViaYul to also where appropriate
This commit is contained in:
		
						commit
						7eb5fc31f8
					
				| @ -39,7 +39,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // ---- | ||||
| // f() -> 0 | ||||
| // g() -> 0 | ||||
|  | ||||
| @ -8,7 +8,7 @@ contract B is A { | ||||
|     uint public y = f(); | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // constructor() -> | ||||
|  | ||||
| @ -12,6 +12,6 @@ contract D { | ||||
|   } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // ---- | ||||
| // f() -> true | ||||
|  | ||||
| @ -12,6 +12,6 @@ contract D { | ||||
|   } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // ---- | ||||
| // f() -> 2 | ||||
|  | ||||
| @ -0,0 +1,10 @@ | ||||
| pragma abicoder v1; | ||||
| contract C { | ||||
|     function t(uint) public pure {} | ||||
| } | ||||
| // ==== | ||||
| // EVMVersion: >=byzantium | ||||
| // compileViaYul: false | ||||
| // revertStrings: debug | ||||
| // ---- | ||||
| // t(uint256) -> FAILURE, hex"08c379a0", 0x20, 0x12, "Calldata too short" | ||||
| @ -0,0 +1,10 @@ | ||||
| pragma abicoder v2; | ||||
| contract C { | ||||
|     function t(uint) public pure {} | ||||
| } | ||||
| // ==== | ||||
| // EVMVersion: >=byzantium | ||||
| // compileViaYul: false | ||||
| // revertStrings: debug | ||||
| // ---- | ||||
| // t(uint256) -> FAILURE, hex"08c379a0", 0x20, 34, "ABI decoding: tuple data too sho", "rt" | ||||
| @ -18,7 +18,7 @@ contract C { | ||||
| 	} | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // ---- | ||||
| // test(uint256,uint256): 0,0 -> FAILURE | ||||
| // test(uint256,uint256): 1,0 -> 1 | ||||
|  | ||||
| @ -6,7 +6,7 @@ contract C { | ||||
| 	} | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // ---- | ||||
| // create(uint256): 0 -> 0 | ||||
| // create(uint256): 7 -> 7 | ||||
|  | ||||
| @ -22,7 +22,7 @@ contract C { | ||||
| 	} | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // ---- | ||||
| // index(uint256): 0 -> true | ||||
| // index(uint256): 10 -> true | ||||
|  | ||||
| @ -14,7 +14,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // ---- | ||||
| // test_indices(uint256): 1 -> | ||||
| // test_indices(uint256): 129 -> | ||||
|  | ||||
| @ -10,7 +10,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // ---- | ||||
| // test_boundary_check(uint256, uint256): 10, 11 -> FAILURE | ||||
| // test_boundary_check(uint256, uint256): 10, 9 -> 0 | ||||
|  | ||||
| @ -50,7 +50,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // ---- | ||||
| // test_zeroed_indicies(uint256): 1 -> | ||||
| // test_zeroed_indicies(uint256): 5 -> | ||||
|  | ||||
| @ -7,7 +7,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // ---- | ||||
| // set_get_length(uint256): 0 -> 0 | ||||
| // set_get_length(uint256): 1 -> 1 | ||||
|  | ||||
| @ -6,6 +6,6 @@ contract C { | ||||
| } | ||||
| // ==== | ||||
| // EVMVersion: >=petersburg | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // ---- | ||||
| // popEmpty() -> FAILURE | ||||
|  | ||||
| @ -9,7 +9,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // EVMVersion: >=petersburg | ||||
| // ---- | ||||
| // pushEmpty(uint256): 128 | ||||
|  | ||||
| @ -10,7 +10,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // EVMVersion: >=petersburg | ||||
| // ---- | ||||
| // set_get_length(uint256): 0 -> 0 | ||||
|  | ||||
| @ -9,7 +9,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // ---- | ||||
| // set_get_length(uint256): 0 -> 0 | ||||
| // set_get_length(uint256): 1 -> 0 | ||||
|  | ||||
| @ -14,7 +14,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // f(bool): true -> true | ||||
|  | ||||
| @ -11,7 +11,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // f(bool): true -> true | ||||
|  | ||||
| @ -37,7 +37,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // ---- | ||||
| // f(address): 0x1234 -> false | ||||
| // f(address): 0x00 -> true | ||||
|  | ||||
| @ -1,9 +1,11 @@ | ||||
| contract C { | ||||
| 	// If these two functions are identical, the optimiser | ||||
| 	// on the old codegen path can deduplicate them, and breaking the test. | ||||
| 	function internal1() internal pure returns (bool) { | ||||
| 		return true; | ||||
| 	} | ||||
| 	function internal2() internal pure returns (bool) { | ||||
| 		return true; | ||||
| 		return false; | ||||
| 	} | ||||
| 
 | ||||
| 	function equal() public pure returns (bool same, bool diff, bool inv) { | ||||
| @ -23,7 +25,7 @@ contract C { | ||||
| 	} | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // equal() -> true, false, false | ||||
|  | ||||
| @ -5,7 +5,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // f() -> 0x78 | ||||
|  | ||||
| @ -7,7 +7,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // g() -> 0x1234567800000000000000000000000000000000000000000000000000000000 | ||||
|  | ||||
| @ -5,7 +5,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // f(uint256): 0x12345678 -> 0x78 | ||||
|  | ||||
| @ -9,7 +9,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // f() -> 0x78 | ||||
|  | ||||
| @ -12,7 +12,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // g() -> 0x78 | ||||
|  | ||||
| @ -8,7 +8,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // f() -> 0x78 | ||||
|  | ||||
| @ -19,7 +19,7 @@ contract C { | ||||
| 	} | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // call_deleted_internal_func() -> FAILURE | ||||
|  | ||||
| @ -17,7 +17,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // f() -> 0 | ||||
|  | ||||
| @ -60,7 +60,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // f(bool): 0 -> 23 | ||||
|  | ||||
| @ -8,7 +8,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // ---- | ||||
| // keccak1() -> 0x64e604787cbf194841e7b68d7cd28786f6c9a0a3ab9f8b0a0e87cb4387ab0107 | ||||
| // keccak2() -> 0x64e604787cbf194841e7b68d7cd28786f6c9a0a3ab9f8b0a0e87cb4387ab0107 | ||||
|  | ||||
| @ -5,7 +5,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // f(address): 0x1234 -> 0x1234 | ||||
|  | ||||
| @ -5,7 +5,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // f(uint256): 6 -> 6 | ||||
|  | ||||
| @ -5,7 +5,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // f(bool): true -> true | ||||
|  | ||||
| @ -24,7 +24,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // f() -> 2 | ||||
|  | ||||
| @ -30,7 +30,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // f() -> 11 | ||||
|  | ||||
| @ -27,7 +27,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // f() -> 1 | ||||
|  | ||||
| @ -30,7 +30,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // f() -> 1024 | ||||
|  | ||||
| @ -5,6 +5,6 @@ contract C { | ||||
| 	} | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // ---- | ||||
| // set(string): 0x20, 32, "01234567890123456789012345678901" -> | ||||
|  | ||||
| @ -6,7 +6,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // test() -> true | ||||
|  | ||||
| @ -5,7 +5,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // f() -> 7 | ||||
|  | ||||
| @ -6,7 +6,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // f() -> 255 | ||||
|  | ||||
| @ -9,7 +9,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // or(uint256): 0 -> true, 0 | ||||
|  | ||||
| @ -5,7 +5,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // f(uint256,uint256): 5, 6 -> 5, 6 | ||||
|  | ||||
| @ -12,7 +12,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // f() -> 6 | ||||
|  | ||||
| @ -1,7 +1,7 @@ | ||||
| contract C { | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // allowNonExistingFunctions: true | ||||
| // ---- | ||||
|  | ||||
| @ -29,7 +29,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // ---- | ||||
| // test_simple(uint256): 0 -> 3, 4, 5 | ||||
| // test_simple(uint256): 1 -> 3, 4, 5 | ||||
|  | ||||
| @ -11,7 +11,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // f(uint8): 6 -> 9 | ||||
|  | ||||
| @ -11,7 +11,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // setX(uint256): 6 -> 6 | ||||
|  | ||||
| @ -5,7 +5,7 @@ contract C { | ||||
| 	function h() external pure returns (bytes4) { return 0xcafecafe; } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // f1() -> 0x20, 6, left(0x616263616263) | ||||
|  | ||||
| @ -19,7 +19,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // short_dyn() -> 0x20, 3, "abc" | ||||
|  | ||||
| @ -18,7 +18,7 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // f() -> 70 | ||||
|  | ||||
| @ -24,7 +24,7 @@ contract C is X { | ||||
|     } | ||||
| } | ||||
| // ==== | ||||
| // compileViaYul: true | ||||
| // compileViaYul: also | ||||
| // compileToEwasm: also | ||||
| // ---- | ||||
| // f() -> 3 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user