summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gomp/pr27415.c
blob: 010a6c3e4dd1281ce738d313eaf131b011327fbd (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)	/* { dg-error "should not be firstprivate" } */
  for (i = 0; i < 10; i++)
    ;
}

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)	/* { dg-error "should not be reduction" } */
  for (i = 0; i < 10; i++)
    ;
}

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