2 /* { dg-options "-fwhole-program" } */
10 int ARCHnodes
, ARCHnodes1
;
13 /* The whole matrix VEL is flattened (3 dimensions).
14 The dimensions are NOT transposed. */
15 /*--------------------------------------------------------------------------*/
18 main (int argc
, char **argv
)
25 /* Dynamic memory allocations and initializations */
29 for (j
= 0; j
< 3; j
++)
31 for (i
= 0; i
< 2; i
++)
33 for (k
= 0; k
< 4; k
++)
35 printf ("[%d][%d][%d]=%d ", i
, j
, k
, vel
[i
][j
][k
]);
41 for (i
= 0; i
< 2; i
++)
42 for (j
= 0; j
< 3; j
++)
45 for (i
= 0; i
< 2; i
++)
52 /*--------------------------------------------------------------------------*/
53 /* Dynamic memory allocations and initializations */
62 vel
= (int ***) malloc (ARCHnodes
* sizeof (int **));
64 for (i
= 0; i
< ARCHnodes
; i
++)
66 vel
[i
] = (int **) malloc (3 * sizeof (int *));
67 if (vel
[i
] == (int **) NULL
)
69 printf ("malloc failed for vel[%d]\n", i
);
73 for (i
= 0; i
< ARCHnodes
; i
++)
75 for (j
= 0; j
< 3; j
++)
77 vel
[i
][j
] = (int *) malloc (ARCHnodes1
* sizeof (int));
80 for (i
= 0; i
< ARCHnodes
; i
++)
82 for (j
= 0; j
< 3; j
++)
84 for (k
= 0; k
< ARCHnodes1
; k
++)
86 printf ("acc to dim2 ");
95 /*--------------------------------------------------------------------------*/