source: CIVL/examples/por/heap1.cvl@ cf2a996

1.23 2.0 acw/focus-triggers main test-branch
Last change on this file since cf2a996 was a0852d1, checked in by Manchun Zheng <zmanchun@…>, 12 years ago

added a test for POR with shared heap pointers.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@648 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 440 bytes
RevLine 
[a0852d1]1#include <civlc.h>
2
3$heap root;
4$heap *h = &root;
5int *p;
6_Bool start = $false;
7
8void f(){
9 $heap fh;
10
11 $when(start);
12 p = (int*) $malloc(h, sizeof(int));
13 h = &fh;
14 //$free(&fh, p);
15}
16
17void g(){
18 $heap gh;
19
20 $when(start);
21 h = &gh;
22 //p = (int*) $malloc(h, sizeof(int));
23 //$free(&gh, p);
24}
25
26void main(){
27 $proc ps[2];
28
29 ps[0] = $spawn f();
30 ps[1] = $spawn g();
31 start = $true;
32 $wait ps[0];
33 $wait ps[1];
34 $free(h, p);
35}
Note: See TracBrowser for help on using the repository browser.