Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / OpenMP / parallel_sections_default_messages.cpp
blobaaed940775562c5d4ccee66a7264f3812de1f617
1 // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -ferror-limit 100 -o - %s \
2 // RUN: -Wuninitialized
4 // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -ferror-limit 100 -o - %s \
5 // RUN: -Wuninitialized
7 // RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s \
8 // RUN: -DOMP51 -Wuninitialized
10 // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s \
11 // RUN: -DOMP51 -Wuninitialized
13 void foo();
15 int main(int argc, char **argv) {
16 #pragma omp parallel sections default // expected-error {{expected '(' after 'default'}}
18 #pragma omp parallel sections default( // expected-error {{expected 'none', 'shared', 'private' or 'firstprivate' in OpenMP clause 'default'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
20 #pragma omp parallel sections default() // expected-error {{expected 'none', 'shared', 'private' or 'firstprivate' in OpenMP clause 'default'}}
22 #pragma omp parallel sections default(none // expected-error {{expected ')'}} expected-note {{to match this '('}}
24 #pragma omp parallel sections default(shared), default(shared) // expected-error {{directive '#pragma omp parallel sections' cannot contain more than one 'default' clause}}
26 #pragma omp parallel sections default(x) // expected-error {{expected 'none', 'shared', 'private' or 'firstprivate' in OpenMP clause 'default'}}
27 {foo();
35 #pragma omp parallel sections default(none) // expected-note {{explicit data sharing attribute requested here}}
37 ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
40 #pragma omp parallel sections default(none) // expected-note {{explicit data sharing attribute requested here}}
42 #pragma omp parallel sections default(shared)
44 ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
48 #ifdef OMP51
49 #pragma omp parallel sections default(none) // expected-note {{explicit data sharing attribute requested here}}
51 #pragma omp parallel sections default(private)
53 ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
56 #endif // OMP51
57 return 0;