1 // RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-mapping -Wuninitialized
3 // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-mapping -Wuninitialized
8 bool foobool(int argc
) {
11 struct S1
; // expected-note {{declared here}} // expected-note {{forward declaration of 'S1'}}
17 S2(S2
&s2
):a(s2
.a
) { }
25 S3(S3
&s3
):a(s3
.a
) { }
40 S5(const S5
&s5
):a(s5
.a
) { }
46 #pragma omp threadprivate(h) // expected-note {{defined as threadprivate or thread local}}
50 #pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
56 int main(int argc
, char **argv
) {
58 const int da
[5] = { 0 };
64 #pragma omp teams shared // expected-error {{expected '(' after 'shared'}}
67 #pragma omp teams shared ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
70 #pragma omp teams shared () // expected-error {{expected expression}}
73 #pragma omp teams shared (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
76 #pragma omp teams shared (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
79 #pragma omp teams shared (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
82 #pragma omp teams shared (argc)
85 #pragma omp teams shared (S1) // expected-error {{'S1' does not refer to a value}}
88 #pragma omp teams shared (a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}}
91 #pragma omp teams shared (argv[1]) // expected-error {{expected variable name}}
94 #pragma omp teams shared(ba)
97 #pragma omp teams shared(ca)
100 #pragma omp teams shared(da)
103 #pragma omp teams shared(e, g, z)
106 #pragma omp teams shared(h, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be shared}}
109 #pragma omp teams private(i), shared(i) // expected-error {{private variable cannot be shared}} expected-note {{defined as private}}
112 #pragma omp teams firstprivate(i), shared(i) // expected-error {{firstprivate variable cannot be shared}} expected-note {{defined as firstprivate}}
115 #pragma omp teams private(i)
118 #pragma omp teams shared(i)
121 #pragma omp teams shared(j)
124 #pragma omp teams firstprivate(i)
127 #pragma omp teams shared(i)
130 #pragma omp teams shared(j)