Add also smoke tests for opcodes not part of Ewasm

This commit is contained in:
Alex Beregszaszi 2019-12-09 20:52:47 +00:00
parent 7f40ca5a8f
commit fbf946e493
5 changed files with 51 additions and 2 deletions

View File

@ -359,6 +359,14 @@ function balance(x1, x2, x3, x4) -> z1, z2, z3, z4 {
// TODO implement
unreachable()
}
function selfbalance() -> z1, z2, z3, z4 {
// TODO: not part of current Ewasm spec
unreachable()
}
function chainid() -> z1, z2, z3, z4 {
// TODO: not part of current Ewasm spec
unreachable()
}
function origin() -> z1, z2, z3, z4 {
eth.getTxOrigin(0)
z1, z2, z3, z4 := mload_internal(0)
@ -414,7 +422,7 @@ function extcodesize(x1, x2, x3, x4) -> z1, z2, z3, z4 {
unreachable()
}
function extcodehash(x1, x2, x3, x4) -> z1, z2, z3, z4 {
// TODO implement
// TODO: not part of current Ewasm spec
unreachable()
}
function extcodecopy(v1, v2, v3, v4, x1, x2, x3, x4, y1, y2, y3, y4, z1, z2, z3, z4) {
@ -660,7 +668,7 @@ function create2(
c1, c2, c3, c4,
d1, d2, d3, d4
) -> x1, x2, x3, x4 {
// TODO implement
// TODO: not part of current Ewasm spec
unreachable()
}
function selfdestruct(a1, a2, a3, a4) {

View File

@ -0,0 +1,9 @@
{
sstore(0, chainid())
}
// ====
// EVMVersion: >=istanbul
// ----
// Trace:
// Memory dump:
// Storage dump:

View File

@ -0,0 +1,10 @@
{
sstore(0, extcodehash(address()))
}
// ====
// EVMVersion: >=constantinople
// ----
// Trace:
// Memory dump:
// 0: 0000000000000000000000000000000011111111000000000000000000000000
// Storage dump:

View File

@ -0,0 +1,9 @@
{
sstore(0, selfbalance())
}
// ====
// EVMVersion: >=istanbul
// ----
// Trace:
// Memory dump:
// Storage dump:

View File

@ -0,0 +1,13 @@
{
let size := codesize()
codecopy(0x40, 0, size)
sstore(0, create2(42, 0, size, 0x20))
}
// ====
// EVMVersion: >=constantinople
// ----
// Trace:
// Memory dump:
// 0: 0000000000000000000000000000000000000000000000000000000000000014
// 80: 636f6465636f6465636f6465636f6465636f6465000000000000000000000000
// Storage dump: