source:
CIVL/examples/mem/mem_tests/mem_union2-bad.cvl@
cc8e265
| Last change on this file since cc8e265 was da65ee2, checked in by , 7 years ago | |
|---|---|
|
|
| File size: 348 bytes | |
| Rev | Line | |
|---|---|---|
| [da65ee2] | 1 | #include<mem.cvh> |
| 2 | ||
| 3 | $input int N; | |
| 4 | $assume(N > 10); | |
| 5 | ||
| 6 | struct T { | |
| 7 | int x[N]; | |
| 8 | double y[N]; | |
| 9 | } a[N]; | |
| 10 | ||
| 11 | union U { | |
| 12 | int x[N]; | |
| 13 | double y[N]; | |
| 14 | } b[N]; | |
| 15 | ||
| 16 | int main() { | |
| 17 | $mem m = &a[0 .. N-1].x[0 .. N-1]; | |
| 18 | ||
| 19 | m = $mem_union(m, &b[0 .. N-1].x[0 .. N-1]); | |
| 20 | m = $mem_union(m, &b[0 .. N-1].y[0 .. N-1]); | |
| 21 | $assert($mem_contains(m, &a[1 .. N-2].y[1 .. N-2])); | |
| 22 | } |
Note:
See TracBrowser
for help on using the repository browser.
