summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/autopar/pr39500-1.c
blob: 6428bd062fec9fbf98e35457b62807c9ca893b30 (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
/* pr39500: autopar fails to parallel */
/* origin: nemokingdom@gmail.com(LiFeng) */
/* { dg-do compile } */
/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details" } */

void abort (void);

int main (void)
{
  int i;
  int x[100000];

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

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

  return 0;
}

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

/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops" } } */
/* { dg-final { cleanup-tree-dump "parloops" } } */