Enable more semantic tests for Ewasm

This commit is contained in:
Alex Beregszaszi 2021-04-23 16:59:01 +01:00
parent 55577cbfc3
commit f952f851b7
113 changed files with 117 additions and 4 deletions

View File

@ -12,6 +12,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f((int16,uint8,bytes2)): 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01, 0xff, "ab" -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01, 0xff, "ab"
// f((int16,uint8,bytes2)): 0xff010, 0xff, "ab" -> FAILURE

View File

@ -8,6 +8,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f((function)): "01234567890123456789abcd" -> 1
// f((function)): "01234567890123456789abcdX" -> FAILURE

View File

@ -17,6 +17,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f0() -> 0x20, 4, 8234104107246695022420661102507966550300666591269321702959126607540084801536
// f1() -> 0x20, 0x64, 8234104107246695022420661102507966550300666591269321702959126607540084801536, 862718293348820473429344482784628181556388621521298319395315527974912, 91135606241822717681769169345594720818313984248279388438121731325952, 0

View File

@ -26,6 +26,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f0() -> 0x20, 4, 8234104107246695022420661102507966550300666591269321702959126607540084801536
// f1() -> 0x20, 0x64, 8234104107246695022420661102507966550300666591269321702959126607540084801536, 862718293348820473429344482784628181556388621521298319395315527974912, 91135606241822717681769169345594720818313984248279388438121731325952, 0

View File

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

View File

@ -26,5 +26,6 @@ contract Test {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// withinArray() -> FAILURE

View File

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

View File

@ -10,6 +10,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f(uint16,uint16,uint16): 0xe000, 0xe500, 2 -> 58626
// f(uint16,uint16,uint16): 0x1000, 0xe500, 0xe000 -> FAILURE, hex"4e487b71", 0x11

View File

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

View File

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

View File

@ -21,6 +21,7 @@ contract c {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// test() -> 3, 4
// gas irOptimized: 191158

View File

@ -11,6 +11,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// test() -> left(0x01), left(0x02)
// gas legacy: 154001

View File

@ -17,6 +17,7 @@ contract c {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// test() -> 0xffffffff, 0x0000000000000000000000000a00090008000700060005000400030002000100, 0x0000000000000000000000000000000000000000000000000000000000000000
// gas irOptimized: 218618

View File

@ -19,6 +19,7 @@ contract c {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// test() -> 0x04000000000000000000000000000000000000000000000000, 0x0, 0x0
// gas irOptimized: 107728

View File

@ -19,6 +19,7 @@ contract c {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// test() -> 0x01000000000000000000000000000000000000000000000000, 0x02000000000000000000000000000000000000000000000000, 0x03000000000000000000000000000000000000000000000000, 0x04000000000000000000000000000000000000000000000000, 0x0
// gas irOptimized: 288892

View File

@ -19,6 +19,7 @@ contract c {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// test() -> 0x01000000000000000000000000000000000000000000000000, 0x02000000000000000000000000000000000000000000000000, 0x03000000000000000000000000000000000000000000000000, 0x04000000000000000000000000000000000000000000000000, 0x00
// gas irOptimized: 263885

View File

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

View File

@ -15,6 +15,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// to_little_endian_64(uint64): 0 -> 0x20, 8, 0x00
// to_little_endian_64(uint64): 0x0102030405060708 -> 0x20, 8, 0x0807060504030201000000000000000000000000000000000000000000000000

View File

@ -12,6 +12,7 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// test() ->
// tester() -> 0x20, 0x3, "abc"

View File

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

View File

@ -18,5 +18,6 @@ contract Sample {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// p(uint256): 0x0 -> 0xbbbb, 0xcccc, 0x80, 0xc0, 0x05, "hello", 0x05, "world"

View File

@ -30,6 +30,7 @@ contract buggystruct {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// getFirst() -> 0x0a
// getSecond() -> 0x14

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -22,12 +22,13 @@ contract test {
}
// ====
// EVMVersion: >=byzantium
// compileViaYul: also
// compileToEwasm: also
// EVMVersion: >=byzantium
// ----
// getChoiceExp(uint256): 2 -> 2
// getChoiceExp(uint256): 3 -> FAILURE, hex"4e487b71", 33 # These should throw #
// getChoiceFromSigned(int256): -1 -> FAILURE, hex"4e487b71", 33
// getChoiceFromMax() -> FAILURE, hex"4e487b71", 33
// getChoiceExp(uint256): 3 -> FAILURE, hex"4e487b71", 0x21 # These should throw #
// getChoiceFromSigned(int256): -1 -> FAILURE, hex"4e487b71", 0x21
// getChoiceFromMax() -> FAILURE, hex"4e487b71", 0x21
// getChoiceExp(uint256): 2 -> 2 # These should work #
// getChoiceExp(uint256): 0 -> 0

View File

@ -6,5 +6,6 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> FAILURE, hex"85208890", hex"0000000000000000000000000000000000000000000000000000000000000002", hex"0000000000000000000000000000000000000000000000000000000000000007"

View File

@ -13,6 +13,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// a() -> FAILURE, hex"002ff067", hex"0000000000000000000000000000000000000000000000000000000000000001"
// b() -> FAILURE, hex"002ff067", hex"0000000000000000000000000000000000000000000000000000000000000001"

View File

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

View File

@ -15,6 +15,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f(bool): true -> FAILURE, hex"e96e07f0", hex"0000000000000000000000000000000000000000000000000000000000000002", hex"0000000000000000000000000000000000000000000000000000000000000060", hex"0000000000000000000000000000000000000000000000000000000000000007", hex"0000000000000000000000000000000000000000000000000000000000000009", hex"0000000000000000000000000000000000000000000000000000000000000040", hex"0000000000000000000000000000000000000000000000000000000000000003", hex"6162630000000000000000000000000000000000000000000000000000000000"
// f(bool): false -> FAILURE, hex"e96e07f0", hex"0000000000000000000000000000000000000000000000000000000000000002", hex"0000000000000000000000000000000000000000000000000000000000000060", hex"0000000000000000000000000000000000000000000000000000000000000007", hex"0000000000000000000000000000000000000000000000000000000000000009", hex"0000000000000000000000000000000000000000000000000000000000000040", hex"0000000000000000000000000000000000000000000000000000000000000003", hex"6162630000000000000000000000000000000000000000000000000000000000"

View File

@ -12,6 +12,7 @@ contract B is A {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> FAILURE, hex"002ff067", hex"0000000000000000000000000000000000000000000000000000000000000001"
// g() -> FAILURE, hex"002ff067", hex"0000000000000000000000000000000000000000000000000000000000000001"

View File

@ -19,6 +19,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// x() -> FAILURE, hex"002ff067", hex"0000000000000000000000000000000000000000000000000000000000000001"
// y() -> FAILURE, hex"002ff067", hex"0000000000000000000000000000000000000000000000000000000000000002"

View File

@ -6,5 +6,6 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> FAILURE, hex"b48fb6cf", hex"0000000000000000000000000000000000000000000000000000000000000002"

View File

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

View File

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

View File

@ -6,6 +6,7 @@ contract A {
contract B is A {}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// getData() -> 0
// (): 42 ->

View File

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

View File

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

View File

@ -10,5 +10,6 @@ contract C is B {
}
// ====
// compileViaYul: true
// compileToEwasm: also
// ----
// test() -> 0xcf9f23b500000000000000000000000000000000000000000000000000000000, 0x7defb41000000000000000000000000000000000000000000000000000000000, 0xcf9f23b500000000000000000000000000000000000000000000000000000000, 0x7defb41000000000000000000000000000000000000000000000000000000000

View File

@ -10,5 +10,6 @@ contract D {
}
// ====
// compileViaYul: true
// compileToEwasm: also
// ----
// test() -> 0xcf9f23b500000000000000000000000000000000000000000000000000000000, 0x7defb41000000000000000000000000000000000000000000000000000000000

View File

@ -6,5 +6,6 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// b() -> 0x20, 0x03, 0x6162630000000000000000000000000000000000000000000000000000000000

View File

@ -11,6 +11,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// a() -> 0x20, 11, "hello world"
// b() -> 0x20, 4, "ABCD"

View File

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

View File

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

View File

@ -24,6 +24,7 @@ contract Test is C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// c() -> 0x20, 1, "C"
// a() -> 0x20, 1, "A"

View File

@ -14,6 +14,7 @@ contract C is A {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// x() -> 7
// f() -> 9

View File

@ -17,6 +17,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// x() -> 0x00
// f() -> 1, 9

View File

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

View File

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

View File

@ -10,6 +10,7 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// getOne() -> 0
// getOne(), 1 wei -> 1

View File

@ -47,5 +47,6 @@ contract C is A {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// getData() -> 0x4300

View File

@ -15,5 +15,6 @@ contract C is A {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> false

View File

@ -24,5 +24,6 @@ contract C is A {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// getData() -> 6

View File

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

View File

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

View File

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

View File

@ -12,6 +12,7 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f(uint256): 3 -> 10
// a() -> 10

View File

@ -15,6 +15,7 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f(uint256): 3 -> 10
// a() -> 0

View File

@ -17,5 +17,6 @@ contract C is A {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> false

View File

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

View File

@ -28,6 +28,7 @@ contract A {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> 0x10, 0x20, 0x40
// x() -> 1

View File

@ -11,6 +11,7 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// called() -> 0x00
// f(uint256): 5 -> 0x0100000000

View File

@ -3,5 +3,6 @@ contract A { modifier m1{_;} }
contract B is A { constructor() A() m1{} }
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// constructor() ->

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -14,6 +14,7 @@ contract C {
}
// ====
// compileViaYul: true
// compileToEwasm: also
// ----
// l(uint8): 64 -> 0x3930313233343536373839306162636465000000000000000000000000000000
// r(uint8): 64 -> 0x313233343536373839303132000000000000000000000000

View File

@ -6,6 +6,7 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f(int256,uint256): -4266, 0 -> -4266
// f(int256,uint256): -4266, 1 -> -2133

View File

@ -7,6 +7,7 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f(int256,uint256): -4266, 0 -> -4266
// f(int256,uint256): -4266, 1 -> -2133

View File

@ -6,6 +6,7 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f(int16,uint16): -4266, 0 -> -4266
// f(int16,uint16): -4266, 1 -> -2133

View File

@ -6,6 +6,7 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f(int32,uint32): -4266, 0 -> -4266
// f(int32,uint32): -4266, 1 -> -2133

View File

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

View File

@ -39,6 +39,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f(uint256): 0x0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f -> 0x1f, 0x1f, 3
// g(uint256): 0x0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f -> 1, 3, 5

View File

@ -15,6 +15,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f(), 27 wei -> FAILURE
// balance() -> 0

View File

@ -12,6 +12,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> FAILURE, hex"f8a8fd6d"
// g(uint256): 7 -> 7

View File

@ -30,6 +30,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// d() ->
// e(), 1 wei -> 1

View File

@ -10,6 +10,7 @@ contract A {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// data() -> 0
// ()

View File

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

View File

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

View File

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

View File

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

View File

@ -66,6 +66,7 @@ contract Test {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// load() -> 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
// gas irOptimized: 111580

View File

@ -52,6 +52,7 @@ contract Test {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// testInit() -> 0, 0, 0, 0, true
// testCopyRead() -> 1, 2, 3, 4

View File

@ -29,6 +29,7 @@ contract C {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> 42, 23, 34, 42, 42
// gas irOptimized: 108610

View File

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

View File

@ -8,6 +8,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> true
// g(function): hex"00000000000000000000000000000000000004226121ff00000000000000000" -> 0x42

View File

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

View File

@ -20,6 +20,7 @@ contract X is A
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// test() -> 0, 64, 0
// set() ->

View File

@ -14,6 +14,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// constructor() ->
// initCode() -> 0x20, 0

View File

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

View File

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

View File

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

View File

@ -18,6 +18,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f1() ->
// x() -> 0x08

View File

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

View File

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

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