1 // RUN: %clang_cc1 -verify -fopenmp-version=51 -fopenmp -DOMP51 -o - %s -Wuninitialized
3 // RUN: %clang_cc1 -verify -fopenmp-version=51 -fopenmp-simd -DOMP51 -o - %s -Wuninitialized
5 // RUN: %clang_cc1 -verify -fopenmp-version=50 -fopenmp -o - %s -Wuninitialized
7 // RUN: %clang_cc1 -verify -fopenmp-version=50 -fopenmp-simd -o - %s -Wuninitialized
16 int main(int argc
, char **argv
) {
18 #pragma omp teams default // expected-error {{expected '(' after 'default'}}
21 #pragma omp teams default( // expected-error {{expected 'none', 'shared', 'private' or 'firstprivate' in OpenMP clause 'default'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
24 #pragma omp teams default() // expected-error {{expected 'none', 'shared', 'private' or 'firstprivate' in OpenMP clause 'default'}}
27 #pragma omp teams default (none // expected-error {{expected ')'}} expected-note {{to match this '('}}
30 #pragma omp teams default (shared), default(shared) // expected-error {{directive '#pragma omp teams' cannot contain more than one 'default' clause}}
33 #pragma omp teams default(x) // expected-error {{expected 'none', 'shared', 'private' or 'firstprivate' in OpenMP clause 'default'}}
37 #pragma omp teams default(none) // expected-note {{explicit data sharing attribute requested here}}
38 ++argc
; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
41 #pragma omp teams default(none) // expected-note {{explicit data sharing attribute requested here}}
42 #pragma omp parallel default(shared)
43 ++argc
; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
45 #pragma omp teams if(x) // expected-error {{unexpected OpenMP clause 'if' in directive '#pragma omp teams'}}
50 #pragma omp teams default(firstprivate) // expected-note 2 {{explicit data sharing attribute requested here}}
52 ++x
; // expected-error {{variable 'x' must have explicitly specified data sharing attributes}}
53 ++y
; // expected-error {{variable 'y' must have explicitly specified data sharing attributes}}
56 #pragma omp teams default(private) // expected-note 2 {{explicit data sharing attribute requested here}}
58 ++x
; // expected-error {{variable 'x' must have explicitly specified data sharing attributes}}
59 ++y
; // expected-error {{variable 'y' must have explicitly specified data sharing attributes}}
61 #pragma omp teams if(x) // expected-error {{unexpected OpenMP clause 'if' in directive '#pragma omp teams'}}