solidity/test/libsolidity/smtCheckerTests/operators/delete_struct.sol

21 lines
332 B
Solidity
Raw Normal View History

2019-05-06 16:24:15 +00:00
contract C
{
struct S
{
uint x;
}
2020-08-25 14:58:25 +00:00
function f(bool b) public pure {
2019-05-06 16:24:15 +00:00
S memory s;
s.x = 2;
if (b)
delete s;
else
delete s.x;
assert(s.x == 0);
}
}
2021-03-31 15:11:54 +00:00
// ====
// SMTEngine: all
2019-05-06 16:24:15 +00:00
// ----
2023-02-09 16:07:13 +00:00
// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.