1 /*===- test/Regression/Transforms/Scalar/DecomposeMultiDimRefs.cpp -----=*
3 * This is a regression test for the DecomposeArrayRefs pass.
4 * It tests several different combinations of structure and
5 * array indexes in individual references. It does *not* yet
6 * sufficiently test type-unsafe operations like treating a
7 * 1-D array as a 2-D or 3-D array. (multidim.ll in this directory
8 * tests a simple case of that though.)
9 *===---------------------------------------------------------------------===*/
14 typedef struct Flat_struct {
19 typedef struct Mixed_struct {
28 InitializeMixed(Mixed_t* M, int base)
33 for (i=0; i < 10; ++i) {
40 for (i=0; i < 10; ++i)
41 for (j=0; j < 10; ++j) {
43 coord = i*10 + j + base;
48 for (i=0; i < 10; ++i) {
51 ratio = i / 10 + base;
60 main(int argc, char** argv)
66 printf("Sum(M) = %.2f\n", InitializeMixed(&M, 100));
69 printf("Sum(MA[%d]) = %.2f\n", i, InitializeMixed(&MA[i], 400));