summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/gomp/pr41967.C
blob: 0eb489e8beefd2dfc52b1323b92332b471b80451 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// PR c++/41967
// { dg-do compile }
// { dg-options "-fopenmp" }

int
foo ()
{
  int sum = 0;
#pragma omp for collapse(2)
  for (int i = 0; i < 5; ++i)
    {
      for (int j = 0; j < 5; ++j)
	++sum;
      ++sum;	// { dg-error "collapsed loops not perfectly nested" }
    }
  return sum;
}