[ewasm] Polyfill: balance & address: Update Tests.

This commit is contained in:
Alexander Arlt 2020-11-21 15:05:39 -05:00
parent 87e3fbee6c
commit f928107181
46 changed files with 143 additions and 108 deletions

View File

@ -19,19 +19,19 @@ object "object" {
mstore_internal(32:i32, _1, _1, _1, 1)
eth.storageStore(0:i32, 32:i32)
}
function bswap16(x) -> y
function bswap16(x:i32) -> y:i32
{
y := i64.or(i64.and(i64.shl(x, 8), 0xff00), i64.and(i64.shr_u(x, 8), 0xff))
y := i32.or(i32.and(i32.shl(x, 8:i32), 0xff00:i32), i32.and(i32.shr_u(x, 8:i32), 0xff:i32))
}
function bswap32(x) -> y
function bswap32(x:i32) -> y:i32
{
let hi := i64.shl(bswap16(x), 16)
y := i64.or(hi, bswap16(i64.shr_u(x, 16)))
let hi:i32 := i32.shl(bswap16(x), 16:i32)
y := i32.or(hi, bswap16(i32.shr_u(x, 16:i32)))
}
function bswap64(x) -> y
{
let hi := i64.shl(bswap32(x), 32)
y := i64.or(hi, bswap32(i64.shr_u(x, 32)))
let hi := i64.shl(i64.extend_i32_u(bswap32(i32.wrap_i64(x))), 32)
y := i64.or(hi, i64.extend_i32_u(bswap32(i32.wrap_i64(i64.shr_u(x, 32)))))
}
function mstore_internal(pos:i32, y1, y2, y3, y4)
{
@ -45,7 +45,7 @@ object "object" {
Binary representation:
0061736d0100000001160460000060017e017e60057f7e7e7e7e0060027f7f0002190108657468657265756d0c73746f7261676553746f7265000303060500010101020503010001060100071102066d656d6f72790200046d61696e00010abc01052901017e0240420021004100200020002000200010054120200020002000420110054100412010000b0b1f01017e024020004208864280fe0383200042088842ff01838421010b20010b1e01027e02402000100242108621022002200042108810028421010b20010b1e01027e02402000100342208621022002200042208810038421010b20010b32000240200020011004370000200041086a20021004370000200041106a20031004370000200041186a200410043700000b0b
0061736d01000000011b0560000060017e017e60017f017f60057f7e7e7e7e0060027f7f0002190108657468657265756d0c73746f7261676553746f7265000403060500020201030503010001060100071102066d656d6f72790200046d61696e00010ac001052901017e0240420021004100200020002000200010054120200020002000420110054100412010000b0b1f01017f024020004108744180fe0371200041087641ff01717221010b20010b1e01027f02402000100241107421022002200041107610027221010b20010b2201027e02402000a71003ad422086210220022000422088a71003ad8421010b20010b32000240200020011004370000200041086a20021004370000200041106a20031004370000200041186a200410043700000b0b
Text representation:
(module
@ -64,24 +64,24 @@ Text representation:
)
(func $bswap16
(param $x i64)
(result i64)
(local $y i64)
(param $x i32)
(result i32)
(local $y i32)
(block $label__1
(local.set $y (i64.or (i64.and (i64.shl (local.get $x) (i64.const 8)) (i64.const 65280)) (i64.and (i64.shr_u (local.get $x) (i64.const 8)) (i64.const 255))))
(local.set $y (i32.or (i32.and (i32.shl (local.get $x) (i32.const 8)) (i32.const 65280)) (i32.and (i32.shr_u (local.get $x) (i32.const 8)) (i32.const 255))))
)
(local.get $y)
)
(func $bswap32
(param $x i64)
(result i64)
(local $y i64)
(local $hi i64)
(param $x i32)
(result i32)
(local $y i32)
(local $hi i32)
(block $label__2
(local.set $hi (i64.shl (call $bswap16 (local.get $x)) (i64.const 16)))
(local.set $y (i64.or (local.get $hi) (call $bswap16 (i64.shr_u (local.get $x) (i64.const 16)))))
(local.set $hi (i32.shl (call $bswap16 (local.get $x)) (i32.const 16)))
(local.set $y (i32.or (local.get $hi) (call $bswap16 (i32.shr_u (local.get $x) (i32.const 16)))))
)
(local.get $y)
@ -93,8 +93,8 @@ Text representation:
(local $y i64)
(local $hi i64)
(block $label__3
(local.set $hi (i64.shl (call $bswap32 (local.get $x)) (i64.const 32)))
(local.set $y (i64.or (local.get $hi) (call $bswap32 (i64.shr_u (local.get $x) (i64.const 32)))))
(local.set $hi (i64.shl (i64.extend_i32_u (call $bswap32 (i32.wrap_i64 (local.get $x)))) (i64.const 32)))
(local.set $y (i64.or (local.get $hi) (i64.extend_i32_u (call $bswap32 (i32.wrap_i64 (i64.shr_u (local.get $x) (i64.const 32)))))))
)
(local.get $y)

View File

@ -42,11 +42,11 @@ object "object" {
x_7 := x_11
}
{
let _4, _5, _6, _7 := iszero_200_872_1499(_1, _1, _1, lt_202(x_4, x_5, x_6, x_7, _1, _1, _1, 10))
let _4, _5, _6, _7 := iszero_204_878_1509(_1, _1, _1, lt_206(x_4, x_5, x_6, x_7, _1, _1, _1, 10))
if i32.eqz(i64.eqz(i64.or(i64.or(_4, _5), i64.or(_6, _7)))) { break }
let _8, _9, _10, _11 := eq_201_873_1500(x_4, x_5, x_6, x_7, _1, _1, _1, 2)
let _8, _9, _10, _11 := eq_205_879_1510(x_4, x_5, x_6, x_7, _1, _1, _1, 2)
if i32.eqz(i64.eqz(i64.or(i64.or(_8, _9), i64.or(_10, _11)))) { break }
let _12, _13, _14, _15 := eq_201_873_1500(x_4, x_5, x_6, x_7, _1, _1, _1, 4)
let _12, _13, _14, _15 := eq_205_879_1510(x_4, x_5, x_6, x_7, _1, _1, _1, 4)
if i32.eqz(i64.eqz(i64.or(i64.or(_12, _13), i64.or(_14, _15)))) { continue }
}
sstore(_1, _1, _1, _1, x_4, x_5, x_6, x_7)
@ -68,15 +68,15 @@ object "object" {
let r1_1, carry_2 := add_carry(x1, y1, carry_1)
r1 := r1_1
}
function iszero_200_872_1499(x1, x2, x3, x4) -> r1, r2, r3, r4
function iszero_204_878_1509(x1, x2, x3, x4) -> r1, r2, r3, r4
{
r4 := i64.extend_i32_u(i64.eqz(i64.or(i64.or(x1, x2), i64.or(x3, x4))))
}
function eq_201_873_1500(x1, x2, x3, x4, y1, y2, y3, y4) -> r1, r2, r3, r4
function eq_205_879_1510(x1, x2, x3, x4, y1, y2, y3, y4) -> r1, r2, r3, r4
{
r4 := i64.extend_i32_u(i32.and(i64.eq(x1, y1), i32.and(i64.eq(x2, y2), i32.and(i64.eq(x3, y3), i64.eq(x4, y4)))))
}
function lt_202(x1, x2, x3, x4, y1, y2, y3, y4) -> z4
function lt_206(x1, x2, x3, x4, y1, y2, y3, y4) -> z4
{
let z:i32 := false
let _1:i32 := 0xffffffff:i32
@ -102,19 +102,19 @@ object "object" {
if i64.ne(0, i64.shr_u(x4, 32)) { unreachable() }
v := i32.wrap_i64(x4)
}
function bswap16(x) -> y
function bswap16(x:i32) -> y:i32
{
y := i64.or(i64.and(i64.shl(x, 8), 0xff00), i64.and(i64.shr_u(x, 8), 0xff))
y := i32.or(i32.and(i32.shl(x, 8:i32), 0xff00:i32), i32.and(i32.shr_u(x, 8:i32), 0xff:i32))
}
function bswap32(x) -> y
function bswap32(x:i32) -> y:i32
{
let hi := i64.shl(bswap16(x), 16)
y := i64.or(hi, bswap16(i64.shr_u(x, 16)))
let hi:i32 := i32.shl(bswap16(x), 16:i32)
y := i32.or(hi, bswap16(i32.shr_u(x, 16:i32)))
}
function bswap64(x) -> y
{
let hi := i64.shl(bswap32(x), 32)
y := i64.or(hi, bswap32(i64.shr_u(x, 32)))
let hi := i64.shl(i64.extend_i32_u(bswap32(i32.wrap_i64(x))), 32)
y := i64.or(hi, i64.extend_i32_u(bswap32(i32.wrap_i64(i64.shr_u(x, 32)))))
}
function calldataload(x1, x2, x3, x4) -> z1, z2, z3, z4
{
@ -150,6 +150,12 @@ object "object" {
z3 := z3_1
z4 := z4_1
}
function sstore(x1, x2, x3, x4, y1, y2, y3, y4)
{
mstore_internal(0:i32, x1, x2, x3, x4)
mstore_internal(32:i32, y1, y2, y3, y4)
eth.storageStore(0:i32, 32:i32)
}
function mstore_internal(pos:i32, y1, y2, y3, y4)
{
i64.store(pos, bswap64(y1))
@ -157,18 +163,12 @@ object "object" {
i64.store(i32.add(pos, 16:i32), bswap64(y3))
i64.store(i32.add(pos, 24:i32), bswap64(y4))
}
function sstore(x1, x2, x3, x4, y1, y2, y3, y4)
{
mstore_internal(0:i32, x1, x2, x3, x4)
mstore_internal(32:i32, y1, y2, y3, y4)
eth.storageStore(0:i32, 32:i32)
}
}
}
Binary representation:
0061736d01000000014e0b6000006000017f60017e017e60037e7e7e017e60047e7e7e7e017e60047e7e7e7e017f60087e7e7e7e7e7e7e7e0060087e7e7e7e7e7e7e7e017e60057f7e7e7e7e0060027f7f0060037f7f7f00025e0408657468657265756d0c73746f7261676553746f7265000908657468657265756d06726576657274000908657468657265756d0f67657443616c6c4461746153697a65000108657468657265756d0c63616c6c44617461436f7079000a030e0d0003070407070502020204080605030100010610037e0142000b7e0142000b7e0142000b071102066d656d6f72790200046d61696e00040abc090dcb02030a7e017f107e02404200210002402000200020002000100e21012300210223012103230221040b20012105200221062003210720042108420121092000200084200020098484504545210a02400340200a45450d01024002402000200020002005200620072008200020002000420a10091007210b2300210c2301210d2302210e0b200b200c84200d200e8484504504400c030b0240200520062007200820002000200042021008210f2300211023012111230221120b200f201084201120128484504504400c030b024020052006200720082000200020004204100821132300211423012115230221160b2013201484201520168484504504400c010b0b0240200520062007200820002000200020091006211723002118230121192302211a0b201721052018210620192107201a21080c000b0b2000200020002000200520062007200810100b0b2901037e0240200020017c2105200520027c21032005200054200320055472ad21040b2004240020030b6c010b7e0240200320077c210c200c42007c210b024020022006200c200354200b200c5472ad1005210d2300210e0b200d210a024020012005200e1005210f230021100b200f2109024020002004201010052111230021120b201121080b20092400200a2401200b240220080b2401047e0240200020018420022003848450ad21070b20052400200624012007240220040b2f01047e02402000200451200120055120022006512003200751717171ad210b0b20092400200a2401200b240220080ba30102017e057f024041002109417f210a0240200a200020045220002004541b210b200b41004604400240200a200120055220012005541b210c200c41004604400240200a200220065220022006541b210d200d41004604402003200754210905200d41014604404100210905410121090b0b0b05200c41014604404100210905410121090b0b0b05200b41014604404100210905410121090b0b0b2009ad21080b20080b2901017f024042002000200184200284520440000b42002003422088520440000b2003a721040b20040b1f01017e024020004208864280fe0383200042088842ff01838421010b20010b1e01027e02402000100b421086210220022000421088100b8421010b20010b1e01027e02402000100c422086210220022000422088100c8421010b20010bfc0105047e017f017e087f047e024010022108420021092009200920092009100a210a2000200120022003100a210b2009200920094220100a210c200b417f200c6b4b04404100410010010b2008200b6b210d200b20084b04404100210d0b4100210e200d200e4b0440200a200b200d10030b200c200d4b0440200c200d6b210f200a200d6a2110200e2111024003402011200f49450d010240201020116a200e3a00000b201141016a21110c000b0b0b200e290000100d2112200e41086a290000100d2113200e41106a290000100d2114200e41186a290000100d2115201221042013210520142106201521070b20052400200624012007240220040b3200024020002001100d370000200041086a2002100d370000200041106a2003100d370000200041186a2004100d3700000b0b2300024041002000200120022003100f41202004200520062007100f4100412010000b0b
0061736d0100000001530c6000006000017f60017e017e60037e7e7e017e60047e7e7e7e017e60047e7e7e7e017f60087e7e7e7e7e7e7e7e0060087e7e7e7e7e7e7e7e017e60017f017f60057f7e7e7e7e0060027f7f0060037f7f7f00025e0408657468657265756d0c73746f7261676553746f7265000a08657468657265756d06726576657274000a08657468657265756d0f67657443616c6c4461746153697a65000108657468657265756d0c63616c6c44617461436f7079000b030e0d0003070407070508080204060905030100010610037e0142000b7e0142000b7e0142000b071102066d656d6f72790200046d61696e00040ac0090dcb02030a7e017f107e02404200210002402000200020002000100e21012300210223012103230221040b20012105200221062003210720042108420121092000200084200020098484504545210a02400340200a45450d01024002402000200020002005200620072008200020002000420a10091007210b2300210c2301210d2302210e0b200b200c84200d200e8484504504400c030b0240200520062007200820002000200042021008210f2300211023012111230221120b200f201084201120128484504504400c030b024020052006200720082000200020004204100821132300211423012115230221160b2013201484201520168484504504400c010b0b0240200520062007200820002000200020091006211723002118230121192302211a0b201721052018210620192107201a21080c000b0b20002000200020002005200620072008100f0b0b2901037e0240200020017c2105200520027c21032005200054200320055472ad21040b2004240020030b6c010b7e0240200320077c210c200c42007c210b024020022006200c200354200b200c5472ad1005210d2300210e0b200d210a024020012005200e1005210f230021100b200f2109024020002004201010052111230021120b201121080b20092400200a2401200b240220080b2401047e0240200020018420022003848450ad21070b20052400200624012007240220040b2f01047e02402000200451200120055120022006512003200751717171ad210b0b20092400200a2401200b240220080ba30102017e057f024041002109417f210a0240200a200020045220002004541b210b200b41004604400240200a200120055220012005541b210c200c41004604400240200a200220065220022006541b210d200d41004604402003200754210905200d41014604404100210905410121090b0b0b05200c41014604404100210905410121090b0b0b05200b41014604404100210905410121090b0b0b2009ad21080b20080b2901017f024042002000200184200284520440000b42002003422088520440000b2003a721040b20040b1f01017f024020004108744180fe0371200041087641ff01717221010b20010b1e01027f02402000100b411074210220022000411076100b7221010b20010b2201027e02402000a7100cad422086210220022000422088a7100cad8421010b20010bfc0105047e017f017e087f047e024010022108420021092009200920092009100a210a2000200120022003100a210b2009200920094220100a210c200b417f200c6b4b04404100410010010b2008200b6b210d200b20084b04404100210d0b4100210e200d200e4b0440200a200b200d10030b200c200d4b0440200c200d6b210f200a200d6a2110200e2111024003402011200f49450d010240201020116a200e3a00000b201141016a21110c000b0b0b200e290000100d2112200e41086a290000100d2113200e41106a290000100d2114200e41186a290000100d2115201221042013210520142106201521070b20052400200624012007240220040b230002404100200020012002200310104120200420052006200710104100412010000b0b3200024020002001100d370000200041086a2002100d370000200041106a2003100d370000200041186a2004100d3700000b0b
Text representation:
(module
@ -230,7 +230,7 @@ Text representation:
(br_if $label__3 (i32.eqz (i32.eqz (local.get $_3))))
(block $label__4
(block
(local.set $_4 (call $iszero_200_872_1499 (local.get $_1) (local.get $_1) (local.get $_1) (call $lt_202 (local.get $x_4) (local.get $x_5) (local.get $x_6) (local.get $x_7) (local.get $_1) (local.get $_1) (local.get $_1) (i64.const 10))))
(local.set $_4 (call $iszero_204_878_1509 (local.get $_1) (local.get $_1) (local.get $_1) (call $lt_206 (local.get $x_4) (local.get $x_5) (local.get $x_6) (local.get $x_7) (local.get $_1) (local.get $_1) (local.get $_1) (i64.const 10))))
(local.set $_5 (global.get $global_))
(local.set $_6 (global.get $global__1))
(local.set $_7 (global.get $global__2))
@ -240,7 +240,7 @@ Text representation:
(br $label__3)
))
(block
(local.set $_8 (call $eq_201_873_1500 (local.get $x_4) (local.get $x_5) (local.get $x_6) (local.get $x_7) (local.get $_1) (local.get $_1) (local.get $_1) (i64.const 2)))
(local.set $_8 (call $eq_205_879_1510 (local.get $x_4) (local.get $x_5) (local.get $x_6) (local.get $x_7) (local.get $_1) (local.get $_1) (local.get $_1) (i64.const 2)))
(local.set $_9 (global.get $global_))
(local.set $_10 (global.get $global__1))
(local.set $_11 (global.get $global__2))
@ -250,7 +250,7 @@ Text representation:
(br $label__3)
))
(block
(local.set $_12 (call $eq_201_873_1500 (local.get $x_4) (local.get $x_5) (local.get $x_6) (local.get $x_7) (local.get $_1) (local.get $_1) (local.get $_1) (i64.const 4)))
(local.set $_12 (call $eq_205_879_1510 (local.get $x_4) (local.get $x_5) (local.get $x_6) (local.get $x_7) (local.get $_1) (local.get $_1) (local.get $_1) (i64.const 4)))
(local.set $_13 (global.get $global_))
(local.set $_14 (global.get $global__1))
(local.set $_15 (global.get $global__2))
@ -348,7 +348,7 @@ Text representation:
(local.get $r1)
)
(func $iszero_200_872_1499
(func $iszero_204_878_1509
(param $x1 i64)
(param $x2 i64)
(param $x3 i64)
@ -368,7 +368,7 @@ Text representation:
(local.get $r1)
)
(func $eq_201_873_1500
(func $eq_205_879_1510
(param $x1 i64)
(param $x2 i64)
(param $x3 i64)
@ -392,7 +392,7 @@ Text representation:
(local.get $r1)
)
(func $lt_202
(func $lt_206
(param $x1 i64)
(param $x2 i64)
(param $x3 i64)
@ -473,24 +473,24 @@ Text representation:
)
(func $bswap16
(param $x i64)
(result i64)
(local $y i64)
(param $x i32)
(result i32)
(local $y i32)
(block $label__14
(local.set $y (i64.or (i64.and (i64.shl (local.get $x) (i64.const 8)) (i64.const 65280)) (i64.and (i64.shr_u (local.get $x) (i64.const 8)) (i64.const 255))))
(local.set $y (i32.or (i32.and (i32.shl (local.get $x) (i32.const 8)) (i32.const 65280)) (i32.and (i32.shr_u (local.get $x) (i32.const 8)) (i32.const 255))))
)
(local.get $y)
)
(func $bswap32
(param $x i64)
(result i64)
(local $y i64)
(local $hi i64)
(param $x i32)
(result i32)
(local $y i32)
(local $hi i32)
(block $label__15
(local.set $hi (i64.shl (call $bswap16 (local.get $x)) (i64.const 16)))
(local.set $y (i64.or (local.get $hi) (call $bswap16 (i64.shr_u (local.get $x) (i64.const 16)))))
(local.set $hi (i32.shl (call $bswap16 (local.get $x)) (i32.const 16)))
(local.set $y (i32.or (local.get $hi) (call $bswap16 (i32.shr_u (local.get $x) (i32.const 16)))))
)
(local.get $y)
@ -502,8 +502,8 @@ Text representation:
(local $y i64)
(local $hi i64)
(block $label__16
(local.set $hi (i64.shl (call $bswap32 (local.get $x)) (i64.const 32)))
(local.set $y (i64.or (local.get $hi) (call $bswap32 (i64.shr_u (local.get $x) (i64.const 32)))))
(local.set $hi (i64.shl (i64.extend_i32_u (call $bswap32 (i32.wrap_i64 (local.get $x)))) (i64.const 32)))
(local.set $y (i64.or (local.get $hi) (i64.extend_i32_u (call $bswap32 (i32.wrap_i64 (i64.shr_u (local.get $x) (i64.const 32)))))))
)
(local.get $y)
@ -580,20 +580,6 @@ Text representation:
(local.get $z1)
)
(func $mstore_internal
(param $pos i32)
(param $y1 i64)
(param $y2 i64)
(param $y3 i64)
(param $y4 i64)
(block $label__21
(i64.store (local.get $pos) (call $bswap64 (local.get $y1)))
(i64.store (i32.add (local.get $pos) (i32.const 8)) (call $bswap64 (local.get $y2)))
(i64.store (i32.add (local.get $pos) (i32.const 16)) (call $bswap64 (local.get $y3)))
(i64.store (i32.add (local.get $pos) (i32.const 24)) (call $bswap64 (local.get $y4)))
)
)
(func $sstore
(param $x1 i64)
(param $x2 i64)
@ -603,11 +589,25 @@ Text representation:
(param $y2 i64)
(param $y3 i64)
(param $y4 i64)
(block $label__22
(block $label__21
(call $mstore_internal (i32.const 0) (local.get $x1) (local.get $x2) (local.get $x3) (local.get $x4))
(call $mstore_internal (i32.const 32) (local.get $y1) (local.get $y2) (local.get $y3) (local.get $y4))
(call $eth.storageStore (i32.const 0) (i32.const 32))
)
)
(func $mstore_internal
(param $pos i32)
(param $y1 i64)
(param $y2 i64)
(param $y3 i64)
(param $y4 i64)
(block $label__22
(i64.store (local.get $pos) (call $bswap64 (local.get $y1)))
(i64.store (i32.add (local.get $pos) (i32.const 8)) (call $bswap64 (local.get $y2)))
(i64.store (i32.add (local.get $pos) (i32.const 16)) (call $bswap64 (local.get $y3)))
(i64.store (i32.add (local.get $pos) (i32.const 24)) (call $bswap64 (local.get $y4)))
)
)
)

View File

@ -1,7 +1,7 @@
{"contracts":{"A":{"C":{"ewasm":{"wasm":"0061736d01000000013a0860000060017e017e60047e7e7e7e017f60087e7e7e7e7e7e7e7e00600c7e7e7e7e7e7e7e7e7e7e7e7e0060017f0060027f7f0060037f7f7f0002510408657468657265756d08636f6465436f7079000708657468657265756d06726576657274000608657468657265756d0c67657443616c6c56616c7565000508657468657265756d0666696e6973680006030a090002020101010403030503010001060100071102066d656d6f72790200046d61696e0004009d030c435f335f6465706c6f7965640061736d0100000001160460000060017e017e60047e7e7e7e017f60027f7f0002130108657468657265756d067265766572740003030504000201010503010001060100071102066d656d6f72790200046d61696e00010ab60204ca0104017e027f057e037f02404200210020002000200042c00010022101200141c0006a210220022001490440000b20001003421086210320032000421088100384422086210420042000422088100484210520022005370000200241086a2005370000200241106a20053700004280011003421086210620064280014210881003844220862107200241186a2007428001422088100484370000200020002000200010022108200020002000200010022109200941c0006a210a200a2009490440000b200a200810000b0b2901017f024042002000200184200284520440000b42002003422088520440000b2003a721040b20040b1f01017e024020004208864280fe0383200042088842ff01838421010b20010b1e01027e02402000100342108621022002200042108810038421010b20010b0aec0309dc0103017e027f057e02404200210020002000200042c00010052101200141c0006a210220022001490440000b20001009210320022003370000200241086a2003370000200241106a2003370000200241186a428001100937000041001002410029000010092104410041086a29000010092105410041106a2900001009210620042005842006410041186a290000100984845045044020002000200020002000200020002000100c0b4290032107200020002000200020002000200042ce012000200020002007100a20002000200020002000200020002007100b0b0b2901017f024042002000200184200284520440000b42002003422088520440000b2003a721040b20040b2601027f0240200020012002200310052105200541c0006a210420042005490440000b0b20040b1f01017e024020004208864280fe0383200042088842ff01838421010b20010b1e01027e02402000100742108621022002200042108810078421010b20010b1e01027e02402000100842208621022002200042208810088421010b20010b25000240200020012002200310062004200520062007100520082009200a200b100510000b0b1b000240200020012002200310062004200520062007100510030b0b1b000240200020012002200310062004200520062007100510010b0b","wast":"(module
{"contracts":{"A":{"C":{"ewasm":{"wasm":"0061736d01000000013f0960000060017e017e60047e7e7e7e017f60087e7e7e7e7e7e7e7e00600c7e7e7e7e7e7e7e7e7e7e7e7e0060017f0060017f017f60027f7f0060037f7f7f0002510408657468657265756d08636f6465436f7079000808657468657265756d06726576657274000708657468657265756d0c67657443616c6c56616c7565000508657468657265756d0666696e6973680007030a090002020606010403030503010001060100071102066d656d6f72790200046d61696e00040086030c435f335f6465706c6f7965640061736d0100000001160460000060047e7e7e7e017f60017f017f60027f7f0002130108657468657265756d067265766572740003030504000102020503010001060100071102066d656d6f72790200046d61696e00010a9f0204b30104017e027f037e037f02404200210020002000200042c00010022101200141c0006a210220022001490440000b2000a71004ad422086210320032000422088a71004ad84210420022004370000200241086a2004370000200241106a2004370000428001a71004ad4220862105200241186a2005428001422088a71004ad84370000200020002000200010022106200020002000200010022107200741c0006a210820082007490440000b2008200610000b0b2901017f024042002000200184200284520440000b42002003422088520440000b2003a721040b20040b1f01017f024020004108744180fe0371200041087641ff01717221010b20010b1e01027f02402000100341107421022002200041107610037221010b20010b0af00309dc0103017e027f057e02404200210020002000200042c00010052101200141c0006a210220022001490440000b20001009210320022003370000200241086a2003370000200241106a2003370000200241186a428001100937000041001002410029000010092104410041086a29000010092105410041106a2900001009210620042005842006410041186a290000100984845045044020002000200020002000200020002000100c0b42f9022107200020002000200020002000200042d3012000200020002007100a20002000200020002000200020002007100b0b0b2901017f024042002000200184200284520440000b42002003422088520440000b2003a721040b20040b2601027f0240200020012002200310052105200541c0006a210420042005490440000b0b20040b1f01017f024020004108744180fe0371200041087641ff01717221010b20010b1e01027f02402000100741107421022002200041107610077221010b20010b2201027e02402000a71008ad422086210220022000422088a71008ad8421010b20010b25000240200020012002200310062004200520062007100520082009200a200b100510000b0b1b000240200020012002200310062004200520062007100510030b0b1b000240200020012002200310062004200520062007100510010b0b","wast":"(module
;; custom section for sub-module
;; The Keccak-256 hash of the text representation of \"C_3_deployed\": 0289c074ac70ccfdbeb7817862087cc066a9f7707de1a981bb8b5b12dd2ce4e9
;; (@custom \"C_3_deployed\" \"0061736d0100000001160460000060017e017e60047e7e7e7e017f60027f7f0002130108657468657265756d067265766572740003030504000201010503010001060100071102066d656d6f72790200046d61696e00010ab60204ca0104017e027f057e037f02404200210020002000200042c00010022101200141c0006a210220022001490440000b20001003421086210320032000421088100384422086210420042000422088100484210520022005370000200241086a2005370000200241106a20053700004280011003421086210620064280014210881003844220862107200241186a2007428001422088100484370000200020002000200010022108200020002000200010022109200941c0006a210a200a2009490440000b200a200810000b0b2901017f024042002000200184200284520440000b42002003422088520440000b2003a721040b20040b1f01017e024020004208864280fe0383200042088842ff01838421010b20010b1e01027e02402000100342108621022002200042108810038421010b20010b\")
;; The Keccak-256 hash of the text representation of \"C_3_deployed\": 380167268971b84f9fd4e61f1659da4fd304bd6e30ec2dd33d412f3c8203ced7
;; (@custom \"C_3_deployed\" \"0061736d0100000001160460000060047e7e7e7e017f60017f017f60027f7f0002130108657468657265756d067265766572740003030504000102020503010001060100071102066d656d6f72790200046d61696e00010a9f0204b30104017e027f037e037f02404200210020002000200042c00010022101200141c0006a210220022001490440000b2000a71004ad422086210320032000422088a71004ad84210420022004370000200241086a2004370000200241106a2004370000428001a71004ad4220862105200241186a2005428001422088a71004ad84370000200020002000200010022106200020002000200010022107200741c0006a210820082007490440000b2008200610000b0b2901017f024042002000200184200284520440000b42002003422088520440000b2003a721040b20040b1f01017f024020004108744180fe0371200041087641ff01717221010b20010b1e01027f02402000100341107421022002200041107610037221010b20010b\")
(import \"ethereum\" \"codeCopy\" (func $eth.codeCopy (param i32 i32 i32)))
(import \"ethereum\" \"revert\" (func $eth.revert (param i32 i32)))
(import \"ethereum\" \"getCallValue\" (func $eth.getCallValue (param i32)))
@ -78,24 +78,24 @@
)
(func $bswap16
(param $x i64)
(result i64)
(local $y i64)
(param $x i32)
(result i32)
(local $y i32)
(block $label__3
(local.set $y (i64.or (i64.and (i64.shl (local.get $x) (i64.const 8)) (i64.const 65280)) (i64.and (i64.shr_u (local.get $x) (i64.const 8)) (i64.const 255))))
(local.set $y (i32.or (i32.and (i32.shl (local.get $x) (i32.const 8)) (i32.const 65280)) (i32.and (i32.shr_u (local.get $x) (i32.const 8)) (i32.const 255))))
)
(local.get $y)
)
(func $bswap32
(param $x i64)
(result i64)
(local $y i64)
(local $hi i64)
(param $x i32)
(result i32)
(local $y i32)
(local $hi i32)
(block $label__4
(local.set $hi (i64.shl (call $bswap16 (local.get $x)) (i64.const 16)))
(local.set $y (i64.or (local.get $hi) (call $bswap16 (i64.shr_u (local.get $x) (i64.const 16)))))
(local.set $hi (i32.shl (call $bswap16 (local.get $x)) (i32.const 16)))
(local.set $y (i32.or (local.get $hi) (call $bswap16 (i32.shr_u (local.get $x) (i32.const 16)))))
)
(local.get $y)
@ -107,8 +107,8 @@
(local $y i64)
(local $hi i64)
(block $label__5
(local.set $hi (i64.shl (call $bswap32 (local.get $x)) (i64.const 32)))
(local.set $y (i64.or (local.get $hi) (call $bswap32 (i64.shr_u (local.get $x) (i64.const 32)))))
(local.set $hi (i64.shl (i64.extend_i32_u (call $bswap32 (i32.wrap_i64 (local.get $x)))) (i64.const 32)))
(local.set $y (i64.or (local.get $hi) (i64.extend_i32_u (call $bswap32 (i32.wrap_i64 (i64.shr_u (local.get $x) (i64.const 32)))))))
)
(local.get $y)

View File

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

View File

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

View File

@ -11,6 +11,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f(uint16): 7 -> 0x0207
// f(uint16): 0xffff -> 511

View File

@ -15,6 +15,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// div(uint256,uint256): 7, 2 -> 3
// div(uint256,uint256): 7, 0 -> FAILURE, hex"4e487b71", 0x12 # throws #

View File

@ -14,6 +14,7 @@ contract Test {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// g(uint256[]): 0x20, 4, 1, 2, 3, 4 -> 4, 1
// h(uint256[], uint256, uint256): 0x60, 1, 3, 4, 1, 2, 3, 4 -> 2, 2
// h(uint256[],uint256,uint256): 0x60, 1, 3, 4, 1, 2, 3, 4 -> 2, 2

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -7,6 +7,7 @@ contract A {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// ()
// x() -> 1

View File

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

View File

@ -19,6 +19,7 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// withValue() -> 0x00
// withoutValue() -> 0x60

View File

@ -12,5 +12,6 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// foo() -> 992

View File

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

View File

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

View File

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

View File

@ -16,7 +16,8 @@ contract C {
}
}
// ====
// EVMVersion: >=byzantium
// compileViaYul: also
// compileToEwasm: also
// EVMVersion: >=byzantium
// ----
// test() -> FAILURE, hex"4e487b71", 33 # should throw #
// test() -> FAILURE, hex"4e487b71", 0x21 # should throw #

View File

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

View File

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

View File

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

View File

@ -6,7 +6,8 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// constructor() # This is the 1st block #
// f() -> 0x1e # This is the 2nd block (each block is "15 seconds") #
// f() -> 0x2d # This is the 3rd block #
// constructor() # This is the 1st block #
// f() -> 0x1e # This is the 2nd block (each block is "15 seconds") #
// f() -> 0x2d # This is the 3rd block #

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -20,5 +20,6 @@ contract C {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f((uint32,uint256[],uint64)): 0x20, 42, 0x60, 23, 2, 1, 2 -> 42, 1, 2, 23

View File

@ -21,5 +21,6 @@ contract Test {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> FAILURE, hex"4e487b71", 0x51

View File

@ -21,5 +21,6 @@ contract Test {
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> FAILURE, hex"4e487b71", 0x51

View File

@ -8,6 +8,7 @@ contract test {
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// constructor(), 23 wei ->
// getBalance() -> 23

View File

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

View File

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

View File

@ -4,6 +4,6 @@
// ----
// Trace:
// Memory dump:
// 20: 0000000000000000000000000000000011111111000000000000000000000000
// 20: 0000000000000000000000000000000000000000000000000000000011111111
// Storage dump:
// 0000000000000000000000000000000000000000000000000000000000000000: 0000000000000000000000000000000011111111000000000000000000000000
// 0000000000000000000000000000000000000000000000000000000000000000: 0000000000000000000000000000000000000000000000000000000011111111

View File

@ -6,7 +6,7 @@
// Trace:
// Memory dump:
// 0: 0000000000000000000000000000000000000000000000000000000000000001
// 20: 0000000000000000000000000000000022222222000000000000000000000000
// 20: 0000000000000000000000000000000000000000000000000000000022222222
// Storage dump:
// 0000000000000000000000000000000000000000000000000000000000000000: 0000000000000000000000000000000022222222000000000000000000000000
// 0000000000000000000000000000000000000000000000000000000000000001: 0000000000000000000000000000000022222222000000000000000000000000
// 0000000000000000000000000000000000000000000000000000000000000000: 0000000000000000000000000000000000000000000000000000000022222222
// 0000000000000000000000000000000000000000000000000000000000000001: 0000000000000000000000000000000000000000000000000000000022222222

View File

@ -4,6 +4,6 @@
// ----
// Trace:
// Memory dump:
// 20: 0000000000000000000000000000000044444444000000000000000000000000
// 20: 0000000000000000000000000000000000000000000000000000000044444444
// Storage dump:
// 0000000000000000000000000000000000000000000000000000000000000000: 0000000000000000000000000000000044444444000000000000000000000000
// 0000000000000000000000000000000000000000000000000000000000000000: 0000000000000000000000000000000000000000000000000000000044444444

View File

@ -4,6 +4,6 @@
// ----
// Trace:
// Memory dump:
// 20: 0000000000000000000000000000000077777777000000000000000000000000
// 20: 0000000000000000000000000000000000000000000000000000000077777777
// Storage dump:
// 0000000000000000000000000000000000000000000000000000000000000000: 0000000000000000000000000000000077777777000000000000000000000000
// 0000000000000000000000000000000000000000000000000000000000000000: 0000000000000000000000000000000000000000000000000000000077777777

View File

@ -7,5 +7,5 @@
// Trace:
// INVALID()
// Memory dump:
// 0: 0000000000000000000000000000000011111111000000000000000000000000
// 0: 0000000000000000000000000000000000000000000000000000000011111111
// Storage dump:

View File

@ -4,6 +4,6 @@
// ----
// Trace:
// Memory dump:
// 20: 0000000000000000000000000000000000000000000000000000000000000dd6
// 20: 000000000000000000000000000000000000000000000000000000000000077b
// Storage dump:
// 0000000000000000000000000000000000000000000000000000000000000000: 0000000000000000000000000000000000000000000000000000000000000dd6
// 0000000000000000000000000000000000000000000000000000000000000000: 000000000000000000000000000000000000000000000000000000000000077b

View File

@ -4,6 +4,6 @@
// ----
// Trace:
// Memory dump:
// 20: 0000000000000000000000000000000033333333000000000000000000000000
// 20: 0000000000000000000000000000000000000000000000000000000033333333
// Storage dump:
// 0000000000000000000000000000000000000000000000000000000000000000: 0000000000000000000000000000000033333333000000000000000000000000
// 0000000000000000000000000000000000000000000000000000000000000000: 0000000000000000000000000000000000000000000000000000000033333333