summaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c/pr46886.c
blob: fbdc4e130d31a3b755567ad80ddec816eee258ee (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
/* { dg-do run } */
/* { dg-options "-O -ftree-parallelize-loops=4 -fno-tree-ch -fno-tree-dominator-opts" } */

void abort(void);

int d[1024], e[1024];

int foo (void)
{
  int s = 0;
  int i;
  for (i = 0; i < 1024; i++)
    s += d[i] - e[i];
  return s;
}

int main ()
{
  int i;
  for (i = 0; i < 1024; i++)
    {
      d[i] = i * 2;
      e[i] = i;
    }
  if (foo () != 1023 * 1024 / 2)
    abort ();
  return 0;
}