summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/graphite/run-id-2.c
blob: 4a2361667abad6d4b1c1339bb275d6171e38807d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
int a[1] = {1};

static int __attribute__((noinline))
foo(int n)
{
  int i, c = 0;
  for (i = 0; i < n; i++)
    c += a[i];
  return c;
}

int b[2] = {2, 3};

static int __attribute__((noinline)) bar(int n)
{
  int i, c = 0;
  for (i = 0; i < n; i++)
    c += b[i];
  return c;
}

extern void abort ();

int main()
{
  if (foo(0) != 0
      || foo(1) != 1
      || bar(0) != 0
      || bar(1) != 2
      || bar(2) != 5)
    abort ();

  return 0;
}