1 // RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
3 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
6 int x
; // expected-note {{initialize the variable 'x' to silence this warning}}
7 #pragma omp target teams distribute parallel for simd
8 for (int i
= 0; i
< 10; ++i
)
9 argc
= x
; // expected-warning {{variable 'x' is uninitialized when used here}}
16 #pragma omp threadprivate(pvt)
18 #pragma omp target teams distribute parallel for simd // expected-error {{unexpected OpenMP directive '#pragma omp target teams distribute parallel for simd'}}
20 int main(int argc
, char **argv
) {
21 #pragma omp target teams distribute parallel for simd { // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for simd' are ignored}}
22 for (int i
= 0; i
< argc
; ++i
)
24 #pragma omp target teams distribute parallel for simd ( // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for simd' are ignored}}
25 for (int i
= 0; i
< argc
; ++i
)
27 #pragma omp target teams distribute parallel for simd[ // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for simd' are ignored}}
28 for (int i
= 0; i
< argc
; ++i
)
30 #pragma omp target teams distribute parallel for simd] // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for simd' are ignored}}
31 for (int i
= 0; i
< argc
; ++i
)
33 #pragma omp target teams distribute parallel for simd) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for simd' are ignored}}
34 for (int i
= 0; i
< argc
; ++i
)
36 #pragma omp target teams distribute parallel for simd } // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for simd' are ignored}}
37 for (int i
= 0; i
< argc
; ++i
)
39 #pragma omp target teams distribute parallel for simd
40 for (int i
= 0; i
< argc
; ++i
)
43 // expected-warning@+1 {{extra tokens at the end of '#pragma omp target teams distribute parallel for simd' are ignored}}
44 #pragma omp target teams distribute parallel for simd unknown()
45 for (int i
= 0; i
< argc
; ++i
)
48 for (int i
= 0; i
< argc
; ++i
)
50 #pragma omp target teams distribute parallel for simd
51 for (int i
= 0; i
< argc
; ++i
)
53 #pragma omp target teams distribute parallel for simd
54 for (int i
= 0; i
< argc
; ++i
) {
55 goto L1
; // expected-error {{use of undeclared label 'L1'}}
59 for (int i
= 0; i
< 10; ++i
) {
62 #pragma omp target teams distribute parallel for simd
63 for (int i
= 0; i
< argc
; ++i
) {
65 break; // expected-error {{'break' statement cannot be used in OpenMP for loop}}
72 #pragma omp target teams distribute parallel for simd default(none) // expected-note {{explicit data sharing attribute requested here}}
73 for (int i
= 0; i
< 10; ++i
)
74 ++argc
; // expected-error {{ariable 'argc' must have explicitly specified data sharing attributes}}
76 goto L2
; // expected-error {{use of undeclared label 'L2'}}
77 #pragma omp target teams distribute parallel for simd
78 for (int i
= 0; i
< argc
; ++i
)
81 #pragma omp target teams distribute parallel for simd
82 for (int i
= 0; i
< argc
; ++i
) {
83 return 1; // expected-error {{cannot return from OpenMP region}}
86 [[]] // expected-error {{an attribute list cannot appear here}}
87 #pragma omp target teams distribute parallel for simd
88 for (int n
= 0; n
< 100; ++n
) {
91 #pragma omp target teams distribute parallel for simd copyin(pvt) // expected-error {{unexpected OpenMP clause 'copyin' in directive '#pragma omp target teams distribute parallel for simd'}}
92 for (int n
= 0; n
< 100; ++n
) {}
98 #pragma omp target teams distribute parallel for simd ordered // expected-error {{unexpected OpenMP clause 'ordered' in directive '#pragma omp target teams distribute parallel for simd'}}
99 for (int i
= 0; i
< 16; ++i
)