source: CIVL/examples/contracts/mergeContracts.c@ ac1de0b

1.23 2.0 acw/focus-triggers main test-branch
Last change on this file since ac1de0b was c8d748e, checked in by Ziqing Luo <ziqing@…>, 11 years ago

add test casess

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

  • Property mode set to 100644
File size: 567 bytes
Line 
1#include<assert.h>
2#include<mpi.h>
3#include<civl-mpi.cvh>
4
5$input int in;
6$assume(in > 0);
7MPI_Comm comm = MPI_COMM_WORLD;
8
9int gimmeOne(int x)
10 $requires {$collective(comm) $mpi_isRecvBufEmpty(0)}
11 $requires {$collective(MPI_COMM_WORLD) $true}
12 $requires {x > 0}
13 $ensures {$collective(MPI_COMM_WORLD) $mpi_isRecvBufEmpty(0)}
14 $ensures {$collective(MPI_COMM_WORLD) $result == 1 + x}
15 $ensures {x == in}
16{
17 return 1 + x;
18}
19
20int main(int argc, char * argv[]) {
21 int x;
22
23 MPI_Init(&argc, &argv);
24 x = gimmeOne(in);
25 assert(x == 1 + in);
26 MPI_Finalize();
27}
Note: See TracBrowser for help on using the repository browser.