summaryrefslogtreecommitdiff
path: root/Test/inline/InliningAndLoops.bpl
diff options
context:
space:
mode:
authorGravatar Unknown <qadeer@FAIZ-AHMED-FAIZ.redmond.corp.microsoft.com>2013-01-04 14:42:40 -0800
committerGravatar Unknown <qadeer@FAIZ-AHMED-FAIZ.redmond.corp.microsoft.com>2013-01-04 14:42:40 -0800
commitab03eafe1c01840e7baab8fd51b4f00f11076d6a (patch)
tree2168ea34e56ee333eba992c035df8e8c24f4c6df /Test/inline/InliningAndLoops.bpl
parent381e589bd49684b46a00c1bea3514e0d1e84b3fd (diff)
bug fix for interaction between inlining and loops
Diffstat (limited to 'Test/inline/InliningAndLoops.bpl')
-rw-r--r--Test/inline/InliningAndLoops.bpl20
1 files changed, 20 insertions, 0 deletions
diff --git a/Test/inline/InliningAndLoops.bpl b/Test/inline/InliningAndLoops.bpl
new file mode 100644
index 00000000..970591a5
--- /dev/null
+++ b/Test/inline/InliningAndLoops.bpl
@@ -0,0 +1,20 @@
+procedure foo(N: int)
+ requires N == 2;
+{
+ var n, sum, recent: int;
+ n, sum := 0, 0;
+ while (n < N)
+ {
+ call recent := bar();
+ sum, n := sum + recent, n + 1;
+ }
+ if (n == 2) {
+ assert sum == recent + recent; // no reason to believe this always to be true
+ }
+}
+
+procedure {:inline 1} bar() returns (r: int)
+{
+ var x: int;
+ r := x;
+}