source: CIVL/examples/backend/showTrans.cvl@ cbea8be

1.23 2.0 main test-branch
Last change on this file since cbea8be was 7329898, checked in by Manchun Zheng <zmanchun@…>, 11 years ago

minor correction of abs call analyer; printed expression values of statements for transition printing.

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

  • Property mode set to 100644
File size: 673 bytes
Line 
1#include <civlc.cvh>
2
3typedef struct point{
4 int x;
5 int y;
6} point_t;
7
8int times2(int k, int t){
9 return 2*k*t;
10}
11
12void f(){
13 int x=0;
14
15 x++;
16}
17
18void main(){
19 int a=2;
20 int *b=&a;
21 void (*g)(void)=&f;
22 $proc p=$spawn f();
23 int c[2][2];
24 $domain(2) dom=($domain(2)){1 .. 4#2, 1 .. 4#2};
25 point_t pt;
26
27 pt.x=1;
28 pt.y=pt.x+5;
29 $wait(p);
30 p=$spawn g();
31 $wait(p);
32 a=times2(a*a, a);
33 a=$next_time_count();
34 *b=$next_time_count();
35 $for(int i, j: dom)
36 c[(i-1)/2][(j-1)/2] = i*10 + j;
37 dom=($domain(2)){0 .. 1, 0 .. 1};
38 $parfor(int i, j: dom)
39 times2(i, j);
40 b=(int*)$malloc($root, sizeof(int)*2);
41 b[0]=c[0][0];
42 b[1]=c[1][1];
43 $free(b);
44}
Note: See TracBrowser for help on using the repository browser.