source: CIVL/examples/mem/writeset/ws_push_pop2.cvl

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

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

  • Property mode set to 100644
File size: 567 bytes
Line 
1#include <mem.cvh>
2$input int N, n;
3$assume(N > n && n > 5);
4
5int main() {
6 struct T {
7 int x;
8 struct {
9 double y;
10 double z;
11 } t;
12 union {
13 int a[10][10];
14 int b;
15 } u;
16 } a;
17
18 $write_set_push();
19
20 a.x = 0;
21 a.t.y = 0.0;
22 a.u.a[3][3] = 0;
23
24 $mem m = $write_set_pop();
25 $mem m2 = $mem_empty();
26
27 m2 = $mem_union(m, &a.x);
28 m2 = $mem_union(m, &a.t.y);
29 m2 = $mem_union(m, &a.u.a[3][3]);
30 $assert($mem_contains(m, m2));
31 $assert(!$mem_contains(m, &a.u.b));
32 $assert(!$mem_contains(m, &a.u.a[3][4]));
33 return 0;
34}
Note: See TracBrowser for help on using the repository browser.