Merge pull request #10368 from ethereum/ewasm-polyfill-calldataload-calldatacopy-tests

[ewasm] Polyfill: calldataload & calldatacopy: Enable Tests.
This commit is contained in:
Alex Beregszaszi 2020-11-21 14:45:27 +00:00 committed by GitHub
commit 8bf455bb49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
432 changed files with 460 additions and 36 deletions

View File

@ -30,6 +30,7 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f0() -> 0x20, 0x0
// f1() -> 0x20, 0x40, 0x1, 0x2

View File

@ -7,5 +7,6 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> 0x21, 0x40, 0x7, "abcdefg"

View File

@ -7,5 +7,6 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> 0x20, 0x40, 0x1, -2

View File

@ -5,5 +5,6 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f(uint256,uint256[],uint256): 6, 0x60, 9, 0x8000000000000000000000000000000000000000000000000000000000000002, 1, 2 -> FAILURE
// f(uint256,uint256[],uint256): 6, 0x60, 9, 0x8000000000000000000000000000000000000000000000000000000000000002, 1, 2 -> FAILURE

View File

@ -8,5 +8,6 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f(uint256,uint256): 42, 23 -> 42, 23, 42, 23

View File

@ -11,5 +11,6 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> 0x40, 0xa0, 0x40, 0x20, 0x0, 0x0

View File

@ -10,5 +10,6 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> 0x20, 0x40, 0x1, -2

View File

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

View File

@ -7,6 +7,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f(uint256[][2][]): 0x20, 0x01, 0x20, 0x40, 0x60, 0x00, 0x00 -> 23 # this is the common encoding for x.length == 1 && x[0][0].length == 0 && x[0][1].length == 0 #
// f(uint256[][2][]): 0x20, 0x01, 0x20, 0x00, 0x00 -> 23 # exotic, but still valid encoding #

View File

@ -8,6 +8,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f(uint16,int16,address,bytes3,bool): 1, 2, 3, "a", true -> 1, 2, 3, "a", true
// f(uint16,int16,address,bytes3,bool): 0xffffff, 0x1ffff, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, "abcd", 1 -> FAILURE

View File

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

View File

@ -8,6 +8,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f((int256,uint256,bytes16)): 0xff010, 0xff0002, "abcd" -> 0xff010, 0xff0002, "abcd"
// f((int256,uint256,bytes16)): 0xff010, 0xff0002, 0x1111222233334444555566667777888800000000000000000000000000000000 -> 0xff010, 0xff0002, left(0x11112222333344445555666677778888)

View File

@ -11,5 +11,6 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f((uint256,uint8,uint8,bytes2)): 1, 2, 3, "ab" -> 1, 2, 3, 0x6162

View File

@ -3,5 +3,6 @@ contract Lotto {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// ticketPrice() -> 555

View File

@ -4,5 +4,6 @@ contract Lotto {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// ticketPrice() -> 500

View File

@ -10,5 +10,6 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// test() -> 0

View File

@ -20,6 +20,7 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f(uint256): 0 -> FAILURE
// g(uint256): 0 -> FAILURE

View File

@ -9,6 +9,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// div(uint256,uint256): 7, 2 -> 3
// div(uint256,uint256): 7, 0 -> FAILURE # throws #

View File

@ -13,5 +13,6 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f(uint256[2]): 42, 23 -> 42, 23

View File

@ -13,6 +13,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f(uint256[][]): 0x20, 0x0 -> 42 # valid access stub #
// f(uint256[][]): 0x20, 0x1 -> FAILURE # invalid on argument decoding #

View File

@ -22,5 +22,6 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f((uint256,uint256)[]): 0x20, 0x2, 0x1, 0x2, 0x3, 0x4 -> 2, 1, 2, 3, 4

View File

@ -8,6 +8,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f(uint256[],uint256,uint256): 0x80, 0, 0, 0, 1, 42 ->
// f(uint256[],uint256,uint256): 0x80, 0, 1, 0, 1, 42 ->

View File

@ -12,5 +12,6 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> 1, 2, 3

View File

@ -8,5 +8,6 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> "a"

View File

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

View File

@ -7,5 +7,6 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f(bytes): 0x20, 0x08, "abcdefgh" -> "a"

View File

@ -19,6 +19,7 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// one() -> 3
// two() -> FAILURE

View File

@ -11,5 +11,6 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> 2, 3, 4

View File

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

View File

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

View File

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

View File

@ -14,6 +14,7 @@ contract A {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// test() -> false
// testIt() -> FAILURE

View File

@ -8,5 +8,6 @@ contract c {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// test(uint256[8],uint256[],uint256[5],uint256,uint256,uint256): 1, 2, 3, 4, 5, 6, 7, 8, 0x220, 21, 22, 23, 24, 25, 0, 1, 2, 3, 11, 12, 13 -> 1, 12, 23

View File

@ -9,6 +9,7 @@ contract c {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// storage: empty
// fill() ->

View File

@ -35,6 +35,7 @@ contract c {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// setIDStatic(uint256): 0xb ->
// getID(uint256): 0x2 -> 0xb

View File

@ -7,5 +7,6 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f(bytes32): "789" -> 32, 16, 8

View File

@ -17,6 +17,7 @@ contract c {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// length() -> 4
// set(uint256,uint256): 3, 4 -> true

View File

@ -32,6 +32,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// test(uint256,uint256): 10, 0 -> 11
// test(uint256,uint256): 10, 1 -> 12

View File

@ -6,5 +6,6 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> 3

View File

@ -12,5 +12,6 @@ contract Test {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x07

View File

@ -13,5 +13,6 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> 1, 2, 3, 4, 5

View File

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

View File

@ -9,5 +9,6 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> 3, 6

View File

@ -10,5 +10,6 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> 0x40, 0x80, 0x3, "ray", 0x2, "mi"

View File

@ -7,6 +7,7 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f(uint256): 0 -> 0x20, 0x4, "This"
// f(uint256): 1 -> 0x20, 0x2, "is"

View File

@ -8,5 +8,6 @@ contract c {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// test() -> FAILURE

View File

@ -10,5 +10,6 @@ contract c {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// test() -> 3

View File

@ -14,5 +14,6 @@ contract c {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// test() -> 2, 1, 1

View File

@ -11,5 +11,6 @@ contract c {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// test() -> FAILURE

View File

@ -10,5 +10,6 @@ contract c {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// test() -> 3

View File

@ -11,6 +11,7 @@ contract c {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// test() ->
// storage: empty

View File

@ -15,5 +15,6 @@ contract c {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// test() -> false

View File

@ -9,6 +9,7 @@ contract c {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// storage: empty
// fill() ->

View File

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

View File

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

View File

@ -15,6 +15,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f(uint256): 0 -> 2
// f(uint256): 1 -> 18

View File

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

View File

@ -11,6 +11,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> 0x3737373737373737373737373737373737373737373737373737373737373738
// g() -> 0x3737373737373737373737373737373737373737373737373737373737373739

View File

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

View File

@ -21,6 +21,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> 0x26121ff000000000000000000000000000000000000000000000000000000000
// g() -> 0x26121ff000000000000000000000000000000000000000000000000000000000

View File

@ -6,5 +6,6 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470

View File

@ -5,5 +5,6 @@ contract test {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// foo(uint256): 0x0 -> 0x2fbebd3800000000000000000000000000000000000000000000000000000000

View File

@ -9,5 +9,6 @@ contract test {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// foo(uint256): 0x0 -> 0x2fbebd3800000000000000000000000000000000000000000000000000000000

View File

@ -36,6 +36,7 @@ contract test {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> 3
// g() -> 0

View File

@ -18,6 +18,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f((uint8,bytes1)): 0x12, hex"3400000000000000000000000000000000000000000000000000000000000000" -> 0x12, hex"3400000000000000000000000000000000000000000000000000000000000000" # double check that the valid case goes through #
// f((uint8,bytes1)): 0x1234, hex"5678000000000000000000000000000000000000000000000000000000000000" -> FAILURE

View File

@ -13,6 +13,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f(bool): 0x0 -> 0x0
// f(bool): 0x1 -> 0x1

View File

@ -28,6 +28,7 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> 0x1122334455667788990011223344556677889900
// g() -> 0x1122334455667788990011223344556677889900

View File

@ -15,6 +15,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f(address): 0xffff1234567890123456789012345678901234567890 -> FAILURE # We input longer data on purpose.#
// g(address): 0xffff1234567890123456789012345678901234567890 -> FAILURE

View File

@ -12,5 +12,6 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> "\xff\xff\xff\xff"

View File

@ -12,5 +12,6 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f(bytes2,uint16): "abc", 0x40102 -> FAILURE # We input longer data on purpose. #

View File

@ -10,5 +10,6 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// test() -> 0xff, 0xff

View File

@ -10,5 +10,6 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> 0x00

View File

@ -18,6 +18,7 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> 0x20, 3, "\x03\x01\x02"
// g() -> 0x20, 3, "\x03\x01\x02"

View File

@ -26,6 +26,7 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> 0x20, 3, "\x03\x01\x02"
// g() -> 0x20, 3, "\x03\x01\x02"

View File

@ -7,5 +7,6 @@ contract Foo {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// constructor() ->

View File

@ -34,8 +34,9 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> 0x20, 3, "\x03\x01\x02"
// g() -> 0x20, 3, "\x03\x01\x02"
// h() -> 5
// i() -> 0x20, 3, "\x03\x01\x02"
// i() -> 0x20, 3, "\x03\x01\x02"

View File

@ -22,5 +22,6 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> 0x0d, 0x59, 0x59, 0x59

View File

@ -8,5 +8,6 @@ contract Foo {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// getX() -> 56

View File

@ -16,6 +16,7 @@ contract B {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// testIt() ->
// test() -> 2

View File

@ -17,5 +17,6 @@ contract Test {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// getName() -> "abc"

View File

@ -27,5 +27,6 @@ contract Test {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// getName() -> "def\x00\x00\x00"

View File

@ -16,6 +16,7 @@ contract Derived is Base {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// getBMember() -> 5
// getDMember() -> 6

View File

@ -4,5 +4,6 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// constructor(), 27 wei ->

View File

@ -18,6 +18,7 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// use(uint256): 3 -> 6
// result_in_constructor() -> 4

View File

@ -19,6 +19,7 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// use(uint16): 3 -> 0xfff9
// result_in_constructor() -> 0xfffb

View File

@ -16,5 +16,6 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// t() -> 7

View File

@ -9,6 +9,7 @@ contract B is A {
}
// ====
// compileViaYul: true
// compileToEwasm: also
// ----
// constructor() ->
// y() -> 42

View File

@ -12,6 +12,7 @@ contract B is A {
}
// ====
// compileViaYul: true
// compileToEwasm: also
// ----
// constructor() ->
// y() -> 42

View File

@ -10,5 +10,6 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f(bytes): 0x20, 0x04, "dead" -> true

View File

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

View File

@ -9,5 +9,6 @@ contract test {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> 10

View File

@ -8,5 +8,6 @@ contract c {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// test() -> 1

View File

@ -23,6 +23,7 @@ contract test {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// getChoiceExp(uint256): 3 -> FAILURE # These should throw #
// getChoiceFromSigned(int256): -1 -> FAILURE

View File

@ -8,5 +8,6 @@ contract test {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// answer() -> 1

View File

@ -14,5 +14,6 @@ contract test {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// getChoice() -> 2

View File

@ -10,5 +10,6 @@ contract test is base {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// answer() -> 1

View File

@ -10,5 +10,6 @@ contract test is base {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// answer() -> 1

View File

@ -12,5 +12,6 @@ contract test {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> 9, -27

View File

@ -15,5 +15,6 @@ contract test {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> 3855, 268374015, 268370160

View File

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

Some files were not shown because too many files have changed in this diff Show More