mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
new tests
This commit is contained in:
parent
b98c663f95
commit
d145919b5d
@ -0,0 +1,43 @@
|
||||
{
|
||||
let x := 0
|
||||
for {} sload(0) { let t := 0 /* can replace this */ } {
|
||||
x := 0
|
||||
if calldataload(0) { x := 2 break }
|
||||
let r := 0
|
||||
if calldataload(1) { x := 3 revert(0, 0) }
|
||||
let s := 0
|
||||
if calldataload(0) { continue }
|
||||
let v := 0
|
||||
x := 4
|
||||
revert(0, 0)
|
||||
}
|
||||
// cannot replace this
|
||||
let u := 0
|
||||
}
|
||||
// ----
|
||||
// step: commonSubexpressionEliminator
|
||||
//
|
||||
// {
|
||||
// let x := 0
|
||||
// for { } sload(0) { let t := x }
|
||||
// {
|
||||
// x := 0
|
||||
// if calldataload(x)
|
||||
// {
|
||||
// x := 2
|
||||
// break
|
||||
// }
|
||||
// let r := x
|
||||
// if calldataload(1)
|
||||
// {
|
||||
// x := 3
|
||||
// revert(0, 0)
|
||||
// }
|
||||
// let s := x
|
||||
// if calldataload(x) { continue }
|
||||
// let v := x
|
||||
// x := 4
|
||||
// revert(0, 0)
|
||||
// }
|
||||
// let u := 0
|
||||
// }
|
@ -0,0 +1,38 @@
|
||||
{
|
||||
let x := calldataload(0)
|
||||
let y := calldataload(1)
|
||||
sstore(x, y)
|
||||
switch calldataload(2)
|
||||
case 0 {
|
||||
x := 2
|
||||
sstore(x, y)
|
||||
}
|
||||
default {
|
||||
x := 3
|
||||
sstore(x, y)
|
||||
}
|
||||
let t := sload(x)
|
||||
sstore(0, t)
|
||||
}
|
||||
// ----
|
||||
// step: loadResolver
|
||||
//
|
||||
// {
|
||||
// {
|
||||
// let _1 := 0
|
||||
// let x := calldataload(_1)
|
||||
// let y := calldataload(1)
|
||||
// sstore(x, y)
|
||||
// let _3 := 2
|
||||
// switch calldataload(_3)
|
||||
// case 0 {
|
||||
// x := _3
|
||||
// sstore(_3, y)
|
||||
// }
|
||||
// default {
|
||||
// x := 3
|
||||
// sstore(x, y)
|
||||
// }
|
||||
// sstore(_1, sload(x))
|
||||
// }
|
||||
// }
|
Loading…
Reference in New Issue
Block a user