1 // RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
5 template <class T, int N>
10 #pragma omp distribute parallel for default // expected-error {{expected '(' after 'default'}}
11 for (i = 0; i < argc; ++i)
15 #pragma omp distribute parallel for default( // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
16 for (i = 0; i < argc; ++i)
20 #pragma omp distribute parallel for default() // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
21 for (i = 0; i < argc; ++i)
25 #pragma omp distribute parallel for default(none // expected-error {{expected ')'}} expected-note {{to match this '('}}
26 for (i = 0; i < argc; ++i) // expected-error 2 {{variable 'argc' must have explicitly specified data sharing attributes}}
30 #pragma omp distribute parallel for default(shared), default(shared) // expected-error {{directive '#pragma omp distribute parallel for' cannot contain more than one 'default' clause}}
31 for (i = 0; i < argc; ++i)
35 #pragma omp distribute parallel for default(x) // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
36 for (i = 0; i < argc; ++i)
40 #pragma omp distribute parallel for default(none)
41 for (i = 0; i < argc; ++i) // expected-error 2 {{variable 'argc' must have explicitly specified data sharing attributes}}
44 #pragma omp parallel default(none)
47 #pragma omp distribute parallel for default(shared)
48 for (i = 0; i < argc; ++i)
54 int main(int argc, char **argv) {
58 #pragma omp distribute parallel for default // expected-error {{expected '(' after 'default'}}
59 for (i = 0; i < argc; ++i)
63 #pragma omp distribute parallel for default( // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
64 for (i = 0; i < argc; ++i)
68 #pragma omp distribute parallel for default() // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
69 for (i = 0; i < argc; ++i)
73 #pragma omp distribute parallel for default(none // expected-error {{expected ')'}} expected-note {{to match this '('}}
74 for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
78 #pragma omp distribute parallel for default(shared), default(shared) // expected-error {{directive '#pragma omp distribute parallel for' cannot contain more than one 'default' clause}}
79 for (i = 0; i < argc; ++i)
83 #pragma omp distribute parallel for default(x) // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
84 for (i = 0; i < argc; ++i)
88 #pragma omp distribute parallel for default(none)
89 for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
92 #pragma omp parallel default(none)
95 #pragma omp distribute parallel for default(shared)
96 for (i = 0; i < argc; ++i)
99 return (tmain<int, 5>(argc) + tmain<char, 1>(argv[0][0])); // expected-note {{in instantiation of function template specialization 'tmain<int, 5>' requested here}} expected-note {{in instantiation of function template specialization 'tmain<char, 1>' requested here}}