1b8552abfSAlexey Bataev // RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
2b8552abfSAlexey Bataev
3b8552abfSAlexey Bataev // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
4b8552abfSAlexey Bataev
5b8552abfSAlexey Bataev typedef void **omp_allocator_handle_t;
6*8026394dSAlexey Bataev extern const omp_allocator_handle_t omp_null_allocator;
7b8552abfSAlexey Bataev extern const omp_allocator_handle_t omp_default_mem_alloc;
8b8552abfSAlexey Bataev extern const omp_allocator_handle_t omp_large_cap_mem_alloc;
9b8552abfSAlexey Bataev extern const omp_allocator_handle_t omp_const_mem_alloc;
10b8552abfSAlexey Bataev extern const omp_allocator_handle_t omp_high_bw_mem_alloc;
11b8552abfSAlexey Bataev extern const omp_allocator_handle_t omp_low_lat_mem_alloc;
12b8552abfSAlexey Bataev extern const omp_allocator_handle_t omp_cgroup_mem_alloc;
13b8552abfSAlexey Bataev extern const omp_allocator_handle_t omp_pteam_mem_alloc;
14b8552abfSAlexey Bataev extern const omp_allocator_handle_t omp_thread_mem_alloc;
15b8552abfSAlexey Bataev
foo()16b8552abfSAlexey Bataev void foo() {
17b8552abfSAlexey Bataev }
18b8552abfSAlexey Bataev
foobool(int argc)19b8552abfSAlexey Bataev bool foobool(int argc) {
20b8552abfSAlexey Bataev return argc;
21b8552abfSAlexey Bataev }
22b8552abfSAlexey Bataev
xxx(int argc)23b8552abfSAlexey Bataev void xxx(int argc) {
24b8552abfSAlexey Bataev int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
25b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
26b8552abfSAlexey Bataev for (int i = 0; i < 10; ++i)
27b8552abfSAlexey Bataev ;
28b8552abfSAlexey Bataev }
29b8552abfSAlexey Bataev
30b8552abfSAlexey Bataev struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
31b8552abfSAlexey Bataev extern S1 a;
32b8552abfSAlexey Bataev class S2 {
33b8552abfSAlexey Bataev mutable int a;
34b8552abfSAlexey Bataev
35b8552abfSAlexey Bataev public:
S2()36b8552abfSAlexey Bataev S2() : a(0) {}
S2(const S2 & s2)37b8552abfSAlexey Bataev S2(const S2 &s2) : a(s2.a) {}
38b8552abfSAlexey Bataev static float S2s;
39b8552abfSAlexey Bataev static const float S2sc;
40b8552abfSAlexey Bataev };
41b8552abfSAlexey Bataev const float S2::S2sc = 0;
42b8552abfSAlexey Bataev const S2 b;
43b8552abfSAlexey Bataev const S2 ba[5];
44b8552abfSAlexey Bataev class S3 {
45b8552abfSAlexey Bataev int a;
46b8552abfSAlexey Bataev S3 &operator=(const S3 &s3);
47b8552abfSAlexey Bataev
48b8552abfSAlexey Bataev public:
S3()49b8552abfSAlexey Bataev S3() : a(0) {} // expected-note 2 {{candidate constructor not viable: requires 0 arguments, but 1 was provided}}
S3(S3 & s3)50b8552abfSAlexey Bataev S3(S3 &s3) : a(s3.a) {} // expected-note 2 {{candidate constructor not viable: 1st argument ('const S3') would lose const qualifier}}
51b8552abfSAlexey Bataev };
52b8552abfSAlexey Bataev const S3 c;
53b8552abfSAlexey Bataev const S3 ca[5];
54b8552abfSAlexey Bataev extern const int f;
55b8552abfSAlexey Bataev class S4 {
56b8552abfSAlexey Bataev int a;
57b8552abfSAlexey Bataev S4();
58b8552abfSAlexey Bataev S4(const S4 &s4); // expected-note 2 {{implicitly declared private here}}
59b8552abfSAlexey Bataev
60b8552abfSAlexey Bataev public:
S4(int v)61b8552abfSAlexey Bataev S4(int v) : a(v) {}
62b8552abfSAlexey Bataev };
63b8552abfSAlexey Bataev class S5 {
64b8552abfSAlexey Bataev int a;
S5(const S5 & s5)65b8552abfSAlexey Bataev S5(const S5 &s5) : a(s5.a) {} // expected-note 4 {{implicitly declared private here}}
66b8552abfSAlexey Bataev
67b8552abfSAlexey Bataev public:
S5()68b8552abfSAlexey Bataev S5() : a(0) {}
S5(int v)69b8552abfSAlexey Bataev S5(int v) : a(v) {}
70b8552abfSAlexey Bataev };
71b8552abfSAlexey Bataev class S6 {
72b8552abfSAlexey Bataev int a;
S6()73b8552abfSAlexey Bataev S6() : a(0) {}
74b8552abfSAlexey Bataev
75b8552abfSAlexey Bataev public:
S6(const S6 & s6)76b8552abfSAlexey Bataev S6(const S6 &s6) : a(s6.a) {}
S6(int v)77b8552abfSAlexey Bataev S6(int v) : a(v) {}
78b8552abfSAlexey Bataev };
79b8552abfSAlexey Bataev
80b8552abfSAlexey Bataev S3 h;
81b8552abfSAlexey Bataev #pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}}
82b8552abfSAlexey Bataev
83b8552abfSAlexey Bataev template <class I, class C>
foomain(int argc,char ** argv)84b8552abfSAlexey Bataev int foomain(int argc, char **argv) {
85b8552abfSAlexey Bataev I e(4);
86b8552abfSAlexey Bataev C g(5);
87b8552abfSAlexey Bataev int i, z;
88b8552abfSAlexey Bataev int &j = i;
89b8552abfSAlexey Bataev #pragma omp parallel
90b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate // expected-error {{expected '(' after 'firstprivate'}}
91b8552abfSAlexey Bataev for (int k = 0; k < argc; ++k)
92b8552abfSAlexey Bataev ++k;
93b8552abfSAlexey Bataev #pragma omp parallel
94b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
95b8552abfSAlexey Bataev for (int k = 0; k < argc; ++k)
96b8552abfSAlexey Bataev ++k;
97b8552abfSAlexey Bataev #pragma omp parallel
98b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate() // expected-error {{expected expression}}
99b8552abfSAlexey Bataev for (int k = 0; k < argc; ++k)
100b8552abfSAlexey Bataev ++k;
101b8552abfSAlexey Bataev #pragma omp parallel
102b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
103b8552abfSAlexey Bataev for (int k = 0; k < argc; ++k)
104b8552abfSAlexey Bataev ++k;
105b8552abfSAlexey Bataev #pragma omp parallel
106b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
107b8552abfSAlexey Bataev for (int k = 0; k < argc; ++k)
108b8552abfSAlexey Bataev ++k;
109b8552abfSAlexey Bataev #pragma omp parallel
110b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
111b8552abfSAlexey Bataev for (int k = 0; k < argc; ++k)
112b8552abfSAlexey Bataev ++k;
113b8552abfSAlexey Bataev #pragma omp parallel
114b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
115b8552abfSAlexey Bataev for (int k = 0; k < argc; ++k)
116b8552abfSAlexey Bataev ++k;
117b8552abfSAlexey Bataev #pragma omp parallel
118b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(S1) // expected-error {{'S1' does not refer to a value}}
119b8552abfSAlexey Bataev for (int k = 0; k < argc; ++k)
120b8552abfSAlexey Bataev ++k;
121b8552abfSAlexey Bataev #pragma omp parallel
122b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(a, b) // expected-error {{firstprivate variable with incomplete type 'S1'}}
123b8552abfSAlexey Bataev for (int k = 0; k < argc; ++k)
124b8552abfSAlexey Bataev ++k;
125b8552abfSAlexey Bataev #pragma omp parallel
126b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(z, argv[1]) // expected-error {{expected variable name}}
127b8552abfSAlexey Bataev for (int k = 0; k < argc; ++k)
128b8552abfSAlexey Bataev ++k;
129b8552abfSAlexey Bataev #pragma omp parallel
130b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}}
131b8552abfSAlexey Bataev for (int k = 0; k < argc; ++k)
132b8552abfSAlexey Bataev ++k;
133b8552abfSAlexey Bataev #pragma omp parallel
134b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(h) // expected-error {{threadprivate or thread local variable cannot be firstprivate}}
135b8552abfSAlexey Bataev for (int k = 0; k < argc; ++k)
136b8552abfSAlexey Bataev ++k;
137b8552abfSAlexey Bataev #pragma omp parallel
138b8552abfSAlexey Bataev {
139b8552abfSAlexey Bataev int v = 0;
140b8552abfSAlexey Bataev int i;
141b8552abfSAlexey Bataev #pragma omp master taskloop simd allocate(omp_thread_mem_alloc: i) firstprivate(i) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'master taskloop simd' directive}}
142b8552abfSAlexey Bataev for (int k = 0; k < argc; ++k) {
143b8552abfSAlexey Bataev i = k;
144b8552abfSAlexey Bataev v += i;
145b8552abfSAlexey Bataev }
146b8552abfSAlexey Bataev }
147b8552abfSAlexey Bataev #pragma omp parallel shared(i)
148b8552abfSAlexey Bataev #pragma omp parallel private(i)
149b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(j)
150b8552abfSAlexey Bataev for (int k = 0; k < argc; ++k)
151b8552abfSAlexey Bataev ++k;
152b8552abfSAlexey Bataev #pragma omp parallel
153b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(i)
154b8552abfSAlexey Bataev for (int k = 0; k < argc; ++k)
155b8552abfSAlexey Bataev ++k;
156b8552abfSAlexey Bataev #pragma omp parallel
157b8552abfSAlexey Bataev #pragma omp master taskloop simd lastprivate(g) firstprivate(g) // expected-error {{calling a private constructor of class 'S5'}}
158b8552abfSAlexey Bataev for (i = 0; i < argc; ++i)
159b8552abfSAlexey Bataev foo();
160b8552abfSAlexey Bataev #pragma omp parallel private(i)
161b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(i) // expected-note 2 {{defined as firstprivate}}
162b8552abfSAlexey Bataev for (i = 0; i < argc; ++i) // expected-error 2 {{loop iteration variable in the associated loop of 'omp master taskloop simd' directive may not be firstprivate, predetermined as linear}}
163b8552abfSAlexey Bataev foo();
164b8552abfSAlexey Bataev #pragma omp parallel reduction(+ : i) // expected-note {{defined as reduction}}
165b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(i) // expected-note {{defined as firstprivate}} expected-error {{argument of a reduction clause of a parallel construct must not appear in a firstprivate clause on a task construct}}
166b8552abfSAlexey Bataev for (i = 0; i < argc; ++i) // expected-error {{loop iteration variable in the associated loop of 'omp master taskloop simd' directive may not be firstprivate, predetermined as linear}}
167b8552abfSAlexey Bataev foo();
168b8552abfSAlexey Bataev return 0;
169b8552abfSAlexey Bataev }
170b8552abfSAlexey Bataev
bar(S4 a[2])171b8552abfSAlexey Bataev void bar(S4 a[2]) {
172b8552abfSAlexey Bataev #pragma omp parallel
173b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(a)
174b8552abfSAlexey Bataev for (int i = 0; i < 2; ++i)
175b8552abfSAlexey Bataev foo();
176b8552abfSAlexey Bataev }
177b8552abfSAlexey Bataev
178b8552abfSAlexey Bataev namespace A {
179b8552abfSAlexey Bataev double x;
180b8552abfSAlexey Bataev #pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
181b8552abfSAlexey Bataev }
182b8552abfSAlexey Bataev namespace B {
183b8552abfSAlexey Bataev using A::x;
184b8552abfSAlexey Bataev }
185b8552abfSAlexey Bataev
main(int argc,char ** argv)186b8552abfSAlexey Bataev int main(int argc, char **argv) {
187b8552abfSAlexey Bataev const int d = 5;
188b8552abfSAlexey Bataev const int da[5] = {0};
189b8552abfSAlexey Bataev S4 e(4);
190b8552abfSAlexey Bataev S5 g(5);
191b8552abfSAlexey Bataev S3 m;
192b8552abfSAlexey Bataev S6 n(2);
193b8552abfSAlexey Bataev int i, z;
194b8552abfSAlexey Bataev int &j = i;
195b8552abfSAlexey Bataev #pragma omp parallel
196b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate // expected-error {{expected '(' after 'firstprivate'}}
197b8552abfSAlexey Bataev for (i = 0; i < argc; ++i)
198b8552abfSAlexey Bataev foo();
199b8552abfSAlexey Bataev #pragma omp parallel
200b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
201b8552abfSAlexey Bataev for (i = 0; i < argc; ++i)
202b8552abfSAlexey Bataev foo();
203b8552abfSAlexey Bataev #pragma omp parallel
204b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate() // expected-error {{expected expression}}
205b8552abfSAlexey Bataev for (i = 0; i < argc; ++i)
206b8552abfSAlexey Bataev foo();
207b8552abfSAlexey Bataev #pragma omp parallel
208b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
209b8552abfSAlexey Bataev for (i = 0; i < argc; ++i)
210b8552abfSAlexey Bataev foo();
211b8552abfSAlexey Bataev #pragma omp parallel
212b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
213b8552abfSAlexey Bataev for (i = 0; i < argc; ++i)
214b8552abfSAlexey Bataev foo();
215b8552abfSAlexey Bataev #pragma omp parallel
216b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
217b8552abfSAlexey Bataev for (i = 0; i < argc; ++i)
218b8552abfSAlexey Bataev foo();
219b8552abfSAlexey Bataev #pragma omp parallel
220b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(argc, z)
221b8552abfSAlexey Bataev for (i = 0; i < argc; ++i)
222b8552abfSAlexey Bataev foo();
223b8552abfSAlexey Bataev #pragma omp parallel
224b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(S1) // expected-error {{'S1' does not refer to a value}}
225b8552abfSAlexey Bataev for (i = 0; i < argc; ++i)
226b8552abfSAlexey Bataev foo();
227b8552abfSAlexey Bataev #pragma omp parallel
228b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(a, b, c, d, f) // expected-error {{firstprivate variable with incomplete type 'S1'}} expected-error {{no matching constructor for initialization of 'S3'}}
229b8552abfSAlexey Bataev for (i = 0; i < argc; ++i)
230b8552abfSAlexey Bataev foo();
231b8552abfSAlexey Bataev #pragma omp parallel
232b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(argv[1]) // expected-error {{expected variable name}}
233b8552abfSAlexey Bataev for (i = 0; i < argc; ++i)
234b8552abfSAlexey Bataev foo();
235b8552abfSAlexey Bataev #pragma omp parallel
236b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(2 * 2) // expected-error {{expected variable name}}
237b8552abfSAlexey Bataev for (i = 0; i < argc; ++i)
238b8552abfSAlexey Bataev foo();
239b8552abfSAlexey Bataev #pragma omp parallel
240b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(ba) // OK
241b8552abfSAlexey Bataev for (i = 0; i < argc; ++i)
242b8552abfSAlexey Bataev foo();
243b8552abfSAlexey Bataev #pragma omp parallel
244b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(ca) // expected-error {{no matching constructor for initialization of 'S3'}}
245b8552abfSAlexey Bataev for (i = 0; i < argc; ++i)
246b8552abfSAlexey Bataev foo();
247b8552abfSAlexey Bataev #pragma omp parallel
248b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(da) // OK
249b8552abfSAlexey Bataev for (i = 0; i < argc; ++i)
250b8552abfSAlexey Bataev foo();
251b8552abfSAlexey Bataev int xa;
252b8552abfSAlexey Bataev #pragma omp parallel
253b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(xa) // OK
254b8552abfSAlexey Bataev for (i = 0; i < argc; ++i)
255b8552abfSAlexey Bataev foo();
256b8552abfSAlexey Bataev #pragma omp parallel
257b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(S2::S2s) // OK
258b8552abfSAlexey Bataev for (i = 0; i < argc; ++i)
259b8552abfSAlexey Bataev foo();
260b8552abfSAlexey Bataev #pragma omp parallel
261b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(S2::S2sc) // OK
262b8552abfSAlexey Bataev for (i = 0; i < argc; ++i)
263b8552abfSAlexey Bataev foo();
264b8552abfSAlexey Bataev #pragma omp parallel
265b8552abfSAlexey Bataev #pragma omp master taskloop simd safelen(5)
266b8552abfSAlexey Bataev for (i = 0; i < argc; ++i)
267b8552abfSAlexey Bataev foo();
268b8552abfSAlexey Bataev #pragma omp parallel
269b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}}
270b8552abfSAlexey Bataev for (i = 0; i < argc; ++i)
271b8552abfSAlexey Bataev foo();
272b8552abfSAlexey Bataev #pragma omp parallel
273b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(m) // OK
274b8552abfSAlexey Bataev for (i = 0; i < argc; ++i)
275b8552abfSAlexey Bataev foo();
276b8552abfSAlexey Bataev #pragma omp parallel
277b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(h) // expected-error {{threadprivate or thread local variable cannot be firstprivate}}
278b8552abfSAlexey Bataev for (i = 0; i < argc; ++i)
279b8552abfSAlexey Bataev foo();
280b8552abfSAlexey Bataev #pragma omp parallel
281b8552abfSAlexey Bataev #pragma omp master taskloop simd private(xa), firstprivate(xa) // expected-error {{private variable cannot be firstprivate}} expected-note {{defined as private}}
282b8552abfSAlexey Bataev for (i = 0; i < argc; ++i)
283b8552abfSAlexey Bataev foo();
284b8552abfSAlexey Bataev #pragma omp parallel
285b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(i) // expected-note {{defined as firstprivate}}
286b8552abfSAlexey Bataev for (i = 0; i < argc; ++i) // expected-error {{loop iteration variable in the associated loop of 'omp master taskloop simd' directive may not be firstprivate, predetermined as linear}}
287b8552abfSAlexey Bataev foo();
288b8552abfSAlexey Bataev #pragma omp parallel shared(xa)
289b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(xa) // OK: may be firstprivate
290b8552abfSAlexey Bataev for (i = 0; i < argc; ++i)
291b8552abfSAlexey Bataev foo();
292b8552abfSAlexey Bataev #pragma omp parallel
293b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(j)
294b8552abfSAlexey Bataev for (i = 0; i < argc; ++i)
295b8552abfSAlexey Bataev foo();
296b8552abfSAlexey Bataev #pragma omp parallel
297b8552abfSAlexey Bataev #pragma omp master taskloop simd lastprivate(g) firstprivate(g) // expected-error {{calling a private constructor of class 'S5'}}
298b8552abfSAlexey Bataev for (i = 0; i < argc; ++i)
299b8552abfSAlexey Bataev foo();
300b8552abfSAlexey Bataev #pragma omp parallel
301b8552abfSAlexey Bataev #pragma omp master taskloop simd lastprivate(n) firstprivate(n) // OK
302b8552abfSAlexey Bataev for (i = 0; i < argc; ++i)
303b8552abfSAlexey Bataev foo();
304b8552abfSAlexey Bataev #pragma omp parallel
305b8552abfSAlexey Bataev {
306b8552abfSAlexey Bataev int v = 0;
307b8552abfSAlexey Bataev int i;
308b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(i)
309b8552abfSAlexey Bataev for (int k = 0; k < argc; ++k) {
310b8552abfSAlexey Bataev i = k;
311b8552abfSAlexey Bataev v += i;
312b8552abfSAlexey Bataev }
313b8552abfSAlexey Bataev }
314b8552abfSAlexey Bataev #pragma omp parallel private(i)
315b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(i) // expected-note {{defined as firstprivate}}
316b8552abfSAlexey Bataev for (i = 0; i < argc; ++i) // expected-error {{loop iteration variable in the associated loop of 'omp master taskloop simd' directive may not be firstprivate, predetermined as linear}}
317b8552abfSAlexey Bataev foo();
318b8552abfSAlexey Bataev #pragma omp parallel reduction(+ : i) // expected-note {{defined as reduction}}
319b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(i) // expected-error {{argument of a reduction clause of a parallel construct must not appear in a firstprivate clause on a task construct}}
320b8552abfSAlexey Bataev for (i = 0; i < argc; ++i)
321b8552abfSAlexey Bataev foo();
322b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(i) //expected-note {{defined as firstprivate}}
323b8552abfSAlexey Bataev for (i = 0; i < argc; ++i) // expected-error {{loop iteration variable in the associated loop of 'omp master taskloop simd' directive may not be firstprivate, predetermined as linear}}
324b8552abfSAlexey Bataev foo();
325b8552abfSAlexey Bataev #pragma omp parallel
326b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(B::x) // expected-error {{threadprivate or thread local variable cannot be firstprivate}}
327b8552abfSAlexey Bataev for (i = 0; i < argc; ++i)
328b8552abfSAlexey Bataev foo();
329b8552abfSAlexey Bataev static int si;
330b8552abfSAlexey Bataev #pragma omp master taskloop simd firstprivate(si) // OK
331b8552abfSAlexey Bataev for (i = 0; i < argc; ++i)
332b8552abfSAlexey Bataev si = i + 1;
333b8552abfSAlexey Bataev
334b8552abfSAlexey Bataev return foomain<S4, S5>(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<S4, S5>' requested here}}
335b8552abfSAlexey Bataev }
336b8552abfSAlexey Bataev
337