7 int ARCHnodes, ARCHnodes1;
9 /* The inner most dimension escapes.
10 The two external dimensions are flattened
11 after being transposed. */
12 /*--------------------------------------------------------------------------*/
15 main (int argc, char **argv)
22 /* Dynamic memory allocations and initializations */
26 for (j = 0; j < 4; j++)
28 for (i = 0; i < 3; i++)
30 for (k = 0; k < 2; k++)
32 printf ("[%d][%d][%d]=%d ", i, j, k, vel[k][i][j]);
40 for (i = 0; i < 2; i++)
41 for (j = 0; j < 3; j++)
47 for (i = 0; i < 2; 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 fprintf (stderr, "malloc failed for vel[%d]\n", i);
76 for (i = 0; i < ARCHnodes; i++)
78 for (j = 0; j < 3; j++)
80 vel[i][j] = (int *) malloc (ARCHnodes1 * sizeof (int));
83 for (i = 0; i < ARCHnodes; i++)
85 for (j = 0; j < 3; j++)
87 for (k = 0; k < ARCHnodes1; k++)
89 printf ("acc to dim2 ");
98 /*--------------------------------------------------------------------------*/
99 /* { dg-final-use { scan-ipa-dump-times "Flattened 2 dimensions" 1 "matrix-reorg" } } */
100 /* { dg-final-use { scan-ipa-dump-times "Transposed" 2 "matrix-reorg" } } */
101 /* { dg-final-use { cleanup-ipa-dump "matrix-reorg" } } */