1 // RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized
3 // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized
6 int x
; // expected-note {{initialize the variable 'x' to silence this warning}}
7 #pragma omp parallel sections
9 argc
= x
; // expected-warning {{variable 'x' is uninitialized when used here}}
16 #pragma omp parallel sections // expected-error {{unexpected OpenMP directive '#pragma omp parallel sections'}}
18 int main(int argc
, char **argv
) {
19 #pragma omp parallel sections {// expected-warning {{extra tokens at the end of '#pragma omp parallel sections' are ignored}}
23 #pragma omp parallel sections( // expected-warning {{extra tokens at the end of '#pragma omp parallel sections' are ignored}}
27 #pragma omp parallel sections[ // expected-warning {{extra tokens at the end of '#pragma omp parallel sections' are ignored}}
31 #pragma omp parallel sections] // expected-warning {{extra tokens at the end of '#pragma omp parallel sections' are ignored}}
35 #pragma omp parallel sections) // expected-warning {{extra tokens at the end of '#pragma omp parallel sections' are ignored}}
39 #pragma omp parallel sections } // expected-warning {{extra tokens at the end of '#pragma omp parallel sections' are ignored}}
43 // expected-warning@+1 {{extra tokens at the end of '#pragma omp parallel sections' are ignored}}
44 #pragma omp parallel sections unknown()
51 #pragma omp parallel sections
55 #pragma omp parallel sections
57 goto L1
; // expected-error {{use of undeclared label 'L1'}}
60 for (int i
= 0; i
< 10; ++i
) {
63 #pragma omp parallel sections
66 break; // expected-error {{'break' statement not in loop or switch statement}}
67 continue; // expected-error {{'continue' statement not in loop statement}}
73 #pragma omp parallel sections default(none) // expected-note {{explicit data sharing attribute requested here}}
75 ++argc
; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
78 goto L2
; // expected-error {{use of undeclared label 'L2'}}
79 #pragma omp parallel sections
84 #pragma omp parallel sections
86 return 1; // expected-error {{cannot return from OpenMP region}}
89 [[]] // expected-error {{an attribute list cannot appear here}}
90 #pragma omp parallel sections