1 // RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
3 // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
8 bool foobool(int argc
) {
12 struct S1
; // expected-note {{declared here}}
19 S2(S2
&s2
) : a(s2
.a
) {}
28 S3(S3
&s3
) : a(s3
.a
) {}
44 S5(const S5
&s5
) : a(s5
.a
) {}
51 #pragma omp threadprivate(h) // expected-note {{defined as threadprivate or thread local}}
55 #pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
61 int main(int argc
, char **argv
) {
63 const int da
[5] = {0};
68 #pragma omp parallel masked shared // expected-error {{expected '(' after 'shared'}}
70 #pragma omp parallel masked shared( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
72 #pragma omp parallel masked shared() // expected-error {{expected expression}}
74 #pragma omp parallel masked shared(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
76 #pragma omp parallel masked shared(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
78 #pragma omp parallel masked shared(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
80 #pragma omp parallel masked shared(argc)
82 #pragma omp parallel masked shared(S1) // expected-error {{'S1' does not refer to a value}}
84 #pragma omp parallel masked shared(a, b, c, d, f, k)
86 #pragma omp parallel masked shared(argv[1]) // expected-error {{expected variable name}}
88 #pragma omp parallel masked shared(ba)
90 #pragma omp parallel masked shared(ca)
92 #pragma omp parallel masked shared(da)
94 #pragma omp parallel masked shared(e, g)
96 #pragma omp parallel masked shared(h, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be shared}}
98 #pragma omp parallel masked private(i), shared(i) // expected-error {{private variable cannot be shared}} expected-note {{defined as private}}
100 #pragma omp parallel masked firstprivate(i), shared(i) // expected-error {{firstprivate variable cannot be shared}} expected-note {{defined as firstprivate}}
102 #pragma omp parallel masked private(i)
104 #pragma omp parallel masked shared(i)
106 #pragma omp parallel masked shared(j)
110 #pragma omp parallel masked firstprivate(i)
112 #pragma omp parallel masked shared(i)
114 #pragma omp parallel masked shared(j)