source: CIVL/examples/contracts/contractsMPI/acslAssignsTest.c@ 397ae5f

main test-branch
Last change on this file since 397ae5f 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: 540 bytes
Line 
1#include<mpi.h>
2#pragma CIVL ACSL
3
4struct T {
5 int *x;
6};
7int * y;
8int i[10];
9int (*u)[100];
10int v[100][100][100];
11
12/*@
13 @ requires \valid(x + (0 .. 10));
14 @ requires \valid(u + (0 .. 10));
15 @ requires \valid(y + (0 .. 10));
16 @ assigns u[0 .. 2][0 .. 2], v[0 .. 2][0][0 .. 2],
17 @ x;
18 @ ensures *y == 0;
19 @ behavior test:
20 @ assumes \true;
21 @ assigns *(y + (0..2));
22 @ ensures *y > 0;
23 @*/
24int foo(struct T * x) {
25 return x->x[0];
26}
27
28/*@
29 @ requires \true;
30 @*/
31int g() {
32 void * x;
33
34 return foo(x);
35}
Note: See TracBrowser for help on using the repository browser.