summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/gomp/for-16.C
blob: dbbed8fe505214bbb0b9dd9480edfc6c7a94c00f (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
// { dg-do compile }

template<typename T>
void foo ()
{
#pragma omp for
  for (unsigned int i = 0; i < 10; i++);
#pragma omp for
  for (int j = 0; ; j++); // { dg-error "missing controlling predicate" }
#pragma omp for
  for (int k = 0; k == 1; k++); // { dg-error "invalid controlling predicate" }
#pragma omp for
  for (int l = 0; l < 10; ); // { dg-error "missing increment expression" }
#pragma omp for
  for (int m = 0; m < 10; m *= 3); // { dg-error "invalid increment expression" }
#pragma omp for
  for (T n = 0; ; n++); // { dg-error "missing controlling predicate" }
#pragma omp for
  for (T o = 0; o == 1; o++); // Error here is emitted only during
			      // instantiation
#pragma omp for
  for (T p = 0; p < 10; ); // { dg-error "missing increment expression" }
#pragma omp for
  for (T q = 0; q < 10; q *= 3); // Error here is emitted only during
				 // instantiation
}

void bar ()
{
#pragma omp for
  for (int m = 0; m < 10; m *= 3); // { dg-error "invalid increment expression" }
}