1 // RUN: %clang_cc1 -verify -fopenmp -std=c++11 -o - %s -Wuninitialized
3 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -o - %s -Wuninitialized
6 int x
; // expected-note {{initialize the variable 'x' to silence this warning}}
7 #pragma omp target teams
8 argc
= x
; // expected-warning {{variable 'x' is uninitialized when used here}}
14 #pragma omp target teams // expected-error {{unexpected OpenMP directive '#pragma omp target teams'}}
16 int main(int argc
, char **argv
) {
17 #pragma omp target teams { // expected-warning {{extra tokens at the end of '#pragma omp target teams' are ignored}}
19 #pragma omp target teams ( // expected-warning {{extra tokens at the end of '#pragma omp target teams' are ignored}}
21 #pragma omp target teams [ // expected-warning {{extra tokens at the end of '#pragma omp target teams' are ignored}}
23 #pragma omp target teams ] // expected-warning {{extra tokens at the end of '#pragma omp target teams' are ignored}}
25 #pragma omp target teams ) // expected-warning {{extra tokens at the end of '#pragma omp target teams' are ignored}}
27 #pragma omp target teams } // expected-warning {{extra tokens at the end of '#pragma omp target teams' are ignored}}
29 #pragma omp target teams
31 #pragma omp target teams unknown() // expected-warning {{extra tokens at the end of '#pragma omp target teams' are ignored}}
35 #pragma omp target teams
37 #pragma omp target teams
39 goto L1
; // expected-error {{use of undeclared label 'L1'}}
43 for (int i
= 0; i
< 10; ++i
) {
46 #pragma omp target teams
49 break; // expected-error {{'break' statement not in loop or switch statement}}
50 continue; // expected-error {{'continue' statement not in loop statement}}
56 #pragma omp target teams default(none) // expected-note {{explicit data sharing attribute requested here}}
57 ++argc
; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
59 #pragma omp target teams default(none) // expected-note {{explicit data sharing attribute requested here}}
60 #pragma omp parallel num_threads(argc) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
63 #pragma omp target teams default(none) // expected-note {{explicit data sharing attribute requested here}}
65 #pragma omp parallel num_threads(argc) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
69 goto L2
; // expected-error {{use of undeclared label 'L2'}}
70 #pragma omp target teams
73 #pragma omp target teams
75 return 1; // expected-error {{cannot return from OpenMP region}}
78 [[]] // expected-error {{an attribute list cannot appear here}}
79 #pragma omp target teams
80 for (int n
= 0; n
< 100; ++n
) {}