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 };
63 #pragma omp teams distribute parallel for simd shared // expected-error {{expected '(' after 'shared'}}
64 for (int j=0; j<100; j++) foo();
66 #pragma omp teams distribute parallel for simd shared ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
67 for (int j=0; j<100; j++) foo();
69 #pragma omp teams distribute parallel for simd shared () // expected-error {{expected expression}}
70 for (int j=0; j<100; j++) foo();
72 #pragma omp teams distribute parallel for simd shared (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
73 for (int j=0; j<100; j++) foo();
75 #pragma omp teams distribute parallel for simd shared (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
76 for (int j=0; j<100; j++) foo();
78 #pragma omp teams distribute parallel for simd shared (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
79 for (int j=0; j<100; j++) foo();
81 #pragma omp teams distribute parallel for simd shared (argc)
82 for (int j=0; j<100; j++) foo();
84 #pragma omp teams distribute parallel for simd shared (S1) // expected-error {{'S1' does not refer to a value}}
85 for (int j=0; j<100; j++) foo();
87 #pragma omp teams distribute parallel for simd shared (a, b, c, d, f)
88 for (int j=0; j<100; j++) foo();
90 #pragma omp teams distribute parallel for simd shared (argv[1]) // expected-error {{expected variable name}}
91 for (int j=0; j<100; j++) foo();
93 #pragma omp teams distribute parallel for simd shared(ba)
94 for (int j=0; j<100; j++) foo();
96 #pragma omp teams distribute parallel for simd shared(ca)
97 for (int j=0; j<100; j++) foo();
99 #pragma omp teams distribute parallel for simd shared(da)
100 for (int j=0; j<100; j++) foo();
102 #pragma omp teams distribute parallel for simd shared(e, g)
103 for (int j=0; j<100; j++) foo();
105 #pragma omp teams distribute parallel for simd shared(h, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be shared}}
106 for (int j=0; j<100; j++) foo();
108 #pragma omp teams distribute parallel for simd private(i), shared(i) // expected-error {{private variable cannot be shared}} expected-note {{defined as private}}
109 for (int j=0; j<100; j++) foo();
111 #pragma omp teams distribute parallel for simd firstprivate(i), shared(i) // expected-error {{firstprivate variable cannot be shared}} expected-note {{defined as firstprivate}}
112 for (int j=0; j<100; j++) foo();
114 #pragma omp teams distribute parallel for simd private(i)
115 for (int j=0; j<100; j++) foo();
117 #pragma omp teams distribute parallel for simd shared(i)
118 for (int j=0; j<100; j++) foo();
120 #pragma omp teams distribute parallel for simd shared(j)
121 for (int j=0; j<100; j++) foo();
123 #pragma omp teams distribute parallel for simd firstprivate(i)
124 for (int j=0; j<100; j++) foo();