mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add also smoke tests for opcodes not part of Ewasm
This commit is contained in:
parent
7f40ca5a8f
commit
fbf946e493
@ -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) {
|
||||
|
9
test/libyul/ewasmTranslationTests/chainid.yul
Normal file
9
test/libyul/ewasmTranslationTests/chainid.yul
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
sstore(0, chainid())
|
||||
}
|
||||
// ====
|
||||
// EVMVersion: >=istanbul
|
||||
// ----
|
||||
// Trace:
|
||||
// Memory dump:
|
||||
// Storage dump:
|
10
test/libyul/ewasmTranslationTests/extcodehash.yul
Normal file
10
test/libyul/ewasmTranslationTests/extcodehash.yul
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
sstore(0, extcodehash(address()))
|
||||
}
|
||||
// ====
|
||||
// EVMVersion: >=constantinople
|
||||
// ----
|
||||
// Trace:
|
||||
// Memory dump:
|
||||
// 0: 0000000000000000000000000000000011111111000000000000000000000000
|
||||
// Storage dump:
|
9
test/libyul/ewasmTranslationTests/selfbalance.yul
Normal file
9
test/libyul/ewasmTranslationTests/selfbalance.yul
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
sstore(0, selfbalance())
|
||||
}
|
||||
// ====
|
||||
// EVMVersion: >=istanbul
|
||||
// ----
|
||||
// Trace:
|
||||
// Memory dump:
|
||||
// Storage dump:
|
13
test/libyul/ewasmTranslationTests/smoke_create2.yul
Normal file
13
test/libyul/ewasmTranslationTests/smoke_create2.yul
Normal 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:
|
Loading…
Reference in New Issue
Block a user