source: CIVL/examples/pthread/svcomp/pointerSubtraction.c@ bb03188

main test-branch
Last change on this file since bb03188 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: 470 bytes
RevLine 
[b726887]1struct device{
2};
3struct A{
4 int a;
5 int b;
6};
7struct my_data{
8 int lock;
9 struct device dev;
10 struct A shared;
11};
12int main()
13{
14 struct my_data object;
15 struct device* my_dev = &(object.dev);
16 struct my_data* data;
17 struct my_data* $sef$0;
18
19 typeof(((struct my_data*)0)->dev)* __mptr = my_dev;
20 data = (struct my_data*)((char*)__mptr - (unsigned long)(&(((struct my_data*)0)->dev)));
21 (data)->shared.a = 1;
22 (data)->shared.b = (data)->shared.b + 1;
23}
Note: See TracBrowser for help on using the repository browser.