1 // RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
2 
3 // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
4 
5 void xxx(int argc) {
6   int x; // expected-note {{initialize the variable 'x' to silence this warning}}
7 #pragma omp target update to(x)
8   argc = x; // expected-warning {{variable 'x' is uninitialized when used here}}
9 }
10 
11 void foo() {
12 }
13 
14 bool foobool(int argc) {
15   return argc;
16 }
17 
18 struct S1; // Aexpected-note {{declared here}}
19 
20 template <class T, class S> // Aexpected-note {{declared here}}
21 int tmain(T argc, S **argv) {
22   int n;
23   return 0;
24 }
25 
26 int main(int argc, char **argv) {
27   int m;
28   #pragma omp target update // expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
29   #pragma omp target update to(m) { // expected-warning {{extra tokens at the end of '#pragma omp target update' are ignored}}
30   #pragma omp target update to(m) ( // expected-warning {{extra tokens at the end of '#pragma omp target update' are ignored}}
31   #pragma omp target update to(m) [ // expected-warning {{extra tokens at the end of '#pragma omp target update' are ignored}}
32   #pragma omp target update to(m) ] // expected-warning {{extra tokens at the end of '#pragma omp target update' are ignored}}
33   #pragma omp target update to(m) ) // expected-warning {{extra tokens at the end of '#pragma omp target update' are ignored}}
34 
35   #pragma omp target update from(m) allocate(m) // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp target update'}}
36   {
37     foo();
38   }
39   return tmain(argc, argv);
40 }
41