source:
CIVL/mods/dev.civl.com/examples/mem/readset/pointer.cvl@
8553be8
| Last change on this file since 8553be8 was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 359 bytes | |
| Line | |
|---|---|
| 1 | #include<mem.cvh> |
| 2 | int main() { |
| 3 | int x,y,z; |
| 4 | int * p, * q; |
| 5 | |
| 6 | x = 0, y = 0, z = 0; |
| 7 | p = &x; q = &y; |
| 8 | $read_set_push(); |
| 9 | int a = *p + *q; |
| 10 | |
| 11 | $mem m = $read_set_pop(); |
| 12 | $mem oracle = ($mem)&x; |
| 13 | |
| 14 | oracle = $mem_union(oracle, ($mem)&y); |
| 15 | oracle = $mem_union(oracle, ($mem)&p); |
| 16 | oracle = $mem_union(oracle, ($mem)&q); |
| 17 | $assert($mem_equals(m, oracle)); |
| 18 | } |
Note:
See TracBrowser
for help on using the repository browser.
