| 1 |
/* { dg-require-effective-target size32plus } */ |
| 2 |
|
| 3 |
#define DEBUG 0 |
| 4 |
#if DEBUG |
| 5 |
#include <stdio.h> |
| 6 |
#endif |
| 7 |
|
| 8 |
#define NMAX 2000 |
| 9 |
|
| 10 |
static int x1[NMAX], x2[NMAX], a[NMAX][NMAX], y1[NMAX], y2[NMAX]; |
| 11 |
|
| 12 |
static int __attribute__((noinline)) |
| 13 |
mvt (long N) |
| 14 |
{ |
| 15 |
|
| 16 |
int i,j; |
| 17 |
|
| 18 |
for (i = 0; i < N; i++) |
| 19 |
for (j = 0; j < N; j++) |
| 20 |
x1[i] = x1[i] + a[i][j] * y1[j]; |
| 21 |
|
| 22 |
/* These two loops should be interchanged. */ |
| 23 |
for (i = 0; i < N; i++) |
| 24 |
for (j = 0; j < N; j++) |
| 25 |
x2[i] = x2[i] + a[j][i] * y2[j]; |
| 26 |
|
| 27 |
return x1[0] + x2[0]; |
| 28 |
} |
| 29 |
|
| 30 |
extern void abort (); |
| 31 |
|
| 32 |
int |
| 33 |
main (void) |
| 34 |
{ |
| 35 |
int i, j, res; |
| 36 |
|
| 37 |
for (i = 0; i < NMAX; i++) |
| 38 |
for (j = 0; j < NMAX; j++) |
| 39 |
a[i][j] = i + j; |
| 40 |
|
| 41 |
for (i = 0; i < NMAX; i++) |
| 42 |
{ |
| 43 |
x1[i] = 0; |
| 44 |
x2[i] = 2*i; |
| 45 |
y1[i] = 100 - i; |
| 46 |
y2[i] = i; |
| 47 |
} |
| 48 |
|
| 49 |
res = mvt (NMAX); |
| 50 |
|
| 51 |
#if DEBUG |
| 52 |
fprintf (stderr, "res = %d \n", res); |
| 53 |
#endif |
| 54 |
|
| 55 |
if (res != 199900000) |
| 56 |
abort (); |
| 57 |
|
| 58 |
return 0; |
| 59 |
} |
| 60 |
|
| 61 |
/* { dg-final { scan-tree-dump "tiled by" "graphite" } } */ |