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
) {
12 struct S1
; // expected-note {{declared here}} expected-note {{forward declaration of 'S1'}}
18 S2(S2
&s2
):a(s2
.a
) { }
26 S3(S3
&s3
):a(s3
.a
) { }
41 S5(const S5
&s5
):a(s5
.a
) { }
47 #pragma omp threadprivate(h) // expected-note {{defined as threadprivate or thread local}}
51 #pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
57 int main(int argc
, char **argv
) {
59 const int da
[5] = { 0 };
65 #pragma omp teams distribute parallel for simd shared // expected-error {{expected '(' after 'shared'}}
66 for (int j
=0; j
<100; j
++) foo();
68 #pragma omp teams distribute parallel for simd shared ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
69 for (int j
=0; j
<100; j
++) foo();
71 #pragma omp teams distribute parallel for simd shared () // expected-error {{expected expression}}
72 for (int j
=0; j
<100; j
++) foo();
74 #pragma omp teams distribute parallel for simd shared (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
75 for (int j
=0; j
<100; j
++) foo();
77 #pragma omp teams distribute parallel for simd shared (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
78 for (int j
=0; j
<100; j
++) foo();
80 #pragma omp teams distribute parallel for simd shared (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
81 for (int j
=0; j
<100; j
++) foo();
83 #pragma omp teams distribute parallel for simd shared (argc)
84 for (int j
=0; j
<100; j
++) foo();
86 #pragma omp teams distribute parallel for simd shared (S1) // expected-error {{'S1' does not refer to a value}}
87 for (int j
=0; j
<100; j
++) foo();
89 #pragma omp teams distribute parallel for simd shared (a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}}
90 for (int j
=0; j
<100; j
++) foo();
92 #pragma omp teams distribute parallel for simd shared (argv[1]) // expected-error {{expected variable name}}
93 for (int j
=0; j
<100; j
++) foo();
95 #pragma omp teams distribute parallel for simd shared(ba)
96 for (int j
=0; j
<100; j
++) foo();
98 #pragma omp teams distribute parallel for simd shared(ca)
99 for (int j
=0; j
<100; j
++) foo();
101 #pragma omp teams distribute parallel for simd shared(da)
102 for (int j
=0; j
<100; j
++) foo();
104 #pragma omp teams distribute parallel for simd shared(e, g)
105 for (int j
=0; j
<100; j
++) foo();
107 #pragma omp teams distribute parallel for simd shared(h, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be shared}}
108 for (int j
=0; j
<100; j
++) foo();
110 #pragma omp teams distribute parallel for simd private(i), shared(i) // expected-error {{private variable cannot be shared}} expected-note {{defined as private}}
111 for (int j
=0; j
<100; j
++) foo();
113 #pragma omp teams distribute parallel for simd firstprivate(i), shared(i) // expected-error {{firstprivate variable cannot be shared}} expected-note {{defined as firstprivate}}
114 for (int j
=0; j
<100; j
++) foo();
116 #pragma omp teams distribute parallel for simd private(i)
117 for (int j
=0; j
<100; j
++) foo();
119 #pragma omp teams distribute parallel for simd shared(i)
120 for (int j
=0; j
<100; j
++) foo();
122 #pragma omp teams distribute parallel for simd shared(j)
123 for (int j
=0; j
<100; j
++) foo();
125 #pragma omp teams distribute parallel for simd firstprivate(i)
126 for (int j
=0; j
<100; j
++) foo();