1 // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=51 -ast-print %s | FileCheck %s
2 // RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s
3 // RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
5 // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=51 -ast-print %s | FileCheck %s
6 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s
7 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
8 // expected-no-diagnostics
15 template <class T
, int N
>
17 T b
= argc
, c
, d
, e
, f
, g
;
21 #pragma omp taskloop grainsize(strict: N)
22 // CHECK-NEXT: #pragma omp taskgroup
23 // CHECK-NEXT: #pragma omp taskloop grainsize(strict: N)
24 for (int i
= 0; i
< 2; ++i
)
26 // CHECK-NEXT: for (int i = 0; i < 2; ++i)
29 #pragma omp taskloop grainsize(strict: N)
30 for (int i
= 0; i
< 2; ++i
)
31 for (int j
= 0; j
< 2; ++j
)
32 for (int j
= 0; j
< 2; ++j
)
33 for (int j
= 0; j
< 2; ++j
)
34 for (int j
= 0; j
< 2; ++j
)
35 for (int i
= 0; i
< 2; ++i
)
36 for (int j
= 0; j
< 2; ++j
)
37 for (int j
= 0; j
< 2; ++j
)
38 for (int j
= 0; j
< 2; ++j
)
39 for (int j
= 0; j
< 2; ++j
) {
40 #pragma omp cancel taskgroup
41 #pragma omp cancellation point taskgroup
44 // CHECK-NEXT: #pragma omp parallel
45 // CHECK-NEXT: #pragma omp taskloop grainsize(strict: N)
46 // CHECK-NEXT: for (int i = 0; i < 2; ++i)
47 // CHECK-NEXT: for (int j = 0; j < 2; ++j)
48 // CHECK-NEXT: for (int j = 0; j < 2; ++j)
49 // CHECK-NEXT: for (int j = 0; j < 2; ++j)
50 // CHECK-NEXT: for (int j = 0; j < 2; ++j)
51 // CHECK-NEXT: for (int i = 0; i < 2; ++i)
52 // CHECK-NEXT: for (int j = 0; j < 2; ++j)
53 // CHECK-NEXT: for (int j = 0; j < 2; ++j)
54 // CHECK-NEXT: for (int j = 0; j < 2; ++j)
55 // CHECK-NEXT: for (int j = 0; j < 2; ++j) {
56 // CHECK-NEXT: #pragma omp cancel taskgroup
57 // CHECK-NEXT: #pragma omp cancellation point taskgroup
61 #pragma omp taskloop num_tasks(strict: N)
62 // CHECK: #pragma omp taskgroup
63 // CHECK-NEXT: #pragma omp taskloop num_tasks(strict: N)
64 for (int i
= 0; i
< 2; ++i
)
66 // CHECK-NEXT: for (int i = 0; i < 2; ++i)
69 #pragma omp taskloop num_tasks(strict: N)
70 for (int i
= 0; i
< 2; ++i
)
71 for (int j
= 0; j
< 2; ++j
)
72 for (int j
= 0; j
< 2; ++j
)
73 for (int j
= 0; j
< 2; ++j
)
74 for (int j
= 0; j
< 2; ++j
)
75 for (int i
= 0; i
< 2; ++i
)
76 for (int j
= 0; j
< 2; ++j
)
77 for (int j
= 0; j
< 2; ++j
)
78 for (int j
= 0; j
< 2; ++j
)
79 for (int j
= 0; j
< 2; ++j
) {
80 #pragma omp cancel taskgroup
81 #pragma omp cancellation point taskgroup
84 // CHECK-NEXT: #pragma omp parallel
85 // CHECK-NEXT: #pragma omp taskloop num_tasks(strict: N)
86 // CHECK-NEXT: for (int i = 0; i < 2; ++i)
87 // CHECK-NEXT: for (int j = 0; j < 2; ++j)
88 // CHECK-NEXT: for (int j = 0; j < 2; ++j)
89 // CHECK-NEXT: for (int j = 0; j < 2; ++j)
90 // CHECK-NEXT: for (int j = 0; j < 2; ++j)
91 // CHECK-NEXT: for (int i = 0; i < 2; ++i)
92 // CHECK-NEXT: for (int j = 0; j < 2; ++j)
93 // CHECK-NEXT: for (int j = 0; j < 2; ++j)
94 // CHECK-NEXT: for (int j = 0; j < 2; ++j)
95 // CHECK-NEXT: for (int j = 0; j < 2; ++j) {
96 // CHECK-NEXT: #pragma omp cancel taskgroup
97 // CHECK-NEXT: #pragma omp cancellation point taskgroup
102 // CHECK-LABEL: int main(int argc, char **argv) {
103 int main(int argc
, char **argv
) {
104 int b
= argc
, c
, d
, e
, f
, g
;
107 // CHECK: static int a;
108 #pragma omp taskloop grainsize(strict: argc)
109 for (int i
= 0; i
< 10; ++i
)
111 // CHECK-NEXT: #pragma omp taskloop grainsize(strict: argc)
112 // CHECK-NEXT: for (int i = 0; i < 10; ++i)
113 // CHECK-NEXT: foo();
116 #pragma omp masked taskloop grainsize(strict: argc)
117 for (int i
= 0; i
< 10; ++i
)
119 // CHECK: #pragma omp parallel
120 // CHECK-NEXT: #pragma omp masked taskloop grainsize(strict: argc)
121 // CHECK-NEXT: for (int i = 0; i < 10; ++i)
122 // CHECK-NEXT: foo();
125 #pragma omp masked taskloop simd grainsize(strict: argc)
126 for (int i
= 0; i
< 10; ++i
)
128 // CHECK: #pragma omp parallel
129 // CHECK-NEXT: #pragma omp masked taskloop simd grainsize(strict: argc)
130 // CHECK-NEXT: for (int i = 0; i < 10; ++i)
131 // CHECK-NEXT: foo();
133 #pragma omp parallel masked taskloop grainsize(strict: argc)
134 for (int i
= 0; i
< 10; ++i
)
136 // CHECK-NEXT: #pragma omp parallel masked taskloop grainsize(strict: argc)
137 // CHECK-NEXT: for (int i = 0; i < 10; ++i)
138 // CHECK-NEXT: foo();
140 #pragma omp parallel masked taskloop simd grainsize(strict: argc)
141 for (int i
= 0; i
< 10; ++i
)
143 // CHECK-NEXT: #pragma omp parallel masked taskloop simd grainsize(strict: argc)
144 // CHECK-NEXT: for (int i = 0; i < 10; ++i)
145 // CHECK-NEXT: foo();
148 #pragma omp master taskloop grainsize(strict: argc)
149 for (int i
= 0; i
< 10; ++i
)
151 // CHECK: #pragma omp parallel
152 // CHECK-NEXT: #pragma omp master taskloop grainsize(strict: argc)
153 // CHECK-NEXT: for (int i = 0; i < 10; ++i)
154 // CHECK-NEXT: foo();
157 #pragma omp master taskloop simd grainsize(strict: argc)
158 for (int i
= 0; i
< 10; ++i
)
160 // CHECK: #pragma omp parallel
161 // CHECK-NEXT: #pragma omp master taskloop simd grainsize(strict: argc)
162 // CHECK-NEXT: for (int i = 0; i < 10; ++i)
163 // CHECK-NEXT: foo();
165 #pragma omp parallel master taskloop grainsize(strict: argc)
166 for (int i
= 0; i
< 10; ++i
)
168 // CHECK-NEXT: #pragma omp parallel master taskloop grainsize(strict: argc)
169 // CHECK-NEXT: for (int i = 0; i < 10; ++i)
170 // CHECK-NEXT: foo();
172 #pragma omp parallel master taskloop simd grainsize(strict: argc)
173 for (int i
= 0; i
< 10; ++i
)
175 // CHECK-NEXT: #pragma omp parallel master taskloop simd grainsize(strict: argc)
176 // CHECK-NEXT: for (int i = 0; i < 10; ++i)
177 // CHECK-NEXT: foo();
179 #pragma omp taskloop num_tasks(strict: argc)
180 for (int i
= 0; i
< 10; ++i
)
182 // CHECK: #pragma omp taskloop num_tasks(strict: argc)
183 // CHECK-NEXT: for (int i = 0; i < 10; ++i)
184 // CHECK-NEXT: foo();
187 #pragma omp masked taskloop num_tasks(strict: argc)
188 for (int i
= 0; i
< 10; ++i
)
190 // CHECK: #pragma omp parallel
191 // CHECK-NEXT: #pragma omp masked taskloop num_tasks(strict: argc)
192 // CHECK-NEXT: for (int i = 0; i < 10; ++i)
193 // CHECK-NEXT: foo();
196 #pragma omp masked taskloop simd num_tasks(strict: argc)
197 for (int i
= 0; i
< 10; ++i
)
199 // CHECK: #pragma omp parallel
200 // CHECK-NEXT: #pragma omp masked taskloop simd num_tasks(strict: argc)
201 // CHECK-NEXT: for (int i = 0; i < 10; ++i)
202 // CHECK-NEXT: foo();
204 #pragma omp parallel masked taskloop num_tasks(strict: argc)
205 for (int i
= 0; i
< 10; ++i
)
207 // CHECK-NEXT: #pragma omp parallel masked taskloop num_tasks(strict: argc)
208 // CHECK-NEXT: for (int i = 0; i < 10; ++i)
209 // CHECK-NEXT: foo();
211 #pragma omp parallel masked taskloop simd num_tasks(strict: argc)
212 for (int i
= 0; i
< 10; ++i
)
214 // CHECK-NEXT: #pragma omp parallel masked taskloop simd num_tasks(strict: argc)
215 // CHECK-NEXT: for (int i = 0; i < 10; ++i)
216 // CHECK-NEXT: foo();
219 #pragma omp master taskloop num_tasks(strict: argc)
220 for (int i
= 0; i
< 10; ++i
)
222 // CHECK: #pragma omp parallel
223 // CHECK-NEXT: #pragma omp master taskloop num_tasks(strict: argc)
224 // CHECK-NEXT: for (int i = 0; i < 10; ++i)
225 // CHECK-NEXT: foo();
228 #pragma omp master taskloop simd num_tasks(strict: argc)
229 for (int i
= 0; i
< 10; ++i
)
231 // CHECK: #pragma omp parallel
232 // CHECK-NEXT: #pragma omp master taskloop simd num_tasks(strict: argc)
233 // CHECK-NEXT: for (int i = 0; i < 10; ++i)
234 // CHECK-NEXT: foo();
236 #pragma omp parallel master taskloop num_tasks(strict: argc)
237 for (int i
= 0; i
< 10; ++i
)
239 // CHECK-NEXT: #pragma omp parallel master taskloop num_tasks(strict: argc)
240 // CHECK-NEXT: for (int i = 0; i < 10; ++i)
241 // CHECK-NEXT: foo();
243 #pragma omp parallel master taskloop simd num_tasks(strict: argc)
244 for (int i
= 0; i
< 10; ++i
)
246 // CHECK-NEXT: #pragma omp parallel master taskloop simd num_tasks(strict: argc)
247 // CHECK-NEXT: for (int i = 0; i < 10; ++i)
248 // CHECK-NEXT: foo();
250 return (tmain
<int, 5>(argc
) + tmain
<char, 1>(argv
[0][0]));