summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/gomp/pr27415.C
blob: 81f0ed5c6b7bc163283683a0b2cf990cb8f53398 (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// PR middle-end/27415
// { dg-do compile }

void
test1 (void)
{
  int i = 0;
#pragma omp parallel
#pragma omp for firstprivate (i)		// { dg-error "should not be firstprivate" }
  for (i = 0; i < 10; i++)
    ;
}

void
test2 (void)
{
  int i = 0;
#pragma omp parallel for firstprivate (i)
  for (i = 0; i < 10; i++)			// { dg-error "should not be firstprivate" }
    ;
}

void
test3 (void)
{
  int i = 0;
#pragma omp parallel
#pragma omp for reduction (+:i)			// { dg-error "should not be reduction" }
  for (i = 0; i < 10; i++)
    ;
}

void
test4 (void)
{
  int i = 0;
#pragma omp parallel for reduction (*:i)
  for (i = 0; i < 10; i++)			// { dg-error "should not be reduction" }
    ;
}

void
test5 (void)
{
  int i = 0;
#pragma omp parallel firstprivate (i)
#pragma omp for
  for (i = 0; i < 10; i++)
    ;
}