2 /* { dg-options "-fwhole-program" } */
11 int ARCHnodes
, ARCHnodes1
;
14 /* The last dimension of VEL escapes because of
15 the assignment : *vel[1] =...
16 Only the two external dimensions are flattened. */
18 /*--------------------------------------------------------------------------*/
21 main (int argc
, char **argv
)
28 /* Dynamic memory allocations and initializations */
32 for (i
= 0; i
< ARCHnodes
; i
++)
34 for (j
= 0; j
< 3; j
++)
36 for (k
= 0; k
< ARCHnodes1
; k
++)
37 printf ("[%d][%d][%d]=%d ", i
, j
, k
, vel
[i
][j
][k
]);
42 for (i
= 0; i
< ARCHnodes
; i
++)
43 for (j
= 0; j
< 3; j
++)
44 if (!(i
== 1 && j
== 0))
47 for (i
= 0; i
< ARCHnodes
; i
++)
54 /*--------------------------------------------------------------------------*/
55 /* Dynamic memory allocations and initializations */
64 vel
= (int ***) malloc (ARCHnodes
* sizeof (int **));
66 for (i
= 0; i
< ARCHnodes
; i
++)
68 vel
[i
] = (int **) malloc (3 * sizeof (int *));
69 if (vel
[i
] == (int **) NULL
)
71 printf ("malloc failed for vel[%d]\n", i
);
75 for (i
= 0; i
< ARCHnodes
; i
++)
77 for (j
= 0; j
< 3; j
++)
79 vel
[i
][j
] = (int *) malloc (ARCHnodes1
* sizeof (int));
82 for (i
= 0; i
< ARCHnodes
; i
++)
84 for (j
= 0; j
< 3; j
++)
86 for (k
= 0; k
< ARCHnodes1
; k
++)
96 /*--------------------------------------------------------------------------*/