xref: /minix3/external/bsd/llvm/dist/clang/test/OpenMP/task_default_messages.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -verify -fopenmp=libiomp5 -ferror-limit 100 -o - %s
2*0a6a1f1dSLionel Sambuc 
3*0a6a1f1dSLionel Sambuc void foo();
4*0a6a1f1dSLionel Sambuc 
main(int argc,char ** argv)5*0a6a1f1dSLionel Sambuc int main(int argc, char **argv) {
6*0a6a1f1dSLionel Sambuc #pragma omp task default                          // expected-error {{expected '(' after 'default'}}
7*0a6a1f1dSLionel Sambuc #pragma omp task default(                         // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
8*0a6a1f1dSLionel Sambuc #pragma omp task default()                        // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
9*0a6a1f1dSLionel Sambuc #pragma omp task default(none                     // expected-error {{expected ')'}} expected-note {{to match this '('}}
10*0a6a1f1dSLionel Sambuc #pragma omp task default(shared), default(shared) // expected-error {{directive '#pragma omp task' cannot contain more than one 'default' clause}}
11*0a6a1f1dSLionel Sambuc #pragma omp task default(x)                       // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
12*0a6a1f1dSLionel Sambuc   foo();
13*0a6a1f1dSLionel Sambuc 
14*0a6a1f1dSLionel Sambuc #pragma omp task default(none)
15*0a6a1f1dSLionel Sambuc   ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
16*0a6a1f1dSLionel Sambuc 
17*0a6a1f1dSLionel Sambuc #pragma omp task default(none)
18*0a6a1f1dSLionel Sambuc #pragma omp task default(shared)
19*0a6a1f1dSLionel Sambuc   ++argc;
20*0a6a1f1dSLionel Sambuc   return 0;
21*0a6a1f1dSLionel Sambuc }
22