2 /* { dg-options "-fwhole-program" } */
10 int ARCHnodes
, ARCHnodes1
;
12 /* The inner most dimension escapes.
13 The two external dimensions are flattened
14 after being transposed. */
15 /*--------------------------------------------------------------------------*/
18 main (int argc
, char **argv
)
25 /* Dynamic memory allocations and initializations */
29 for (j
= 0; j
< 4; j
++)
31 for (i
= 0; i
< 3; i
++)
33 for (k
= 0; k
< 2; k
++)
35 printf ("[%d][%d][%d]=%d ", i
, j
, k
, vel
[k
][i
][j
]);
43 for (i
= 0; i
< 2; i
++)
44 for (j
= 0; j
< 3; j
++)
50 for (i
= 0; i
< 2; i
++)
57 /*--------------------------------------------------------------------------*/
58 /* Dynamic memory allocations and initializations */
67 vel
= (int ***) malloc (ARCHnodes
* sizeof (int **));
69 for (i
= 0; i
< ARCHnodes
; i
++)
71 vel
[i
] = (int **) malloc (3 * sizeof (int *));
72 if (vel
[i
] == (int **) NULL
)
74 printf ("malloc failed for vel[%d]\n", i
);
78 for (i
= 0; i
< ARCHnodes
; i
++)
80 for (j
= 0; j
< 3; j
++)
82 vel
[i
][j
] = (int *) malloc (ARCHnodes1
* sizeof (int));
85 for (i
= 0; i
< ARCHnodes
; i
++)
87 for (j
= 0; j
< 3; j
++)
89 for (k
= 0; k
< ARCHnodes1
; k
++)
91 printf ("acc to dim2 ");
100 /*--------------------------------------------------------------------------*/