summaryrefslogtreecommitdiff
path: root/Test/extractloops
diff options
context:
space:
mode:
authorGravatar Shuvendu Lahiri <shuvendu@microsoft.com>2015-10-26 17:27:52 -0700
committerGravatar Shuvendu Lahiri <shuvendu@microsoft.com>2015-10-26 17:27:52 -0700
commitdeef37064f673be0391a7224ed8551b1e68be829 (patch)
tree457adde8bdca0ccbac7c6e388168b914754dac8a /Test/extractloops
parenta6b78b0ea28c22744fa846d7729b5c50247f9987 (diff)
Bug fix for deterministExtractLoops for Shaobo's example
Diffstat (limited to 'Test/extractloops')
-rw-r--r--Test/extractloops/detLoopExtract2.bpl27
-rw-r--r--Test/extractloops/detLoopExtract2.bpl.expect2
2 files changed, 29 insertions, 0 deletions
diff --git a/Test/extractloops/detLoopExtract2.bpl b/Test/extractloops/detLoopExtract2.bpl
new file mode 100644
index 00000000..f2befc53
--- /dev/null
+++ b/Test/extractloops/detLoopExtract2.bpl
@@ -0,0 +1,27 @@
+// RUN: %boogie -nologo -nologo -stratifiedInline:1 -extractLoops -deterministicExtractLoops -recursionBound:6 "%s" > "%t"
+// RUN: %diff "%s.expect" "%t"
+
+//This example checks the bug fix in the loop extract for http://symdiff.codeplex.com/workitem/4
+procedure {:entrypoint} Main() returns(r:int)
+{
+ var i, j : int;
+ var Flag : bool;
+ var b : bool;
+ i := 0;
+ j := 0;
+ Flag := false;
+ while(i<3)
+ {
+ havoc b;
+ if (b || Flag) {
+ i := i + 1;
+ j := j + 1;
+ }
+ else {
+ Flag := true;
+ j := j + 1;
+ }
+ }
+ assume !(i == j || i == j - 1);
+ return;
+}
diff --git a/Test/extractloops/detLoopExtract2.bpl.expect b/Test/extractloops/detLoopExtract2.bpl.expect
new file mode 100644
index 00000000..37fad75c
--- /dev/null
+++ b/Test/extractloops/detLoopExtract2.bpl.expect
@@ -0,0 +1,2 @@
+
+Boogie program verifier finished with 1 verified, 0 errors