solidity/test/libsolidity/smtCheckerTests/operators/shifts/shift_cex.sol
Martin Blicha cdfc19b503 SMTChecker: Bring back counterexample checks in regression tests
Since the default is now to ignore the counterexamples when checking
test output, we bring back counterexample checks in tests where the
counterexample is (mostly) deterministic.
2023-07-25 12:26:21 +02:00

23 lines
797 B
Solidity

contract C {
function left() public pure {
uint x = 0x4266;
assert(x << 0x0 == 0x4266);
// Fails because the above is true.
assert(x << 0x0 == 0x4268);
}
function right() public pure {
uint x = 0x4266;
assert(x >> 0x0 == 0x4266);
// Fails because the above is true.
assert(x >> 0x0 == 0x4268);
}
}
// ====
// SMTEngine: all
// SMTIgnoreCex: no
// ----
// Warning 6328: (133-159): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 16998\n\nTransaction trace:\nC.constructor()\nC.left()
// Warning 6328: (286-312): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 16998\n\nTransaction trace:\nC.constructor()\nC.right()
// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.