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 parallel for simd
8 for (int i
= 0; i
< 10; ++i
)
9 argc
= x
; // expected-warning {{variable 'x' is uninitialized when used here}}
15 #pragma omp parallel for simd // expected-error {{unexpected OpenMP directive '#pragma omp parallel for simd'}}
17 int main(int argc
, char **argv
) {
18 #pragma omp parallel for simd { // expected-warning {{extra tokens at the end of '#pragma omp parallel for simd' are ignored}}
19 for (int i
= 0; i
< argc
; ++i
)
21 #pragma omp parallel for simd ( // expected-warning {{extra tokens at the end of '#pragma omp parallel for simd' are ignored}}
22 for (int i
= 0; i
< argc
; ++i
)
24 #pragma omp parallel for simd[ // expected-warning {{extra tokens at the end of '#pragma omp parallel for simd' are ignored}}
25 for (int i
= 0; i
< argc
; ++i
)
27 #pragma omp parallel for simd] // expected-warning {{extra tokens at the end of '#pragma omp parallel for simd' are ignored}}
28 for (int i
= 0; i
< argc
; ++i
)
30 #pragma omp parallel for simd) // expected-warning {{extra tokens at the end of '#pragma omp parallel for simd' are ignored}}
31 for (int i
= 0; i
< argc
; ++i
)
33 #pragma omp parallel for simd } // expected-warning {{extra tokens at the end of '#pragma omp parallel for simd' are ignored}}
34 for (int i
= 0; i
< argc
; ++i
)
36 #pragma omp parallel for simd
37 for (int i
= 0; i
< argc
; ++i
)
39 // expected-warning@+1 {{extra tokens at the end of '#pragma omp parallel for simd' are ignored}}
40 #pragma omp parallel for simd unknown()
41 for (int i
= 0; i
< argc
; ++i
)
44 for (int i
= 0; i
< argc
; ++i
)
46 #pragma omp parallel for simd
47 for (int i
= 0; i
< argc
; ++i
)
49 #pragma omp parallel for simd
50 for (int i
= 0; i
< argc
; ++i
) {
51 goto L1
; // expected-error {{use of undeclared label 'L1'}}
55 for (int i
= 0; i
< 10; ++i
) {
58 #pragma omp parallel for simd
59 for (int i
= 0; i
< argc
; ++i
) {
61 break; // expected-error {{'break' statement cannot be used in OpenMP for loop}}
68 #pragma omp parallel for simd default(none) // expected-note {{explicit data sharing attribute requested here}}
69 for (int i
= 0; i
< 10; ++i
)
70 ++argc
; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
72 goto L2
; // expected-error {{use of undeclared label 'L2'}}
73 #pragma omp parallel for simd
74 for (int i
= 0; i
< argc
; ++i
)
77 #pragma omp parallel for simd
78 for (int i
= 0; i
< argc
; ++i
) {
79 return 1; // expected-error {{cannot return from OpenMP region}}
82 [[]] // expected-error {{an attribute list cannot appear here}}
83 #pragma omp parallel for simd
84 for (int n
= 0; n
< 100; ++n
) {
91 #pragma omp parallel for simd ordered ordered // expected-error {{directive '#pragma omp parallel for simd' cannot contain more than one 'ordered' clause}}
92 for (int i
= 0; i
< 16; ++i
)
94 #pragma omp parallel for simd ordered
95 for (int i
= 0; i
< 16; ++i
)
97 // expected-error@+1 {{'ordered' clause with a parameter cannot be specified in '#pragma omp parallel for simd' directive}}
98 #pragma omp parallel for simd ordered(1)
99 for (int i
= 0; i
< 16; ++i
)