Turn on semantic tests for the old codegen where possible

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.
This commit is contained in:
Alex Beregszaszi 2020-11-24 23:25:42 +00:00
parent f02bc817af
commit 159f50e189
54 changed files with 74 additions and 52 deletions

View File

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

View File

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

View File

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

View File

@ -12,6 +12,6 @@ contract D {
}
}
// ====
// compileViaYul: true
// compileViaYul: also
// ----
// 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): 1,0 -> 1

View File

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

View File

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

View File

@ -14,7 +14,7 @@ contract C {
}
}
// ====
// compileViaYul: true
// compileViaYul: also
// ----
// test_indices(uint256): 1 ->
// 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, 9 -> 0

View File

@ -50,7 +50,7 @@ contract C {
}
}
// ====
// compileViaYul: true
// compileViaYul: also
// ----
// test_zeroed_indicies(uint256): 1 ->
// 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): 1 -> 1

View File

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

View File

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

View File

@ -10,7 +10,7 @@ contract C {
}
}
// ====
// compileViaYul: true
// compileViaYul: also
// EVMVersion: >=petersburg
// ----
// 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): 1 -> 0

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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