summaryrefslogtreecommitdiff
path: root/Test/extractloops/detLoopExtract2.bpl
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@mit.edu>2016-06-05 15:01:52 -0400
committerGravatar Benjamin Barenblat <bbaren@mit.edu>2016-06-05 15:01:52 -0400
commit41082463d783d6f8d8a5aaf69bf459b57bca6000 (patch)
tree8b9dca4b583b9cb1ea7ed220fe34d611217eb6cc /Test/extractloops/detLoopExtract2.bpl
parent64e8b33656140b87137d0662d9e6835e004d13c2 (diff)
parent8ed5dab22d8377924ee6282b83c1b1f8aa8f3573 (diff)
Merge branch 'upstream' into dfsg_free
Diffstat (limited to 'Test/extractloops/detLoopExtract2.bpl')
-rw-r--r--Test/extractloops/detLoopExtract2.bpl27
1 files changed, 27 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;
+}