summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/gomp/sharing-2.C
blob: 6145b92fcf8183d05400ce35ac5349f66f2d4ff8 (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
// { dg-do compile }

struct T
{
  int i;
  mutable int j;
};
struct S
{
  const static int d = 1;
  const static T e;
  void foo (int, T);
};

const int S::d;
const T S::e = { 2, 3 };

void bar (const int &);

void
S::foo (const int x, const T y)
{
  #pragma omp parallel firstprivate (x)
    bar (x);
  #pragma omp parallel firstprivate (d)
    bar (d);
  #pragma omp parallel firstprivate (y)
    bar (y.i);
  #pragma omp parallel firstprivate (e)	// { dg-error "is predetermined" }
    bar (e.i);
  #pragma omp parallel shared (x)	// { dg-error "is predetermined" }
    bar (x);
  #pragma omp parallel shared (d)	// { dg-error "is predetermined" }
    bar (d);
  #pragma omp parallel shared (e)	// { dg-error "is predetermined" }
    bar (e.i);
  #pragma omp parallel shared (y)
    bar (y.i);
  #pragma omp parallel private (x)	// { dg-error "is predetermined" }
    bar (x);
  #pragma omp parallel private (d)	// { dg-error "is predetermined" }
    bar (d);
  #pragma omp parallel private (y)
    bar (y.i);
  #pragma omp parallel private (e)	// { dg-error "is predetermined" }
    bar (e.i);
}