source: CIVL/examples/contracts/contractsSeq/pointers4.c

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: 340 bytes
RevLine 
[9aaed1f]1#include <assert.h>
2
3/*@ requires \valid(x + (0 .. 3));
[4e62451]4
[9aaed1f]5 @ requires \valid(x[0] + (0 .. 3));
6 @ requires \valid(x[1] + (0 .. 3));
7 @ requires \valid(x[2] + (0 .. 3));
8*/
9int add(int ** x)
10{
11 int * y = x[0]+1;
12
13 x[0][0] = 9;
14 x[0][1] = 8;
15 assert(x[0][0] - x[0][1] == 1);
16 return 0;
17}
18
19
20int main() {
21 add((void*)0);
22 return 0;
23}
Note: See TracBrowser for help on using the repository browser.