1 // RUN: %clang_cc1 -verify -fopenmp %s
6 bool foobool(int argc) {
10 struct S1; // expected-note {{declared here}}
16 S2(S2 &s2):a(s2.a) { }
24 S3(S3 &s3):a(s3.a) { }
39 S5(const S5 &s5):a(s5.a) { }
45 #pragma omp threadprivate(h) // expected-note {{defined as threadprivate or thread local}}
49 #pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
55 int main(int argc, char **argv) {
57 const int da[5] = { 0 };
62 #pragma omp target teams shared // expected-error {{expected '(' after 'shared'}}
64 #pragma omp target teams shared ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
66 #pragma omp target teams shared () // expected-error {{expected expression}}
68 #pragma omp target teams shared (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
70 #pragma omp target teams shared (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
72 #pragma omp target teams shared (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
74 #pragma omp target teams shared (argc)
76 #pragma omp target teams shared (S1) // expected-error {{'S1' does not refer to a value}}
78 #pragma omp target teams shared (a, b, c, d, f)
80 #pragma omp target teams shared (argv[1]) // expected-error {{expected variable name}}
82 #pragma omp target teams shared(ba)
84 #pragma omp target teams shared(ca)
86 #pragma omp target teams shared(da)
88 #pragma omp target teams shared(e, g)
90 #pragma omp target teams shared(h, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be shared}}
92 #pragma omp target teams private(i), shared(i) // expected-error {{private variable cannot be shared}} expected-note {{defined as private}}
94 #pragma omp target teams firstprivate(i), shared(i) // expected-error {{firstprivate variable cannot be shared}} expected-note {{defined as firstprivate}}
96 #pragma omp target teams private(i)
98 #pragma omp target teams shared(i)
100 #pragma omp target teams shared(j)
102 #pragma omp target teams firstprivate(i)
104 #pragma omp target teams shared(i)
106 #pragma omp target teams shared(j)