1 // RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
2 // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
5 int x
; // expected-note {{initialize the variable 'x' to silence this warning}}
6 [[omp::directive(masked
)]]
7 argc
= x
; // expected-warning {{variable 'x' is uninitialized when used here}}
11 int x
; // expected-note {{initialize the variable 'x' to silence this warning}}
12 [[omp::directive(masked
filter(1))]]
13 argc
= x
; // expected-warning {{variable 'x' is uninitialized when used here}}
19 [[omp::directive(masked
)]]
21 [[omp::directive(masked
filter(1) filter(2))]] // expected-error {{directive '#pragma omp masked' cannot contain more than one 'filter' clause}}
24 [[omp::directive(masked
filter(x
) filter(y
) filter(z
))]] // expected-error 2 {{directive '#pragma omp masked' cannot contain more than one 'filter' clause}}
26 [[omp::directive(masked nowait
)]] // expected-error {{unexpected OpenMP clause 'nowait' in directive '#pragma omp masked'}}
27 [[omp::directive(masked unknown
)]] // expected-warning {{extra tokens at the end of '#pragma omp masked' are ignored}}
30 [[omp::directive(masked
)]]
31 } // expected-error {{expected statement}}
33 [[omp::directive(masked
filter(2))]]
34 } // expected-error {{expected statement}}
35 [[omp::directive(for)]]
36 for (int i
= 0; i
< 10; ++i
) {
38 [[omp::directive(masked
filter(1))]] // expected-error {{region cannot be closely nested inside 'for' region}}
41 [[omp::directive(sections
)]]
44 [[omp::directive(masked
)]] // expected-error {{region cannot be closely nested inside 'sections' region}}
47 [[omp::directive(single
)]]
48 for (int i
= 0; i
< 10; ++i
) {
50 [[omp::directive(masked
allocate(i
))]] // expected-error {{region cannot be closely nested inside 'single' region}} expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp masked'}}
53 [[omp::directive(masked
)]]
54 for (int i
= 0; i
< 10; ++i
) {
56 [[omp::directive(masked
)]]
59 [[omp::directive(for ordered
)]]
60 for (int i
= 0; i
< 10; ++i
)
61 [[omp::directive(masked
)]] // expected-error {{region cannot be closely nested inside 'for' region}}
70 L1
: // expected-note {{jump exits scope of OpenMP structured block}}
72 [[omp::directive(masked
filter(0))]]
75 goto L1
; // expected-error {{cannot jump from this goto statement to its label}}
77 goto L2
; // expected-error {{cannot jump from this goto statement to its label}}
78 [[omp::directive(masked
filter(-2))]]
79 { // expected-note {{jump bypasses OpenMP structured block}}