source: CIVL/examples/languageFeatures/2dpointerTest.cvl@ d96f2926

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

fixed a bug in translating a multi-dimension array into pointer.

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

  • Property mode set to 100644
File size: 606 bytes
Line 
1#include <civlc.h>
2int sh = 0;
3
4void Process(){
5 double ** buf;
6 int *p;
7
8 p = (int *)$malloc($here, 2 * sizeof(int));
9 buf = (double **)$malloc($here, 2 * sizeof(double *));
10 for(int i=0; i<2; i++){
11 buf[i] = (double *)$malloc($here,
12 2 * sizeof(double));
13 }
14
15}
16
17/*void Process(){
18 int *a[6];
19 int b[6];
20
21 for(int i = 0; i < 6; i++){
22 b[i] = i;
23 a[i] = &b[i];
24 }
25 for(int i = 0; i < 6; i++){
26 sh ++;
27 *a[i] = *a[i] + sh;
28 }
29}*/
30
31void main(){
32 $proc procs[2];
33
34 procs[0] = $spawn Process();
35 procs[1] = $spawn Process();
36
37 $wait(procs[0]);
38 $wait(procs[1]);
39}
Note: See TracBrowser for help on using the repository browser.