xref: /minix3/external/bsd/llvm/dist/clang/test/OpenMP/teams_default_messages.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -verify -fopenmp=libiomp5 -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 target
7*0a6a1f1dSLionel Sambuc   #pragma omp teams default // expected-error {{expected '(' after 'default'}}
8*0a6a1f1dSLionel Sambuc   foo();
9*0a6a1f1dSLionel Sambuc   #pragma omp target
10*0a6a1f1dSLionel Sambuc   #pragma omp teams default ( // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
11*0a6a1f1dSLionel Sambuc   foo();
12*0a6a1f1dSLionel Sambuc   #pragma omp target
13*0a6a1f1dSLionel Sambuc   #pragma omp teams default () // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
14*0a6a1f1dSLionel Sambuc   foo();
15*0a6a1f1dSLionel Sambuc   #pragma omp target
16*0a6a1f1dSLionel Sambuc   #pragma omp teams default (none // expected-error {{expected ')'}} expected-note {{to match this '('}}
17*0a6a1f1dSLionel Sambuc   foo();
18*0a6a1f1dSLionel Sambuc   #pragma omp target
19*0a6a1f1dSLionel Sambuc   #pragma omp teams default (shared), default(shared) // expected-error {{directive '#pragma omp teams' cannot contain more than one 'default' clause}}
20*0a6a1f1dSLionel Sambuc   foo();
21*0a6a1f1dSLionel Sambuc   #pragma omp target
22*0a6a1f1dSLionel Sambuc   #pragma omp teams default (x) // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
23*0a6a1f1dSLionel Sambuc   foo();
24*0a6a1f1dSLionel Sambuc 
25*0a6a1f1dSLionel Sambuc   #pragma omp target
26*0a6a1f1dSLionel Sambuc   #pragma omp teams default(none)
27*0a6a1f1dSLionel Sambuc   ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
28*0a6a1f1dSLionel Sambuc 
29*0a6a1f1dSLionel Sambuc   #pragma omp target
30*0a6a1f1dSLionel Sambuc   #pragma omp teams default(none)
31*0a6a1f1dSLionel Sambuc   #pragma omp parallel default(shared)
32*0a6a1f1dSLionel Sambuc   ++argc;
33*0a6a1f1dSLionel Sambuc   return 0;
34*0a6a1f1dSLionel Sambuc }
35