1// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -ferror-limit 100 -o - %s
2
3void foo();
4
5int main(int argc, char **argv) {
6  int i;
7#pragma omp parallel for default // expected-error {{expected '(' after 'default'}}
8  for (i = 0; i < argc; ++i)
9    foo();
10#pragma omp parallel for default( // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
11  for (i = 0; i < argc; ++i)
12    foo();
13#pragma omp parallel for default() // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
14  for (i = 0; i < argc; ++i)
15    foo();
16#pragma omp parallel for default(none // expected-error {{expected ')'}} expected-note {{to match this '('}}
17  for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
18    foo();
19#pragma omp parallel for default(shared), default(shared) // expected-error {{directive '#pragma omp parallel for' cannot contain more than one 'default' clause}}
20  for (i = 0; i < argc; ++i)
21    foo();
22#pragma omp parallel for default(x) // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
23  for (i = 0; i < argc; ++i)
24    foo();
25
26#pragma omp parallel for default(none)
27  for (i = 0; i < argc; ++i)  // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
28    foo();
29
30#pragma omp parallel default(none)
31#pragma omp parallel for default(shared)
32  for (i = 0; i < argc; ++i)
33    foo();
34
35  return 0;
36}
37