source: CIVL/examples/mem/mem_tests/mem_union_widening_seq.cvl

main
Last change on this file was e429fb1, checked in by Stephen Siegel <siegel@…>, 3 years ago

The creation of $mem values now is aware of memory locations inside
sequence objects. In such cases, it automatically over-approximates
the $mem value to be a memory location of the whole sequence object.

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

  • Property mode set to 100644
File size: 368 bytes
Line 
1#include<mem.cvh>
2#include<seq.cvh>
3
4
5int main() {
6 struct {
7 int a[];
8 int b[10];
9 } s;
10 int zero = 0;
11
12 $seq_init(&s.a, 10, &zero);
13 $mem m = ($mem)&s.a[0];
14
15 $assert($mem_contains(m, &s.a));
16 $assert($mem_contains(&s.a, m));
17
18 m = $mem_union_widening(m, ($mem)&s.a[1]);
19
20 $assert($mem_contains(m, &s.a));
21 $assert($mem_contains(&s.a, m));
22}
Note: See TracBrowser for help on using the repository browser.