summaryrefslogtreecommitdiff
path: root/Test/og/parallel2.bpl
diff options
context:
space:
mode:
authorGravatar Unknown <qadeer@FAIZ-AHMED-FAIZ.redmond.corp.microsoft.com>2013-03-01 22:05:19 -0800
committerGravatar Unknown <qadeer@FAIZ-AHMED-FAIZ.redmond.corp.microsoft.com>2013-03-01 22:05:19 -0800
commitabdbd2a717efd1e6184bf1113ed2cce63da0d0ea (patch)
tree192a5dac7dfcf28cc8278964f4dff4cb2a4273c3 /Test/og/parallel2.bpl
parentc5c2c9465a53e4b35a20ad5efe73882dc6a5af34 (diff)
added parallel calls
Diffstat (limited to 'Test/og/parallel2.bpl')
-rw-r--r--Test/og/parallel2.bpl35
1 files changed, 35 insertions, 0 deletions
diff --git a/Test/og/parallel2.bpl b/Test/og/parallel2.bpl
new file mode 100644
index 00000000..444b9805
--- /dev/null
+++ b/Test/og/parallel2.bpl
@@ -0,0 +1,35 @@
+var a:[int]int;
+
+procedure {:entrypoint} main()
+{
+ var {:linear "tid"} i: int;
+ var {:linear "tid"} j: int;
+ call i := t(i) | j := t(j);
+ call i := u(i) | j := u(j);
+}
+
+procedure t({:linear "tid"} i': int) returns ({:linear "tid"} i: int)
+{
+ assume i == i';
+
+ a[i] := 42;
+ call i := Yield(i);
+ assert a[i] == 42;
+}
+
+procedure u({:linear "tid"} i': int) returns ({:linear "tid"} i: int)
+{
+ assume i == i';
+
+ a[i] := 42;
+ yield;
+ assert a[i] == 42;
+}
+
+procedure Yield({:linear "tid"} i': int) returns ({:linear "tid"} i: int)
+ensures i == i';
+ensures old(a)[i] == a[i];
+{
+ assume i == i';
+ yield;
+} \ No newline at end of file