summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/gomp/clause-3.C
blob: 6b3d410a9334c442405287bd8889526dcd6ee69c (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// { dg-do compile }
// { dg-require-effective-target tls }

#define p parallel

extern void bar (void);
extern char q[]; // { dg-error "has incomplete type" }
int t;
#pragma omp threadprivate (t)

void
foo (int x)
{
  char *p;
  struct S { int i; int j; } s;
  char a[32];
  double d;
  int i;
  const int c = 8;
#pragma omp p shared (x, x) // { dg-error "more than once" }
    ;
#pragma omp p private (x) private (x) // { dg-error "more than once" }
    ;
#pragma omp p shared (x) firstprivate (x) // { dg-error "more than once" }
    ;
#pragma omp p firstprivate (x, x) // { dg-error "more than once" }
    ;
#pragma omp p for shared (x) lastprivate (x) // { dg-error "more than once" }
  for (i = 0; i < 10; i++)
    ;
#pragma omp p for private (x) lastprivate (x) // { dg-error "more than once" }
  for (i = 0; i < 10; i++)
    ;
#pragma omp p for lastprivate (x, x) // { dg-error "more than once" }
  for (i = 0; i < 10; i++)
    ;
#pragma omp single private (x) copyprivate (x) // { dg-error "more than once" }
    ;
#pragma omp p shared (bar) // { dg-error "is not a variable" }
    ;
#pragma omp p private (bar) // { dg-error "is not a variable" }
    ;
#pragma omp p firstprivate (bar) // { dg-error "is not a variable" }
    ;
#pragma omp p reduction (+:p) // { dg-error "has invalid type for" }
    ;
#pragma omp p reduction (*:s) // { dg-error "has invalid type for" }
    ;
#pragma omp p reduction (-:a) // { dg-error "has invalid type for" }
    ;
  d = 0;
#pragma omp p reduction (*:d)
    ;
#pragma omp p reduction (|:d) // { dg-error "has invalid type for" }
    ;
#pragma omp p reduction (&&:d) // { dg-error "has invalid type for" }
    ;
#pragma omp p copyin (d) // { dg-error "must be 'threadprivate'" }
    ;
#pragma omp p copyin (x) // { dg-error "must be 'threadprivate'" }
    ;
#pragma omp p for firstprivate (x) lastprivate (x)
  for (i = 0; i < 10; i++)
    ;
#pragma omp p private (q) // { dg-error "unspecified bounds" }
    ;
#pragma omp p firstprivate (q) // { dg-error "unspecified bounds" }
    ;
#pragma omp p for lastprivate (q) // { dg-error "unspecified bounds" }
  for (i = 0; i < 10; i++)
    ;
#pragma omp p shared (t) // { dg-error "predetermined 'threadprivate'" }
    ;
#pragma omp p private (t) // { dg-error "predetermined 'threadprivate'" }
    ;
#pragma omp p firstprivate (t) // { dg-error "predetermined 'threadprivate'" }
    ;
#pragma omp p for lastprivate (t) // { dg-error "predetermined 'threadpriv" }
  for (i = 0; i < 10; i++)
    ;
#pragma omp p reduction (*:t) // { dg-error "predetermined 'threadprivate'" }
    ;
#pragma omp p shared (c) // { dg-error "predetermined 'shared'" }
    ;
#pragma omp p private (c) // { dg-error "predetermined 'shared'" }
    ;
#pragma omp p firstprivate (c) // { dg-error "predetermined 'shared'" }
    ;
#pragma omp p for lastprivate (c) // { dg-error "predetermined 'shared'" }
  for (i = 0; i < 10; i++)
    ;
#pragma omp p reduction (*:c) // { dg-error "predetermined 'shared'" }
    ;
}