mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #9630 from ethereum/tests-SideEffects
Tests for refactor-SideEffects
This commit is contained in:
commit
e6b2075af3
14
test/libyul/functionSideEffects/memory.yul
Normal file
14
test/libyul/functionSideEffects/memory.yul
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
function a() { mstore8(0, 32) }
|
||||
function f() { a() }
|
||||
function g() { sstore(0, 1) } // does not affect memory
|
||||
function h() { pop(mload(0)) }
|
||||
function i() { pop(msize()) }
|
||||
}
|
||||
// ----
|
||||
// : movable, sideEffectFree, sideEffectFreeIfNoMSize
|
||||
// a: invalidatesMemory
|
||||
// f: invalidatesMemory
|
||||
// g: invalidatesStorage
|
||||
// h: sideEffectFreeIfNoMSize
|
||||
// i: sideEffectFree, sideEffectFreeIfNoMSize
|
12
test/libyul/functionSideEffects/otherImmovables.yul
Normal file
12
test/libyul/functionSideEffects/otherImmovables.yul
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
function a() { pop(gas()) }
|
||||
function f() { a() }
|
||||
function g() { stop() }
|
||||
function h() { invalid() }
|
||||
}
|
||||
// ----
|
||||
// : movable, sideEffectFree, sideEffectFreeIfNoMSize
|
||||
// a: sideEffectFree, sideEffectFreeIfNoMSize
|
||||
// f: sideEffectFree, sideEffectFreeIfNoMSize
|
||||
// g:
|
||||
// h:
|
10
test/libyul/functionSideEffects/state.yul
Normal file
10
test/libyul/functionSideEffects/state.yul
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
function a() { pop(call(100, 0x010, 10, 0x00, 32, 0x0100, 32))}
|
||||
function f() { a() }
|
||||
function g() { sstore(0, 1) }
|
||||
}
|
||||
// ----
|
||||
// : movable, sideEffectFree, sideEffectFreeIfNoMSize
|
||||
// a: invalidatesStorage, invalidatesMemory
|
||||
// f: invalidatesStorage, invalidatesMemory
|
||||
// g: invalidatesStorage
|
12
test/libyul/functionSideEffects/storage.yul
Normal file
12
test/libyul/functionSideEffects/storage.yul
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
function a() { sstore(0, 1) }
|
||||
function f() { a() }
|
||||
function g() { pop(callcode(100, 0x010, 10, 0x00, 32, 0x0100, 32))}
|
||||
function h() { pop(sload(0))}
|
||||
}
|
||||
// ----
|
||||
// : movable, sideEffectFree, sideEffectFreeIfNoMSize
|
||||
// a: invalidatesStorage
|
||||
// f: invalidatesStorage
|
||||
// g: invalidatesStorage, invalidatesMemory
|
||||
// h: sideEffectFree, sideEffectFreeIfNoMSize
|
Loading…
Reference in New Issue
Block a user