diff options
Diffstat (limited to 'test/libsolidity/smtCheckerTests/033_while_loop_simple.sol')
-rw-r--r-- | test/libsolidity/smtCheckerTests/033_while_loop_simple.sol | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/libsolidity/smtCheckerTests/033_while_loop_simple.sol b/test/libsolidity/smtCheckerTests/033_while_loop_simple.sol new file mode 100644 index 00000000..074be86f --- /dev/null +++ b/test/libsolidity/smtCheckerTests/033_while_loop_simple.sol @@ -0,0 +1,13 @@ +pragma experimental SMTChecker; +// Check that variables are cleared +contract C { + function f(uint x) public pure { + x = 2; + while (x > 1) { + x = 2; + } + assert(x == 2); + } +} +// ---- +// Warning: (194-208): Assertion violation happens here\nNote that some information is erased after the execution of loops.\nYou can re-introduce information using require(). |