Merge pull request #5258 from ethereum/coverage2

Add some simplification tests for operations.
This commit is contained in:
chriseth 2018-10-19 11:04:56 +02:00 committed by GitHub
commit 0ebe572f7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 56 additions and 0 deletions

View File

@ -0,0 +1,44 @@
{
let x := mload(0)
mstore(1, mul(x, 0))
mstore(2, div(x, 0))
mstore(3, div(0, x))
mstore(4, sdiv(x, 0))
mstore(5, sdiv(0, x))
mstore(6, and(0, x))
mstore(7, and(x, 0))
mstore(8, mod(0, x))
mstore(9, mod(x, 0))
mstore(10, lt(x, x))
mstore(11, gt(x, x))
mstore(12, slt(x, x))
mstore(13, sgt(x, x))
mstore(14, mod(x, x))
mstore(15, and(x, not(x)))
mstore(16, and(not(x), x))
mstore(17, or(x, not(x)))
mstore(18, or(not(x), x))
}
// ----
// fullSimplify
// {
// pop(mload(0))
// mstore(1, 0)
// mstore(2, 0)
// mstore(3, 0)
// mstore(4, 0)
// mstore(5, 0)
// mstore(6, 0)
// mstore(7, 0)
// mstore(8, 0)
// mstore(9, 0)
// mstore(10, 0)
// mstore(11, 0)
// mstore(12, 0)
// mstore(13, 0)
// mstore(14, 0)
// mstore(15, 0)
// mstore(16, 0)
// mstore(17, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)
// mstore(18, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)
// }

View File

@ -0,0 +1,12 @@
{
let x := 7
mstore(0, signextend(50, x))
let y := 255
mstore(1, signextend(0, y))
}
// ----
// fullSimplify
// {
// mstore(0, 7)
// mstore(1, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)
// }