summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/autopar/parallelization-1.c
blob: 1b400fbfb3376952dbfd73aa69f5779e80db41b5 (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
/* { dg-do compile } */
/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops2-details -fdump-tree-optimized" } */

void abort (void);

void parloop (int N)
{
  int i;
  int x[10000990];

  for (i = 0; i < N; i++)
    x[i] = i + 3;

  for (i = 0; i < N; i++)
    {
      if (x[i] != i + 3)
	abort ();
    }
}

int main(void)
{
  parloop(10000);

  return 0;
}

/* Check that the first loop in parloop got parallelized.  */

/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops2" } } */
/* { dg-final { scan-tree-dump-times "loopfn" 4 "optimized" } } */