1 | // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s |
2 | |
3 | // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s |
4 | |
5 | void foo() { |
6 | } |
7 | |
8 | bool foobool(int argc) { |
9 | return argc; |
10 | } |
11 | |
12 | struct S1; // expected-note {{declared here}} |
13 | |
14 | template <class T, class S> // expected-note {{declared here}} |
15 | int tmain(T argc, S **argv) { |
16 | T i; |
17 | #pragma omp target teams distribute parallel for if // expected-error {{expected '(' after 'if'}} |
18 | for (i = 0; i < argc; ++i) foo(); |
19 | #pragma omp target teams distribute parallel for if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} |
20 | for (i = 0; i < argc; ++i) foo(); |
21 | #pragma omp target teams distribute parallel for if () // expected-error {{expected expression}} |
22 | for (i = 0; i < argc; ++i) foo(); |
23 | #pragma omp target teams distribute parallel for if (argc // expected-error {{expected ')'}} expected-note {{to match this '('}} |
24 | for (i = 0; i < argc; ++i) foo(); |
25 | #pragma omp target teams distribute parallel for if (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for' are ignored}} |
26 | for (i = 0; i < argc; ++i) foo(); |
27 | #pragma omp target teams distribute parallel for if (argc > 0 ? argv[1] : argv[2]) |
28 | for (i = 0; i < argc; ++i) foo(); |
29 | #pragma omp target teams distribute parallel for if (foobool(argc)), if (true) // expected-error {{directive '#pragma omp target teams distribute parallel for' cannot contain more than one 'if' clause}} |
30 | for (i = 0; i < argc; ++i) foo(); |
31 | #pragma omp target teams distribute parallel for if (S) // expected-error {{'S' does not refer to a value}} |
32 | for (i = 0; i < argc; ++i) foo(); |
33 | #pragma omp target teams distribute parallel for if (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}} |
34 | for (i = 0; i < argc; ++i) foo(); |
35 | #pragma omp target teams distribute parallel for if (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}} |
36 | for (i = 0; i < argc; ++i) foo(); |
37 | #pragma omp target teams distribute parallel for if(argc) |
38 | for (i = 0; i < argc; ++i) foo(); |
39 | #pragma omp target teams distribute parallel for if(parallel // expected-error {{use of undeclared identifier 'parallel'}} expected-error {{expected ')'}} expected-note {{to match this '('}} |
40 | for (i = 0; i < argc; ++i) foo(); |
41 | #pragma omp target teams distribute parallel for if(parallel : // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} |
42 | for (i = 0; i < argc; ++i) foo(); |
43 | #pragma omp target teams distribute parallel for if(parallel : argc // expected-error {{expected ')'}} expected-note {{to match this '('}} |
44 | for (i = 0; i < argc; ++i) foo(); |
45 | #pragma omp target teams distribute parallel for if(parallel : argc) |
46 | for (i = 0; i < argc; ++i) foo(); |
47 | #pragma omp target teams distribute parallel for if(parallel : argc) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp target teams distribute parallel for'}} |
48 | for (i = 0; i < argc; ++i) foo(); |
49 | #pragma omp target teams distribute parallel for if(parallel : argc) if (parallel:argc) // expected-error {{directive '#pragma omp target teams distribute parallel for' cannot contain more than one 'if' clause with 'parallel' name modifier}} |
50 | for (i = 0; i < argc; ++i) foo(); |
51 | #pragma omp target teams distribute parallel for if(target : argc) if (target:argc) // expected-error {{directive '#pragma omp target teams distribute parallel for' cannot contain more than one 'if' clause with 'target' name modifier}} |
52 | for (i = 0; i < argc; ++i) foo(); |
53 | #pragma omp target teams distribute parallel for if(parallel : argc) if (argc) // expected-error {{expected 'target' directive name modifier}} expected-note {{previous clause with directive name modifier specified here}} |
54 | for (i = 0; i < argc; ++i) foo(); |
55 | #pragma omp target teams distribute parallel for if(target: argc) if (argc) // expected-error {{expected 'parallel' directive name modifier}} expected-note {{previous clause with directive name modifier specified here}} |
56 | for (i = 0; i < argc; ++i) foo(); |
57 | #pragma omp target teams distribute parallel for if(distribute : argc) // expected-error {{directive name modifier 'distribute' is not allowed for '#pragma omp target teams distribute parallel for'}} |
58 | for (i = 0; i < argc; ++i) foo(); |
59 | |
60 | return 0; |
61 | } |
62 | |
63 | int main(int argc, char **argv) { |
64 | int i; |
65 | #pragma omp target teams distribute parallel for if // expected-error {{expected '(' after 'if'}} |
66 | for (i = 0; i < argc; ++i) foo(); |
67 | #pragma omp target teams distribute parallel for if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} |
68 | for (i = 0; i < argc; ++i) foo(); |
69 | #pragma omp target teams distribute parallel for if () // expected-error {{expected expression}} |
70 | for (i = 0; i < argc; ++i) foo(); |
71 | #pragma omp target teams distribute parallel for if (argc // expected-error {{expected ')'}} expected-note {{to match this '('}} |
72 | for (i = 0; i < argc; ++i) foo(); |
73 | #pragma omp target teams distribute parallel for if (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for' are ignored}} |
74 | for (i = 0; i < argc; ++i) foo(); |
75 | #pragma omp target teams distribute parallel for if (argc > 0 ? argv[1] : argv[2]) |
76 | for (i = 0; i < argc; ++i) foo(); |
77 | #pragma omp target teams distribute parallel for if (foobool(argc)), if (true) // expected-error {{directive '#pragma omp target teams distribute parallel for' cannot contain more than one 'if' clause}} |
78 | for (i = 0; i < argc; ++i) foo(); |
79 | #pragma omp target teams distribute parallel for if (S1) // expected-error {{'S1' does not refer to a value}} |
80 | for (i = 0; i < argc; ++i) foo(); |
81 | #pragma omp target teams distribute parallel for if (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}} |
82 | for (i = 0; i < argc; ++i) foo(); |
83 | #pragma omp target teams distribute parallel for if (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}} |
84 | for (i = 0; i < argc; ++i) foo(); |
85 | #pragma omp target teams distribute parallel for if (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}} |
86 | for (i = 0; i < argc; ++i) foo(); |
87 | #pragma omp target teams distribute parallel for if(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} |
88 | for (i = 0; i < argc; ++i) foo(); |
89 | #pragma omp target teams distribute parallel for if(parallel // expected-error {{use of undeclared identifier 'parallel'}} expected-error {{expected ')'}} expected-note {{to match this '('}} |
90 | for (i = 0; i < argc; ++i) foo(); |
91 | #pragma omp target teams distribute parallel for if(parallel : // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} |
92 | for (i = 0; i < argc; ++i) foo(); |
93 | #pragma omp target teams distribute parallel for if(parallel : argc // expected-error {{expected ')'}} expected-note {{to match this '('}} |
94 | for (i = 0; i < argc; ++i) foo(); |
95 | #pragma omp target teams distribute parallel for if(parallel : argc) |
96 | for (i = 0; i < argc; ++i) foo(); |
97 | #pragma omp target teams distribute parallel for if(parallel : argc) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp target teams distribute parallel for'}} |
98 | for (i = 0; i < argc; ++i) foo(); |
99 | #pragma omp target teams distribute parallel for if(parallel : argc) if (parallel:argc) // expected-error {{directive '#pragma omp target teams distribute parallel for' cannot contain more than one 'if' clause with 'parallel' name modifier}} |
100 | for (i = 0; i < argc; ++i) foo(); |
101 | #pragma omp target teams distribute parallel for if(target: argc) if (target:argc) // expected-error {{directive '#pragma omp target teams distribute parallel for' cannot contain more than one 'if' clause with 'target' name modifier}} |
102 | for (i = 0; i < argc; ++i) foo(); |
103 | #pragma omp target teams distribute parallel for if(parallel : argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} expected-error {{expected 'target' directive name modifier}} |
104 | for (i = 0; i < argc; ++i) foo(); |
105 | #pragma omp target teams distribute parallel for if(target: argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} expected-error {{expected 'parallel' directive name modifier}} |
106 | for (i = 0; i < argc; ++i) foo(); |
107 | #pragma omp target teams distribute parallel for if(distribute : argc) // expected-error {{directive name modifier 'distribute' is not allowed for '#pragma omp target teams distribute parallel for'}} |
108 | for (i = 0; i < argc; ++i) foo(); |
109 | |
110 | return tmain(argc, argv); |
111 | } |
112 | |