blob: 5e8702a99d97559416519480b8763f749ce3b6fc [file] [log] [blame]
Kelvin Li02532872016-08-05 14:37:37 +00001// RUN: %clang_cc1 -verify -fopenmp %s
2
Alexey Bataeva8a9153a2017-12-29 18:07:07 +00003// RUN: %clang_cc1 -verify -fopenmp-simd %s
4
Kelvin Li02532872016-08-05 14:37:37 +00005void foo();
6
7int main(int argc, char **argv) {
8 #pragma omp target
9 #pragma omp teams distribute default // expected-error {{expected '(' after 'default'}}
10 for (int i=0; i<200; i++) foo();
11 #pragma omp target
12 #pragma omp teams distribute default ( // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
13 for (int i=0; i<200; i++) foo();
14 #pragma omp target
15 #pragma omp teams distribute default () // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
16 for (int i=0; i<200; i++) foo();
17 #pragma omp target
18 #pragma omp teams distribute default (none // expected-error {{expected ')'}} expected-note {{to match this '('}}
19 for (int i=0; i<200; i++) foo();
20 #pragma omp target
21 #pragma omp teams distribute default (shared), default(shared) // expected-error {{directive '#pragma omp teams distribute' cannot contain more than one 'default' clause}}
22 for (int i=0; i<200; i++) foo();
23 #pragma omp target
24 #pragma omp teams distribute default (x) // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
25 for (int i=0; i<200; i++) foo();
26
27 #pragma omp target
28 #pragma omp teams distribute default(none)
29 for (int i=0; i<200; i++) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
30
31 return 0;
32}