PR libfortran/64770 Segfault when trying to open existing file with status="new".
[official-gcc.git] / gcc / testsuite / gcc.dg / graphite / pr43657.c
blob18afe1e1c8a90ff1b762c5f2f312cc48a5fe7f89
1 /* { dg-do run } */
2 /* { dg-options "-O1 -ftree-loop-linear" } */
4 extern void abort (void);
6 #define K 32
8 int cond_array[2*K][K];
9 int a[K][K];
10 int out[K];
11 int check_result[K] = {2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
13 __attribute__ ((noinline)) void
14 foo (int c)
16 int res, i, j, k, next;
18 for (k = 0; k < K; k++)
20 res = 0;
21 for (j = 0; j < K; j++)
22 for (i = 0; i < K; i++)
24 next = a[i][j];
25 res = c > cond_array[i+k][j] ? next : res;
28 out[k] = res;
32 int main ()
34 int i, j, k;
36 for (j = 0; j < K; j++)
38 for (i = 0; i < 2*K; i++)
39 cond_array[i][j] = i+j;
41 for (i = 0; i < K; i++)
42 a[i][j] = i+2;
45 foo(5);
47 for (k = 0; k < K; k++)
48 if (out[k] != check_result[k])
49 abort ();
51 return 0;