| 1 |
/* { dg-require-effective-target size32plus } */ |
| 2 |
|
| 3 |
#define DEBUG 0 |
| 4 |
#if DEBUG |
| 5 |
#include <stdio.h> |
| 6 |
#endif |
| 7 |
|
| 8 |
#define N 111 |
| 9 |
#define M 111 |
| 10 |
|
| 11 |
static int __attribute__((noinline)) |
| 12 |
foo (int *x) |
| 13 |
{ |
| 14 |
int i, j; |
| 15 |
int sum = 0; |
| 16 |
|
| 17 |
for (j = 0; j < M; ++j) |
| 18 |
for (i = 0; i < N; ++i) |
| 19 |
sum += x[M * i + j]; |
| 20 |
|
| 21 |
return sum; |
| 22 |
} |
| 23 |
|
| 24 |
extern void abort (); |
| 25 |
|
| 26 |
int |
| 27 |
main (void) |
| 28 |
{ |
| 29 |
int A[N*M]; |
| 30 |
int i, res; |
| 31 |
|
| 32 |
for (i = 0; i < N*M; i++) |
| 33 |
A[i] = 2; |
| 34 |
|
| 35 |
res = foo (A); |
| 36 |
|
| 37 |
#if DEBUG |
| 38 |
fprintf (stderr, "res = %d \n", res); |
| 39 |
#endif |
| 40 |
|
| 41 |
if (res != 24642) |
| 42 |
abort (); |
| 43 |
|
| 44 |
return 0; |
| 45 |
} |