From 118a0f2125a37d09a18eb4b86d95a773ba1df500 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 3 Mar 2022 20:11:11 +0100 Subject: [PATCH] slt test case. --- .../reasoningBasedSimplifier/slt.yul | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 test/libyul/yulOptimizerTests/reasoningBasedSimplifier/slt.yul diff --git a/test/libyul/yulOptimizerTests/reasoningBasedSimplifier/slt.yul b/test/libyul/yulOptimizerTests/reasoningBasedSimplifier/slt.yul new file mode 100644 index 000000000..bcf275471 --- /dev/null +++ b/test/libyul/yulOptimizerTests/reasoningBasedSimplifier/slt.yul @@ -0,0 +1,19 @@ +{ + let y := calldataload(0) + let t := calldataload(32) + + if sgt(sub(y, 1), y) { + // y - 1 > y, i.e. y is the most negative value + if eq(y, sub(0, y)) { + sstore(0, 1) + } + } +} +// ---- +// step: reasoningBasedSimplifier +// +// { +// let y := calldataload(0) +// let t := calldataload(32) +// if sgt(sub(y, 1), y) { if 1 { sstore(0, 1) } } +// }