aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/smtCheckerTests/loops/while_1.sol
diff options
context:
space:
mode:
authorLeonardo Alt <leo@ethereum.org>2018-11-10 01:50:06 +0800
committerLeonardo Alt <leo@ethereum.org>2018-12-04 19:35:19 +0800
commit8069bb61daa4009f73a7d629816bc63529af6455 (patch)
treeef2b9a27257cc91aeb48b2f042dcd5a1d1c5924c /test/libsolidity/smtCheckerTests/loops/while_1.sol
parente49f37be7f64d0306c2e63cea81eb98aa1bc85f1 (diff)
downloaddexon-solidity-8069bb61daa4009f73a7d629816bc63529af6455.tar
dexon-solidity-8069bb61daa4009f73a7d629816bc63529af6455.tar.gz
dexon-solidity-8069bb61daa4009f73a7d629816bc63529af6455.tar.bz2
dexon-solidity-8069bb61daa4009f73a7d629816bc63529af6455.tar.lz
dexon-solidity-8069bb61daa4009f73a7d629816bc63529af6455.tar.xz
dexon-solidity-8069bb61daa4009f73a7d629816bc63529af6455.tar.zst
dexon-solidity-8069bb61daa4009f73a7d629816bc63529af6455.zip
[SMTChecker] Loops are unrolled once
Diffstat (limited to 'test/libsolidity/smtCheckerTests/loops/while_1.sol')
-rw-r--r--test/libsolidity/smtCheckerTests/loops/while_1.sol17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/libsolidity/smtCheckerTests/loops/while_1.sol b/test/libsolidity/smtCheckerTests/loops/while_1.sol
new file mode 100644
index 00000000..871ed929
--- /dev/null
+++ b/test/libsolidity/smtCheckerTests/loops/while_1.sol
@@ -0,0 +1,17 @@
+pragma experimental SMTChecker;
+
+contract C
+{
+ function f(uint x, bool b) public pure {
+ require(x < 100);
+ while (x < 10) {
+ if (b)
+ x = x + 1;
+ else
+ x = 0;
+ }
+ assert(x > 0);
+ }
+}
+// ----
+// Warning: (177-190): Assertion violation happens here