Merge pull request #10394 from ethereum/viayul-tests

Switch compileViaYul to also where appropriate
This commit is contained in:
Đorđe Mijović 2020-11-25 16:46:30 +01:00 committed by GitHub
commit 7eb5fc31f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
54 changed files with 74 additions and 52 deletions

View File

@ -39,7 +39,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// ---- // ----
// f() -> 0 // f() -> 0
// g() -> 0 // g() -> 0

View File

@ -8,7 +8,7 @@ contract B is A {
uint public y = f(); uint public y = f();
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// constructor() -> // constructor() ->

View File

@ -12,6 +12,6 @@ contract D {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// ---- // ----
// f() -> true // f() -> true

View File

@ -12,6 +12,6 @@ contract D {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// ---- // ----
// f() -> 2 // f() -> 2

View File

@ -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"

View File

@ -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"

View File

@ -18,7 +18,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// ---- // ----
// test(uint256,uint256): 0,0 -> FAILURE // test(uint256,uint256): 0,0 -> FAILURE
// test(uint256,uint256): 1,0 -> 1 // test(uint256,uint256): 1,0 -> 1

View File

@ -6,7 +6,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// ---- // ----
// create(uint256): 0 -> 0 // create(uint256): 0 -> 0
// create(uint256): 7 -> 7 // create(uint256): 7 -> 7

View File

@ -22,7 +22,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// ---- // ----
// index(uint256): 0 -> true // index(uint256): 0 -> true
// index(uint256): 10 -> true // index(uint256): 10 -> true

View File

@ -14,7 +14,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// ---- // ----
// test_indices(uint256): 1 -> // test_indices(uint256): 1 ->
// test_indices(uint256): 129 -> // test_indices(uint256): 129 ->

View File

@ -10,7 +10,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// ---- // ----
// test_boundary_check(uint256, uint256): 10, 11 -> FAILURE // test_boundary_check(uint256, uint256): 10, 11 -> FAILURE
// test_boundary_check(uint256, uint256): 10, 9 -> 0 // test_boundary_check(uint256, uint256): 10, 9 -> 0

View File

@ -50,7 +50,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// ---- // ----
// test_zeroed_indicies(uint256): 1 -> // test_zeroed_indicies(uint256): 1 ->
// test_zeroed_indicies(uint256): 5 -> // test_zeroed_indicies(uint256): 5 ->

View File

@ -7,7 +7,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// ---- // ----
// set_get_length(uint256): 0 -> 0 // set_get_length(uint256): 0 -> 0
// set_get_length(uint256): 1 -> 1 // set_get_length(uint256): 1 -> 1

View File

@ -6,6 +6,6 @@ contract C {
} }
// ==== // ====
// EVMVersion: >=petersburg // EVMVersion: >=petersburg
// compileViaYul: true // compileViaYul: also
// ---- // ----
// popEmpty() -> FAILURE // popEmpty() -> FAILURE

View File

@ -9,7 +9,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// EVMVersion: >=petersburg // EVMVersion: >=petersburg
// ---- // ----
// pushEmpty(uint256): 128 // pushEmpty(uint256): 128

View File

@ -10,7 +10,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// EVMVersion: >=petersburg // EVMVersion: >=petersburg
// ---- // ----
// set_get_length(uint256): 0 -> 0 // set_get_length(uint256): 0 -> 0

View File

@ -9,7 +9,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// ---- // ----
// set_get_length(uint256): 0 -> 0 // set_get_length(uint256): 0 -> 0
// set_get_length(uint256): 1 -> 0 // set_get_length(uint256): 1 -> 0

View File

@ -14,7 +14,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// f(bool): true -> true // f(bool): true -> true

View File

@ -11,7 +11,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// f(bool): true -> true // f(bool): true -> true

View File

@ -37,7 +37,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// ---- // ----
// f(address): 0x1234 -> false // f(address): 0x1234 -> false
// f(address): 0x00 -> true // f(address): 0x00 -> true

View File

@ -1,9 +1,11 @@
contract C { 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) { function internal1() internal pure returns (bool) {
return true; return true;
} }
function internal2() internal pure returns (bool) { function internal2() internal pure returns (bool) {
return true; return false;
} }
function equal() public pure returns (bool same, bool diff, bool inv) { function equal() public pure returns (bool same, bool diff, bool inv) {
@ -23,7 +25,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// equal() -> true, false, false // equal() -> true, false, false

View File

@ -5,7 +5,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// f() -> 0x78 // f() -> 0x78

View File

@ -7,7 +7,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// g() -> 0x1234567800000000000000000000000000000000000000000000000000000000 // g() -> 0x1234567800000000000000000000000000000000000000000000000000000000

View File

@ -5,7 +5,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// f(uint256): 0x12345678 -> 0x78 // f(uint256): 0x12345678 -> 0x78

View File

@ -9,7 +9,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// f() -> 0x78 // f() -> 0x78

View File

@ -12,7 +12,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// g() -> 0x78 // g() -> 0x78

View File

@ -8,7 +8,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// f() -> 0x78 // f() -> 0x78

View File

@ -19,7 +19,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// call_deleted_internal_func() -> FAILURE // call_deleted_internal_func() -> FAILURE

View File

@ -17,7 +17,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// f() -> 0 // f() -> 0

View File

@ -60,7 +60,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// f(bool): 0 -> 23 // f(bool): 0 -> 23

View File

@ -8,7 +8,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// ---- // ----
// keccak1() -> 0x64e604787cbf194841e7b68d7cd28786f6c9a0a3ab9f8b0a0e87cb4387ab0107 // keccak1() -> 0x64e604787cbf194841e7b68d7cd28786f6c9a0a3ab9f8b0a0e87cb4387ab0107
// keccak2() -> 0x64e604787cbf194841e7b68d7cd28786f6c9a0a3ab9f8b0a0e87cb4387ab0107 // keccak2() -> 0x64e604787cbf194841e7b68d7cd28786f6c9a0a3ab9f8b0a0e87cb4387ab0107

View File

@ -5,7 +5,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// f(address): 0x1234 -> 0x1234 // f(address): 0x1234 -> 0x1234

View File

@ -5,7 +5,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// f(uint256): 6 -> 6 // f(uint256): 6 -> 6

View File

@ -5,7 +5,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// f(bool): true -> true // f(bool): true -> true

View File

@ -24,7 +24,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// f() -> 2 // f() -> 2

View File

@ -30,7 +30,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// f() -> 11 // f() -> 11

View File

@ -27,7 +27,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// f() -> 1 // f() -> 1

View File

@ -30,7 +30,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// f() -> 1024 // f() -> 1024

View File

@ -5,6 +5,6 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// ---- // ----
// set(string): 0x20, 32, "01234567890123456789012345678901" -> // set(string): 0x20, 32, "01234567890123456789012345678901" ->

View File

@ -6,7 +6,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// test() -> true // test() -> true

View File

@ -5,7 +5,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// f() -> 7 // f() -> 7

View File

@ -6,7 +6,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// f() -> 255 // f() -> 255

View File

@ -9,7 +9,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// or(uint256): 0 -> true, 0 // or(uint256): 0 -> true, 0

View File

@ -5,7 +5,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// f(uint256,uint256): 5, 6 -> 5, 6 // f(uint256,uint256): 5, 6 -> 5, 6

View File

@ -12,7 +12,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// f() -> 6 // f() -> 6

View File

@ -1,7 +1,7 @@
contract C { contract C {
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// allowNonExistingFunctions: true // allowNonExistingFunctions: true
// ---- // ----

View File

@ -29,7 +29,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// ---- // ----
// test_simple(uint256): 0 -> 3, 4, 5 // test_simple(uint256): 0 -> 3, 4, 5
// test_simple(uint256): 1 -> 3, 4, 5 // test_simple(uint256): 1 -> 3, 4, 5

View File

@ -11,7 +11,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// f(uint8): 6 -> 9 // f(uint8): 6 -> 9

View File

@ -11,7 +11,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// setX(uint256): 6 -> 6 // setX(uint256): 6 -> 6

View File

@ -5,7 +5,7 @@ contract C {
function h() external pure returns (bytes4) { return 0xcafecafe; } function h() external pure returns (bytes4) { return 0xcafecafe; }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// f1() -> 0x20, 6, left(0x616263616263) // f1() -> 0x20, 6, left(0x616263616263)

View File

@ -19,7 +19,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// short_dyn() -> 0x20, 3, "abc" // short_dyn() -> 0x20, 3, "abc"

View File

@ -18,7 +18,7 @@ contract C {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// f() -> 70 // f() -> 70

View File

@ -24,7 +24,7 @@ contract C is X {
} }
} }
// ==== // ====
// compileViaYul: true // compileViaYul: also
// compileToEwasm: also // compileToEwasm: also
// ---- // ----
// f() -> 3 // f() -> 3