58 lines · cpp
1// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized2 3// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized4 5void foo();6 7namespace {8static int y = 0;9}10static int x = 0;11 12int main(int argc, char **argv) {13 #pragma omp target14 #pragma omp teams distribute simd default // expected-error {{expected '(' after 'default'}}15 for (int i=0; i<200; i++) foo();16 #pragma omp target17#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 target20#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 target23 #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 target26 #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 target29#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 target33 #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 target37#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 target42#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 target47#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 target52#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