1 // RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized -fopenmp-version=51 2 3 // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized -fopenmp-version=51 4 5 void foo(); 6 7 namespace { 8 static int y = 0; 9 } 10 static int x = 0; 11 12 int main(int argc, char **argv) { 13 #pragma omp target 14 #pragma omp teams distribute simd default // expected-error {{expected '(' after 'default'}} 15 for (int i=0; i<200; i++) foo(); 16 #pragma omp target 17 #pragma omp teams distribute simd default( // expected-error {{expected 'none', 'shared', 'private' or 'firstprivate' in OpenMP clause 'default'}} expected-error {{expected ')'}} expected-note {{to match this '('}} 18 for (int i=0; i<200; i++) foo(); 19 #pragma omp target 20 #pragma omp teams distribute simd default() // expected-error {{expected 'none', 'shared', 'private' or 'firstprivate' in OpenMP clause 'default'}} 21 for (int i=0; i<200; i++) foo(); 22 #pragma omp target 23 #pragma omp teams distribute simd default (none // expected-error {{expected ')'}} expected-note {{to match this '('}} 24 for (int i=0; i<200; i++) foo(); 25 #pragma omp target 26 #pragma omp teams distribute simd default (shared), default(shared) // expected-error {{directive '#pragma omp teams distribute simd' cannot contain more than one 'default' clause}} 27 for (int i=0; i<200; i++) foo(); 28 #pragma omp target 29 #pragma omp teams distribute simd default(x) // expected-error {{expected 'none', 'shared', 'private' or 'firstprivate' in OpenMP clause 'default'}} 30 for (int i=0; i<200; i++) foo(); 31 32 #pragma omp target 33 #pragma omp teams distribute simd default(none) // expected-note {{explicit data sharing attribute requested here}} 34 for (int i=0; i<200; i++) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} 35 36 #pragma omp target 37 #pragma omp teams distribute simd default(firstprivate) // expected-note {{explicit data sharing attribute requested here}} 38 for (int i = 0; i < 200; i++) 39 ++x; // expected-error {{variable 'x' must have explicitly specified data sharing attributes}} 40 41 #pragma omp target 42 #pragma omp teams distribute simd default(firstprivate) // expected-note {{explicit data sharing attribute requested here}} 43 for (int i = 0; i < 200; i++) 44 ++y; // expected-error {{variable 'y' must have explicitly specified data sharing attributes}} 45 46 #pragma omp target 47 #pragma omp teams distribute simd default(private) // expected-note {{explicit data sharing attribute requested here}} 48 for (int i = 0; i < 200; i++) 49 ++x; // expected-error {{variable 'x' must have explicitly specified data sharing attributes}} 50 51 #pragma omp target 52 #pragma omp teams distribute simd default(private) // expected-note {{explicit data sharing attribute requested here}} 53 for (int i = 0; i < 200; i++) 54 ++y; // expected-error {{variable 'y' must have explicitly specified data sharing attributes}} 55 56 return 0; 57 } 58