1// RUN: %clang_cc1 -verify -fopenmp %s
2
3void foo() {
4}
5
6template <class T, typename S, int N, int ST>
7T tmain(T argc, S **argv) {
8  int i;
9  #pragma omp target parallel for defaultmap // expected-error {{expected '(' after 'defaultmap'}}
10  for (i = 0; i < argc; ++i) foo();
11  #pragma omp target parallel for defaultmap ( // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
12  for (i = 0; i < argc; ++i) foo();
13  #pragma omp target parallel for defaultmap () // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
14  for (i = 0; i < argc; ++i) foo();
15  #pragma omp target parallel for defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
16  for (i = 0; i < argc; ++i) foo();
17  #pragma omp target parallel for defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
18  for (i = 0; i < argc; ++i) foo();
19  #pragma omp target parallel for defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
20  for (i = 0; i < argc; ++i) foo();
21  #pragma omp target parallel for defaultmap (tofrom scalar) // expected-warning {{missing ':' after defaultmap modifier - ignoring}}
22  for (i = 0; i < argc; ++i) foo();
23  #pragma omp target parallel for defaultmap (tofrom, // expected-error {{expected ')'}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}}
24  for (i = 0; i < argc; ++i) foo();
25  #pragma omp target parallel for defaultmap (scalar: // expected-error {{expected ')'}} expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
26  for (i = 0; i < argc; ++i) foo();
27  #pragma omp target parallel for defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
28  for (i = 0; i < argc; ++i) foo();
29
30  return argc;
31}
32
33int main(int argc, char **argv) {
34  int i;
35  #pragma omp target parallel for defaultmap // expected-error {{expected '(' after 'defaultmap'}}
36  for (i = 0; i < argc; ++i) foo();
37  #pragma omp target parallel for defaultmap ( // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
38  for (i = 0; i < argc; ++i) foo();
39  #pragma omp target parallel for defaultmap () // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
40  for (i = 0; i < argc; ++i) foo();
41  #pragma omp target parallel for defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
42  for (i = 0; i < argc; ++i) foo();
43  #pragma omp target parallel for defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
44  for (i = 0; i < argc; ++i) foo();
45  #pragma omp target parallel for defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
46  for (i = 0; i < argc; ++i) foo();
47  #pragma omp target parallel for defaultmap (tofrom scalar) // expected-warning {{missing ':' after defaultmap modifier - ignoring}}
48  for (i = 0; i < argc; ++i) foo();
49  #pragma omp target parallel for defaultmap (tofrom, // expected-error {{expected ')'}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}}
50  for (i = 0; i < argc; ++i) foo();
51  #pragma omp target parallel for defaultmap (scalar: // expected-error {{expected ')'}} expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
52  for (i = 0; i < argc; ++i) foo();
53  #pragma omp target parallel for defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
54  for (i = 0; i < argc; ++i) foo();
55
56  return tmain<int, char, 1, 0>(argc, argv);
57}
58
59