PR libfortran/64770 Segfault when trying to open existing file with status="new".
[official-gcc.git] / gcc / testsuite / gcc.dg / graphite / run-id-2.c
blob4a2361667abad6d4b1c1339bb275d6171e38807d
1 int a[1] = {1};
3 static int __attribute__((noinline))
4 foo(int n)
6 int i, c = 0;
7 for (i = 0; i < n; i++)
8 c += a[i];
9 return c;
12 int b[2] = {2, 3};
14 static int __attribute__((noinline)) bar(int n)
16 int i, c = 0;
17 for (i = 0; i < n; i++)
18 c += b[i];
19 return c;
22 extern void abort ();
24 int main()
26 if (foo(0) != 0
27 || foo(1) != 1
28 || bar(0) != 0
29 || bar(1) != 2
30 || bar(2) != 5)
31 abort ();
33 return 0;