mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Update tests.
This commit is contained in:
parent
d6c461ed61
commit
3996d0a343
@ -0,0 +1,44 @@
|
|||||||
|
{
|
||||||
|
switch calldataload(0)
|
||||||
|
case 0 {
|
||||||
|
recursive()
|
||||||
|
sstore(0, 1)
|
||||||
|
}
|
||||||
|
case 1 {
|
||||||
|
terminating()
|
||||||
|
sstore(0, 7)
|
||||||
|
}
|
||||||
|
case 2 {
|
||||||
|
reverting()
|
||||||
|
sstore(0, 7)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function recursive()
|
||||||
|
{
|
||||||
|
recursive()
|
||||||
|
}
|
||||||
|
function terminating()
|
||||||
|
{
|
||||||
|
return(0, 0)
|
||||||
|
}
|
||||||
|
function reverting()
|
||||||
|
{
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ----
|
||||||
|
// step: deadCodeEliminator
|
||||||
|
//
|
||||||
|
// {
|
||||||
|
// switch calldataload(0)
|
||||||
|
// case 0 { recursive() }
|
||||||
|
// case 1 { terminating() }
|
||||||
|
// case 2 { reverting() }
|
||||||
|
// function recursive()
|
||||||
|
// { recursive() }
|
||||||
|
// function terminating()
|
||||||
|
// { return(0, 0) }
|
||||||
|
// function reverting()
|
||||||
|
// { revert(0, 0) }
|
||||||
|
// }
|
@ -5,9 +5,7 @@
|
|||||||
|
|
||||||
function fun()
|
function fun()
|
||||||
{
|
{
|
||||||
return(1, 1)
|
sstore(0, 1)
|
||||||
|
|
||||||
pop(sub(10, 5))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pop(add(1, 1))
|
pop(add(1, 1))
|
||||||
@ -19,5 +17,5 @@
|
|||||||
// fun()
|
// fun()
|
||||||
// revert(0, 0)
|
// revert(0, 0)
|
||||||
// function fun()
|
// function fun()
|
||||||
// { return(1, 1) }
|
// { sstore(0, 1) }
|
||||||
// }
|
// }
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
// This function name can be shortened, the other cannot.
|
// This function name can be shortened, the other cannot.
|
||||||
function nonmstore_(x) {
|
function nonmstore_(x) {
|
||||||
nonmstore_(x)
|
if calldataload(0) { nonmstore_(x) }
|
||||||
sstore(10, calldataload(2))
|
sstore(10, calldataload(2))
|
||||||
}
|
}
|
||||||
function mstore_(x) -> y {
|
function mstore_(x) -> y {
|
||||||
let t3_3_ := mstore_(x)
|
if calldataload(0) { let t3_3_ := mstore_(x) }
|
||||||
y := 8
|
y := 8
|
||||||
sstore(y, calldataload(y))
|
sstore(y, calldataload(y))
|
||||||
}
|
}
|
||||||
@ -22,12 +22,12 @@
|
|||||||
// }
|
// }
|
||||||
// function nonmstore(x)
|
// function nonmstore(x)
|
||||||
// {
|
// {
|
||||||
// nonmstore(x)
|
// if calldataload(0) { nonmstore(x) }
|
||||||
// sstore(10, calldataload(2))
|
// sstore(10, calldataload(2))
|
||||||
// }
|
// }
|
||||||
// function mstore_(x) -> y
|
// function mstore_(x) -> y
|
||||||
// {
|
// {
|
||||||
// pop(mstore_(x))
|
// if calldataload(0) { pop(mstore_(x)) }
|
||||||
// y := 8
|
// y := 8
|
||||||
// sstore(y, calldataload(y))
|
// sstore(y, calldataload(y))
|
||||||
// }
|
// }
|
||||||
|
@ -5,7 +5,9 @@
|
|||||||
sstore(1, l)
|
sstore(1, l)
|
||||||
function f(a, b, c) -> x, y, z
|
function f(a, b, c) -> x, y, z
|
||||||
{
|
{
|
||||||
x, y, z := f(1, 2, 3)
|
if calldataload(0) {
|
||||||
|
x, y, z := f(1, 2, 3)
|
||||||
|
}
|
||||||
x := add(x, 1)
|
x := add(x, 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -21,9 +23,13 @@
|
|||||||
// }
|
// }
|
||||||
// function f() -> x, y, z
|
// function f() -> x, y, z
|
||||||
// {
|
// {
|
||||||
// let x_1, y_1, z_1 := f()
|
// if calldataload(0)
|
||||||
// y := y_1
|
// {
|
||||||
// z := z_1
|
// let x_1, y_1, z_1 := f()
|
||||||
// x := add(x_1, 1)
|
// x := x_1
|
||||||
|
// y := y_1
|
||||||
|
// z := z_1
|
||||||
|
// }
|
||||||
|
// x := add(x, 1)
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
Loading…
Reference in New Issue
Block a user