1 // RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s -Wuninitialized
2 // RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
3 // RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
4 
5 // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s -Wuninitialized
6 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
7 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
8 
9 extern int omp_default_mem_alloc;
10 
11 void xxx(int argc) {
12   int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
13 #pragma omp distribute parallel for reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
14   for (int i = 0; i < 10; ++i)
15     ;
16 }
17 
18 void foo() {
19 }
20 
21 bool foobool(int argc) {
22   return argc;
23 }
24 
25 void foobar(int &ref) {
26 #pragma omp target
27 #pragma omp teams
28 #pragma omp distribute parallel for reduction(+:ref)
29   for (int i = 0; i < 10; ++i)
30     foo();
31 }
32 
33 struct S1; // expected-note {{declared here}} expected-note 4 {{forward declaration of 'S1'}}
34 extern S1 a;
35 class S2 {
36   mutable int a;
37   S2 &operator+(const S2 &arg) { return (*this); } // expected-note 3 {{implicitly declared private here}}
38 
39 public:
40   S2() : a(0) {}
41   S2(S2 &s2) : a(s2.a) {}
42   static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
43   static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
44 };
45 const float S2::S2sc = 0;
46 S2 b;                     // expected-note 3 {{'b' defined here}}
47 const S2 ba[5];           // expected-note 2 {{'ba' defined here}}
48 class S3 {
49   int a;
50 
51 public:
52   int b;
53   S3() : a(0) {}
54   S3(const S3 &s3) : a(s3.a) {}
55   S3 operator+(const S3 &arg1) { return arg1; }
56 };
57 int operator+(const S3 &arg1, const S3 &arg2) { return 5; }
58 S3 c;               // expected-note 3 {{'c' defined here}}
59 const S3 ca[5];     // expected-note 2 {{'ca' defined here}}
60 extern const int f; // expected-note 4 {{'f' declared here}}
61 class S4 {
62   int a;
63   S4(); // expected-note {{implicitly declared private here}}
64   S4(const S4 &s4);
65   S4 &operator+(const S4 &arg) { return (*this); }
66 
67 public:
68   S4(int v) : a(v) {}
69 };
70 S4 &operator&=(S4 &arg1, S4 &arg2) { return arg1; }
71 class S5 {
72   int a;
73   S5() : a(0) {} // expected-note {{implicitly declared private here}}
74   S5(const S5 &s5) : a(s5.a) {}
75   S5 &operator+(const S5 &arg);
76 
77 public:
78   S5(int v) : a(v) {}
79 };
80 class S6 { // expected-note 3 {{candidate function (the implicit copy assignment operator) not viable: no known conversion from 'int' to 'const S6' for 1st argument}}
81 #if __cplusplus >= 201103L // C++11 or later
82 // expected-note@-2 3 {{candidate function (the implicit move assignment operator) not viable}}
83 #endif
84   int a;
85 
86 public:
87   S6() : a(6) {}
88   operator int() { return 6; }
89 } o;
90 
91 S3 h, k;
92 #pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}}
93 
94 template <class T>       // expected-note {{declared here}}
95 T tmain(T argc) {
96   const T d = T();       // expected-note 4 {{'d' defined here}}
97   const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
98   T qa[5] = {T()};
99   T i, z;
100   T &j = i;                        // expected-note 4 {{'j' defined here}}
101   S3 &p = k;                       // expected-note 2 {{'p' defined here}}
102   const T &r = da[(int)i];         // expected-note 2 {{'r' defined here}}
103   T &q = qa[(int)i];               // expected-note 2 {{'q' defined here}}
104   T fl;
105 #pragma omp target
106 #pragma omp teams
107 #pragma omp distribute parallel for reduction // expected-error {{expected '(' after 'reduction'}}
108   for (int i = 0; i < 10; ++i)
109     foo();
110 #pragma omp target
111 #pragma omp teams
112 #pragma omp distribute parallel for reduction + // expected-error {{expected '(' after 'reduction'}} expected-warning {{extra tokens at the end of '#pragma omp distribute parallel for' are ignored}}
113   for (int i = 0; i < 10; ++i)
114     foo();
115 #pragma omp target
116 #pragma omp teams
117 #pragma omp distribute parallel for reduction( // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}}
118   for (int i = 0; i < 10; ++i)
119     foo();
120 #pragma omp target
121 #pragma omp teams
122 #pragma omp distribute parallel for reduction(- // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
123   for (int i = 0; i < 10; ++i)
124     foo();
125 #pragma omp target
126 #pragma omp teams
127 #pragma omp distribute parallel for reduction() // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
128   for (int i = 0; i < 10; ++i)
129     foo();
130 #pragma omp target
131 #pragma omp teams
132 #pragma omp distribute parallel for reduction(*) // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}}
133   for (int i = 0; i < 10; ++i)
134     foo();
135 #pragma omp target
136 #pragma omp teams
137 #pragma omp distribute parallel for reduction(\) // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
138   for (int i = 0; i < 10; ++i)
139     foo();
140 #pragma omp target
141 #pragma omp teams
142 #pragma omp distribute parallel for reduction(& : argc // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{invalid operands to binary expression ('float' and 'float')}}
143   for (int i = 0; i < 10; ++i)
144     foo();
145 #pragma omp target
146 #pragma omp teams
147 #pragma omp distribute parallel for reduction(| : argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{invalid operands to binary expression ('float' and 'float')}}
148   for (int i = 0; i < 10; ++i)
149     foo();
150 #pragma omp target
151 #pragma omp teams
152 #pragma omp distribute parallel for reduction(|| : argc ? i : argc) // expected-error 2 {{expected variable name, array element or array section}}
153   for (int i = 0; i < 10; ++i)
154     foo();
155 #pragma omp target
156 #pragma omp teams
157 #pragma omp distribute parallel for reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}}
158   for (int i = 0; i < 10; ++i)
159     foo();
160 #pragma omp target
161 #pragma omp teams
162 #pragma omp distribute parallel for reduction(&& : 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 '('}}
163   for (int i = 0; i < 10; ++i)
164     foo();
165 #pragma omp target
166 #pragma omp teams
167 #pragma omp distribute parallel for reduction(^ : T) // expected-error {{'T' does not refer to a value}}
168   for (int i = 0; i < 10; ++i)
169     foo();
170 #pragma omp target
171 #pragma omp teams
172 #pragma omp distribute parallel for reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}} expected-warning 2 {{Type 'S2' is not trivially copyable and not guaranteed to be mapped correctly}} expected-warning 2 {{Type 'S3' is not trivially copyable and not guaranteed to be mapped correctly}}
173   for (int i = 0; i < 10; ++i)
174     foo();
175 #pragma omp target
176 #pragma omp teams
177 #pragma omp distribute parallel for reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified variable cannot be reduction}}
178   for (int i = 0; i < 10; ++i)
179     foo();
180 #pragma omp target
181 #pragma omp teams
182 #pragma omp distribute parallel for reduction(max : h.b) // expected-error {{expected variable name, array element or array section}}
183   for (int i = 0; i < 10; ++i)
184     foo();
185 #pragma omp target
186 #pragma omp teams
187 #pragma omp distribute parallel for reduction(+ : ba, z) // expected-error {{const-qualified variable cannot be reduction}}
188   for (int i = 0; i < 10; ++i)
189     foo();
190 #pragma omp target
191 #pragma omp teams
192 #pragma omp distribute parallel for reduction(* : ca) // expected-error {{const-qualified variable cannot be reduction}}
193   for (int i = 0; i < 10; ++i)
194     foo();
195 #pragma omp target
196 #pragma omp teams
197 #pragma omp distribute parallel for reduction(- : da) // expected-error {{const-qualified variable cannot be reduction}} expected-error {{const-qualified variable cannot be reduction}}
198   for (int i = 0; i < 10; ++i)
199     foo();
200 #pragma omp target
201 #pragma omp teams
202 #pragma omp distribute parallel for reduction(^ : fl) // expected-error {{invalid operands to binary expression ('float' and 'float')}}
203   for (int i = 0; i < 10; ++i)
204     foo();
205 #pragma omp target
206 #pragma omp teams
207 #pragma omp distribute parallel for reduction(&& : S2::S2s) // expected-error {{shared variable cannot be reduction}}
208   for (int i = 0; i < 10; ++i)
209     foo();
210 #pragma omp target
211 #pragma omp teams
212 #pragma omp distribute parallel for reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}}
213   for (int i = 0; i < 10; ++i)
214     foo();
215 #pragma omp target
216 #pragma omp teams
217 #pragma omp distribute parallel for reduction(+ : h, k) // expected-error {{threadprivate or thread local variable cannot be reduction}} expected-warning 2 {{Type 'S3' is not trivially copyable and not guaranteed to be mapped correctly}}
218   for (int i = 0; i < 10; ++i)
219     foo();
220 #pragma omp target
221 #pragma omp teams
222 #pragma omp distribute parallel for reduction(+ : o) // expected-error 2 {{no viable overloaded '='}}
223   for (int i = 0; i < 10; ++i)
224     foo();
225 #pragma omp target
226 #pragma omp teams
227 #pragma omp distribute parallel for private(i), reduction(+ : j), reduction(+ : q) // expected-error 4 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
228   for (int i = 0; i < 10; ++i)
229     foo();
230 #pragma omp parallel private(k)
231 #pragma omp target
232 #pragma omp teams
233 #pragma omp distribute parallel for reduction(+ : p), reduction(+ : p) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
234   for (int i = 0; i < 10; ++i)
235     foo();
236 #pragma omp target
237 #pragma omp teams
238 #pragma omp distribute parallel for reduction(+ : p), reduction(+ : p) // expected-error 2 {{variable can appear only once in OpenMP 'reduction' clause}} expected-note 2 {{previously referenced here}}
239   for (int i = 0; i < 10; ++i)
240     foo();
241 #pragma omp target
242 #pragma omp teams
243 #pragma omp distribute parallel for reduction(+ : r) // expected-error 2 {{const-qualified variable cannot be reduction}}
244   for (int i = 0; i < 10; ++i)
245     foo();
246 #pragma omp parallel shared(i)
247 #pragma omp parallel reduction(min : i)
248 #pragma omp target
249 #pragma omp teams
250 #pragma omp distribute parallel for reduction(max : j) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
251   for (int i = 0; i < 10; ++i)
252     foo();
253 #pragma omp parallel private(fl)
254 #pragma omp target
255 #pragma omp teams
256 #pragma omp distribute parallel for reduction(+ : fl)
257   for (int i = 0; i < 10; ++i)
258     foo();
259 #pragma omp parallel reduction(* : fl)
260 #pragma omp target
261 #pragma omp teams
262 #pragma omp distribute parallel for reduction(+ : fl)
263   for (int i = 0; i < 10; ++i)
264     foo();
265 
266   return T();
267 }
268 
269 namespace A {
270 double x;
271 #pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
272 }
273 namespace B {
274 using A::x;
275 }
276 
277 int main(int argc, char **argv) {
278   const int d = 5;       // expected-note 2 {{'d' defined here}}
279   const int da[5] = {0}; // expected-note {{'da' defined here}}
280   int qa[5] = {0};
281   S4 e(4);
282   S5 g(5);
283   int i, z;
284   int &j = i;                      // expected-note 2 {{'j' defined here}}
285   S3 &p = k;                       // expected-note 2 {{'p' defined here}}
286   const int &r = da[i];            // expected-note {{'r' defined here}}
287   int &q = qa[i];                  // expected-note {{'q' defined here}}
288   float fl;
289 #pragma omp target
290 #pragma omp teams
291 #pragma omp distribute parallel for reduction // expected-error {{expected '(' after 'reduction'}}
292   for (int i = 0; i < 10; ++i)
293     foo();
294 #pragma omp target
295 #pragma omp teams
296 #pragma omp distribute parallel for reduction + // expected-error {{expected '(' after 'reduction'}} expected-warning {{extra tokens at the end of '#pragma omp distribute parallel for' are ignored}}
297   for (int i = 0; i < 10; ++i)
298     foo();
299 #pragma omp target
300 #pragma omp teams
301 #pragma omp distribute parallel for reduction( // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}}
302   for (int i = 0; i < 10; ++i)
303     foo();
304 #pragma omp target
305 #pragma omp teams
306 #pragma omp distribute parallel for reduction(- // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
307   for (int i = 0; i < 10; ++i)
308     foo();
309 #pragma omp target
310 #pragma omp teams
311 #pragma omp distribute parallel for reduction() // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
312   for (int i = 0; i < 10; ++i)
313     foo();
314 #pragma omp target
315 #pragma omp teams
316 #pragma omp distribute parallel for reduction(*) // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}}
317   for (int i = 0; i < 10; ++i)
318     foo();
319 #pragma omp target
320 #pragma omp teams
321 #pragma omp distribute parallel for reduction(\) // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
322   for (int i = 0; i < 10; ++i)
323     foo();
324 #pragma omp target
325 #pragma omp teams
326 #pragma omp distribute parallel for reduction(foo : argc // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max'}}
327   for (int i = 0; i < 10; ++i)
328     foo();
329 #pragma omp target
330 #pragma omp teams
331 #pragma omp distribute parallel for reduction(| : argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
332   for (int i = 0; i < 10; ++i)
333     foo();
334 #pragma omp target
335 #pragma omp teams
336 #pragma omp distribute parallel for reduction(|| : argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name, array element or array section}}
337   for (int i = 0; i < 10; ++i)
338     foo();
339 #pragma omp target
340 #pragma omp teams
341 #pragma omp distribute parallel for reduction(~ : argc) // expected-error {{expected unqualified-id}}
342   for (int i = 0; i < 10; ++i)
343     foo();
344 #pragma omp target
345 #pragma omp teams
346 #pragma omp distribute parallel for reduction(&& : argc)
347   for (int i = 0; i < 10; ++i)
348     foo();
349 #pragma omp target
350 #pragma omp teams
351 #pragma omp distribute parallel for reduction(^ : S1) // expected-error {{'S1' does not refer to a value}}
352   for (int i = 0; i < 10; ++i)
353     foo();
354 #pragma omp target
355 #pragma omp teams
356 #pragma omp distribute parallel for reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{const-qualified variable cannot be reduction}} expected-error {{'operator+' is a private member of 'S2'}} expected-error {{incomplete type 'S1' where a complete type is required}} expected-warning {{Type 'S2' is not trivially copyable and not guaranteed to be mapped correctly}} expected-warning {{Type 'S3' is not trivially copyable and not guaranteed to be mapped correctly}}
357   for (int i = 0; i < 10; ++i)
358     foo();
359 #pragma omp target
360 #pragma omp teams
361 #pragma omp distribute parallel for reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 2 {{const-qualified variable cannot be reduction}} expected-error {{incomplete type 'S1' where a complete type is required}} expected-warning {{Type 'S2' is not trivially copyable and not guaranteed to be mapped correctly}} expected-warning {{Type 'S3' is not trivially copyable and not guaranteed to be mapped correctly}}
362   for (int i = 0; i < 10; ++i)
363     foo();
364 #pragma omp target
365 #pragma omp teams
366 #pragma omp distribute parallel for reduction(max : h.b) // expected-error {{expected variable name, array element or array section}}
367   for (int i = 0; i < 10; ++i)
368     foo();
369 #pragma omp target
370 #pragma omp teams
371 #pragma omp distribute parallel for reduction(+ : ba) // expected-error {{const-qualified variable cannot be reduction}} expected-warning {{Type 'const S2 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
372   for (int i = 0; i < 10; ++i)
373     foo();
374 #pragma omp target
375 #pragma omp teams
376 #pragma omp distribute parallel for reduction(* : ca) // expected-error {{const-qualified variable cannot be reduction}} expected-warning {{Type 'const S3 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
377   for (int i = 0; i < 10; ++i)
378     foo();
379 #pragma omp target
380 #pragma omp teams
381 #pragma omp distribute parallel for reduction(- : da) // expected-error {{const-qualified variable cannot be reduction}}
382   for (int i = 0; i < 10; ++i)
383     foo();
384 #pragma omp target
385 #pragma omp teams
386 #pragma omp distribute parallel for reduction(^ : fl) // expected-error {{invalid operands to binary expression ('float' and 'float')}}
387   for (int i = 0; i < 10; ++i)
388     foo();
389 #pragma omp target
390 #pragma omp teams
391 #pragma omp distribute parallel for reduction(&& : S2::S2s) // expected-error {{shared variable cannot be reduction}}
392   for (int i = 0; i < 10; ++i)
393     foo();
394 #pragma omp target
395 #pragma omp teams
396 #pragma omp distribute parallel for reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}}
397   for (int i = 0; i < 10; ++i)
398     foo();
399 #pragma omp target
400 #pragma omp teams
401 #pragma omp distribute parallel for reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} expected-warning {{Type 'S4' is not trivially copyable and not guaranteed to be mapped correctly}} expected-warning {{Type 'S5' is not trivially copyable and not guaranteed to be mapped correctly}}
402   for (int i = 0; i < 10; ++i)
403     foo();
404 #pragma omp target
405 #pragma omp teams
406 #pragma omp distribute parallel for reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}} expected-warning {{Type 'S3' is not trivially copyable and not guaranteed to be mapped correctly}}
407   for (int i = 0; i < 10; ++i)
408     foo();
409 #pragma omp target
410 #pragma omp teams
411 #pragma omp distribute parallel for reduction(+ : o) // expected-error {{no viable overloaded '='}}
412   for (int i = 0; i < 10; ++i)
413     foo();
414 #pragma omp target
415 #pragma omp teams
416 #pragma omp distribute parallel for private(i), reduction(+ : j), reduction(+ : q) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
417   for (int i = 0; i < 10; ++i)
418     foo();
419 #pragma omp parallel private(k)
420 #pragma omp target
421 #pragma omp teams
422 #pragma omp distribute parallel for reduction(+ : p), reduction(+ : p) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}} expected-warning {{Type 'S3' is not trivially copyable and not guaranteed to be mapped correctly}}
423   for (int i = 0; i < 10; ++i)
424     foo();
425 #pragma omp target
426 #pragma omp teams
427 #pragma omp distribute parallel for reduction(+ : p), reduction(+ : p) // expected-error {{variable can appear only once in OpenMP 'reduction' clause}} expected-note {{previously referenced here}} expected-warning {{Type 'S3' is not trivially copyable and not guaranteed to be mapped correctly}}
428   for (int i = 0; i < 10; ++i)
429     foo();
430 #pragma omp target
431 #pragma omp teams
432 #pragma omp distribute parallel for reduction(+ : r) // expected-error {{const-qualified variable cannot be reduction}}
433   for (int i = 0; i < 10; ++i)
434     foo();
435 #pragma omp parallel shared(i)
436 #pragma omp parallel reduction(min : i)
437 #pragma omp target
438 #pragma omp teams
439 #pragma omp distribute parallel for reduction(max : j) // expected-error {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
440   for (int i = 0; i < 10; ++i)
441     foo();
442 #pragma omp parallel private(fl)
443 #pragma omp target
444 #pragma omp teams
445 #pragma omp distribute parallel for reduction(+ : fl, z)
446   for (int i = 0; i < 10; ++i)
447     foo();
448 #pragma omp parallel reduction(* : fl)
449 #pragma omp target
450 #pragma omp teams
451 #pragma omp distribute parallel for reduction(+ : fl)
452   for (int i = 0; i < 10; ++i)
453     foo();
454   static int m;
455 #pragma omp target
456 #pragma omp teams
457 #pragma omp distribute parallel for reduction(+ : m) // OK
458   for (int i = 0; i < 10; ++i)
459     m++;
460 
461   return tmain(argc) + tmain(fl); // expected-note {{in instantiation of function template specialization 'tmain<int>' requested here}} expected-note {{in instantiation of function template specialization 'tmain<float>' requested here}}
462 }
463