1 // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCheck %s
2 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -emit-pch -o %t %s
3 // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
4 // RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
5 // RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
6 // expected-no-diagnostics
7 // REQUIRES: x86-registered-target
8 #ifndef HEADER
9 #define HEADER
10 template <class T>
11 struct S {
12 T f;
SS13 S(T a) : f(a) {}
SS14 S() : f() {}
operator TS15 operator T() { return T(); }
~SS16 ~S() {}
17 };
18
19 volatile int g __attribute__((aligned(128))) = 1212;
20
21 struct SS {
22 int a;
23 int b : 4;
24 int &c;
SSSS25 SS(int &d) : a(0), b(0), c(d) {
26 #pragma omp parallel private(a, b, c)
27 #ifdef LAMBDA
28 [&]() {
29 ++this->a, --b, (this)->c /= 1;
30 #pragma omp parallel private(a, b, c)
31 ++(this)->a, --b, this->c /= 1;
32 }();
33 #elif defined(BLOCKS)
34 ^{
35 ++a;
36 --this->b;
37 (this)->c /= 1;
38 #pragma omp parallel private(a, b, c)
39 ++(this)->a, --b, this->c /= 1;
40 }();
41 #else
42 ++this->a, --b, c /= 1;
43 #endif
44 }
45 };
46
47 template<typename T>
48 struct SST {
49 T a;
SSTSST50 SST() : a(T()) {
51 #pragma omp parallel private(a)
52 #ifdef LAMBDA
53 [&]() {
54 [&]() {
55 ++this->a;
56 #pragma omp parallel private(a)
57 ++(this)->a;
58 }();
59 }();
60 #elif defined(BLOCKS)
61 ^{
62 ^{
63 ++a;
64 #pragma omp parallel private(a)
65 ++(this)->a;
66 }();
67 }();
68 #else
69 ++(this)->a;
70 #endif
71 }
72 };
73
74 // CHECK: [[SS_TY:%.+]] = type { i{{[0-9]+}}, i8
75 // LAMBDA: [[SS_TY:%.+]] = type { i{{[0-9]+}}, i8
76 // BLOCKS: [[SS_TY:%.+]] = type { i{{[0-9]+}}, i8
77 // CHECK: [[S_FLOAT_TY:%.+]] = type { float }
78 // CHECK: [[S_INT_TY:%.+]] = type { i{{[0-9]+}} }
79 // CHECK: [[SST_TY:%.+]] = type { i{{[0-9]+}} }
80 template <typename T>
tmain()81 T tmain() {
82 S<T> test;
83 SST<T> sst;
84 T t_var __attribute__((aligned(128))) = T();
85 T vec[] __attribute__((aligned(128))) = {1, 2};
86 S<T> s_arr[] __attribute__((aligned(128))) = {1, 2};
87 S<T> var __attribute__((aligned(128))) (3);
88 #pragma omp parallel private(t_var, vec, s_arr, var)
89 {
90 vec[0] = t_var;
91 s_arr[0] = var;
92 }
93 return T();
94 }
95
main()96 int main() {
97 static int sivar;
98 SS ss(sivar);
99 #ifdef LAMBDA
100 // LAMBDA: [[G:@.+]] = global i{{[0-9]+}} 1212,
101 // LAMBDA-LABEL: @main
102 // LAMBDA: alloca [[SS_TY]],
103 // LAMBDA: alloca [[CAP_TY:%.+]],
104 // LAMBDA: call{{.*}} void [[OUTER_LAMBDA:@[^(]+]]([[CAP_TY]]*
105 [&]() {
106 // LAMBDA: define{{.*}} internal{{.*}} void [[OUTER_LAMBDA]](
107 // LAMBDA-NOT: = getelementptr inbounds %{{.+}},
108 // LAMBDA: call{{.*}} void {{.+}} @__kmpc_fork_call({{.+}}, i32 0, {{.+}}* [[OMP_REGION:@.+]] to {{.+}})
109 #pragma omp parallel private(g, sivar)
110 {
111 // LAMBDA: define {{.+}} @{{.+}}([[SS_TY]]*
112 // LAMBDA: store i{{[0-9]+}} 0, i{{[0-9]+}}* %
113 // LAMBDA: store i8
114 // LAMBDA: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 1, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, [[SS_TY]]*)* [[SS_MICROTASK:@.+]] to void
115 // LAMBDA: ret
116
117 // LAMBDA: define internal void [[SS_MICROTASK]](i{{[0-9]+}}* noalias [[GTID_ADDR:%.+]], i{{[0-9]+}}* noalias %{{.+}}, [[SS_TY]]* %{{.+}})
118 // LAMBDA-NOT: getelementptr {{.*}}[[SS_TY]], [[SS_TY]]* %
119 // LAMBDA: call{{.*}} void
120 // LAMBDA: ret void
121
122 // LAMBDA: define internal void @{{.+}}(i{{[0-9]+}}* noalias [[GTID_ADDR:%.+]], i{{[0-9]+}}* noalias %{{.+}}, [[SS_TY]]* %{{.+}})
123 // LAMBDA: [[A_PRIV:%.+]] = alloca i{{[0-9]+}},
124 // LAMBDA: [[B_PRIV:%.+]] = alloca i{{[0-9]+}},
125 // LAMBDA: [[C_PRIV:%.+]] = alloca i{{[0-9]+}},
126 // LAMBDA: store i{{[0-9]+}}* [[A_PRIV]], i{{[0-9]+}}** [[REFA:%.+]],
127 // LAMBDA: store i{{[0-9]+}}* [[C_PRIV]], i{{[0-9]+}}** [[REFC:%.+]],
128 // LAMBDA-NEXT: [[A_PRIV:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[REFA]],
129 // LAMBDA-NEXT: [[A_VAL:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[A_PRIV]],
130 // LAMBDA-NEXT: [[INC:%.+]] = add nsw i{{[0-9]+}} [[A_VAL]], 1
131 // LAMBDA-NEXT: store i{{[0-9]+}} [[INC]], i{{[0-9]+}}* [[A_PRIV]],
132 // LAMBDA-NEXT: [[B_VAL:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[B_PRIV]],
133 // LAMBDA-NEXT: [[DEC:%.+]] = add nsw i{{[0-9]+}} [[B_VAL]], -1
134 // LAMBDA-NEXT: store i{{[0-9]+}} [[DEC]], i{{[0-9]+}}* [[B_PRIV]],
135 // LAMBDA-NEXT: [[C_PRIV:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[REFC]],
136 // LAMBDA-NEXT: [[C_VAL:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[C_PRIV]],
137 // LAMBDA-NEXT: [[DIV:%.+]] = sdiv i{{[0-9]+}} [[C_VAL]], 1
138 // LAMBDA-NEXT: store i{{[0-9]+}} [[DIV]], i{{[0-9]+}}* [[C_PRIV]],
139 // LAMBDA-NEXT: ret void
140
141 // LAMBDA: define{{.*}} internal{{.*}} void [[OMP_REGION]](i32* noalias %{{.+}}, i32* noalias %{{.+}})
142 // LAMBDA: [[G_PRIVATE_ADDR:%.+]] = alloca i{{[0-9]+}},
143 // LAMBDA: [[SIVAR_PRIVATE_ADDR:%.+]] = alloca i{{[0-9]+}},
144 g = 1;
145 sivar = 2;
146 // LAMBDA: store i{{[0-9]+}} 1, i{{[0-9]+}}* [[G_PRIVATE_ADDR]],
147 // LAMBDA: store i{{[0-9]+}} 2, i{{[0-9]+}}* [[SIVAR_PRIVATE_ADDR]],
148 // LAMBDA: [[G_PRIVATE_ADDR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
149 // LAMBDA: store i{{[0-9]+}}* [[G_PRIVATE_ADDR]], i{{[0-9]+}}** [[G_PRIVATE_ADDR_REF]]
150
151 // LAMBDA: [[SIVAR_PRIVATE_ADDR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
152 // LAMBDA: store i{{[0-9]+}}* [[SIVAR_PRIVATE_ADDR]], i{{[0-9]+}}** [[SIVAR_PRIVATE_ADDR_REF]]
153
154 // LAMBDA: call{{.*}} void [[INNER_LAMBDA:@.+]](%{{.+}}* [[ARG]])
155 [&]() {
156 // LAMBDA: define {{.+}} void [[INNER_LAMBDA]](%{{.+}}* [[ARG_PTR:%.+]])
157 // LAMBDA: store %{{.+}}* [[ARG_PTR]], %{{.+}}** [[ARG_PTR_REF:%.+]],
158 g = 2;
159 sivar = 4;
160 // LAMBDA: [[ARG_PTR:%.+]] = load %{{.+}}*, %{{.+}}** [[ARG_PTR_REF]]
161 // LAMBDA: [[G_PTR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG_PTR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
162 // LAMBDA: [[G_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[G_PTR_REF]]
163 // LAMBDA: store i{{[0-9]+}} 2, i{{[0-9]+}}* [[G_REF]]
164 // LAMBDA: [[SIVAR_PTR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG_PTR]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
165 // LAMBDA: [[SIVAR_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[SIVAR_PTR_REF]]
166 // LAMBDA: store i{{[0-9]+}} 4, i{{[0-9]+}}* [[SIVAR_REF]]
167 }();
168 }
169 }();
170 return 0;
171 #elif defined(BLOCKS)
172 // BLOCKS: [[G:@.+]] = global i{{[0-9]+}} 1212,
173 // BLOCKS-LABEL: @main
174 // BLOCKS: call
175 // BLOCKS: call{{.*}} void {{%.+}}(i8
176 ^{
177 // BLOCKS: define{{.*}} internal{{.*}} void {{.+}}(i8*
178 // BLOCKS-NOT: = getelementptr inbounds %{{.+}},
179 // BLOCKS: call{{.*}} void {{.+}} @__kmpc_fork_call({{.+}}, i32 0, {{.+}}* [[OMP_REGION:@.+]] to {{.+}})
180 #pragma omp parallel private(g, sivar)
181 {
182 // BLOCKS: define{{.*}} internal{{.*}} void [[OMP_REGION]](i32* noalias %{{.+}}, i32* noalias %{{.+}})
183 // BLOCKS: [[G_PRIVATE_ADDR:%.+]] = alloca i{{[0-9]+}},
184 // BLOCKS: [[SIVAR_PRIVATE_ADDR:%.+]] = alloca i{{[0-9]+}},
185 g = 1;
186 sivar = 20;
187 // BLOCKS: store i{{[0-9]+}} 1, i{{[0-9]+}}* [[G_PRIVATE_ADDR]],
188 // BLOCKS: store i{{[0-9]+}} 20, i{{[0-9]+}}* [[SIVAR_PRIVATE_ADDR]],
189 // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
190 // BLOCKS: i{{[0-9]+}}* [[G_PRIVATE_ADDR]]
191 // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
192 // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
193 // BLOCKS: i{{[0-9]+}}* [[SIVAR_PRIVATE_ADDR]]
194 // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
195 // BLOCKS: call{{.*}} void {{%.+}}(i8
196 ^{
197 // BLOCKS: define {{.+}} void {{@.+}}(i8*
198 g = 2;
199 sivar = 40;
200 // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
201 // BLOCKS: store i{{[0-9]+}} 2, i{{[0-9]+}}*
202 // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
203 // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
204 // BLOCKS: store i{{[0-9]+}} 40, i{{[0-9]+}}*
205 // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
206 // BLOCKS: ret
207 }();
208 }
209 }();
210 return 0;
211 // BLOCKS: define {{.+}} @{{.+}}([[SS_TY]]*
212 // BLOCKS: store i{{[0-9]+}} 0, i{{[0-9]+}}* %
213 // BLOCKS: store i8
214 // BLOCKS: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 1, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, [[SS_TY]]*)* [[SS_MICROTASK:@.+]] to void
215 // BLOCKS: ret
216
217 // BLOCKS: define internal void [[SS_MICROTASK]](i{{[0-9]+}}* noalias [[GTID_ADDR:%.+]], i{{[0-9]+}}* noalias %{{.+}}, [[SS_TY]]* %{{.+}})
218 // BLOCKS-NOT: getelementptr {{.*}}[[SS_TY]], [[SS_TY]]* %
219 // BLOCKS: call{{.*}} void
220 // BLOCKS: ret void
221
222 // BLOCKS: define internal void @{{.+}}(i{{[0-9]+}}* noalias [[GTID_ADDR:%.+]], i{{[0-9]+}}* noalias %{{.+}}, [[SS_TY]]* %{{.+}})
223 // BLOCKS: [[A_PRIV:%.+]] = alloca i{{[0-9]+}},
224 // BLOCKS: [[B_PRIV:%.+]] = alloca i{{[0-9]+}},
225 // BLOCKS: [[C_PRIV:%.+]] = alloca i{{[0-9]+}},
226 // BLOCKS: store i{{[0-9]+}}* [[A_PRIV]], i{{[0-9]+}}** [[REFA:%.+]],
227 // BLOCKS: store i{{[0-9]+}}* [[C_PRIV]], i{{[0-9]+}}** [[REFC:%.+]],
228 // BLOCKS-NEXT: [[A_PRIV:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[REFA]],
229 // BLOCKS-NEXT: [[A_VAL:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[A_PRIV]],
230 // BLOCKS-NEXT: [[INC:%.+]] = add nsw i{{[0-9]+}} [[A_VAL]], 1
231 // BLOCKS-NEXT: store i{{[0-9]+}} [[INC]], i{{[0-9]+}}* [[A_PRIV]],
232 // BLOCKS-NEXT: [[B_VAL:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[B_PRIV]],
233 // BLOCKS-NEXT: [[DEC:%.+]] = add nsw i{{[0-9]+}} [[B_VAL]], -1
234 // BLOCKS-NEXT: store i{{[0-9]+}} [[DEC]], i{{[0-9]+}}* [[B_PRIV]],
235 // BLOCKS-NEXT: [[C_PRIV:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[REFC]],
236 // BLOCKS-NEXT: [[C_VAL:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[C_PRIV]],
237 // BLOCKS-NEXT: [[DIV:%.+]] = sdiv i{{[0-9]+}} [[C_VAL]], 1
238 // BLOCKS-NEXT: store i{{[0-9]+}} [[DIV]], i{{[0-9]+}}* [[C_PRIV]],
239 // BLOCKS-NEXT: ret void
240 #else
241 S<float> test;
242 int t_var = 0;
243 int vec[] = {1, 2};
244 S<float> s_arr[] = {1, 2};
245 S<float> var(3);
246 #pragma omp parallel private(t_var, vec, s_arr, var, sivar)
247 {
248 vec[0] = t_var;
249 s_arr[0] = var;
250 sivar = 3;
251 }
252 return tmain<int>();
253 #endif
254 }
255
256 // CHECK: define i{{[0-9]+}} @main()
257 // CHECK: [[TEST:%.+]] = alloca [[S_FLOAT_TY]],
258 // CHECK: call {{.*}} [[S_FLOAT_TY_DEF_CONSTR:@.+]]([[S_FLOAT_TY]]* [[TEST]])
259 // CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 0, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*)* [[MAIN_MICROTASK:@.+]] to void
260 // CHECK: = call i{{.+}} [[TMAIN_INT:@.+]]()
261 // CHECK: call void [[S_FLOAT_TY_DESTR:@.+]]([[S_FLOAT_TY]]*
262 // CHECK: ret
263 //
264 // CHECK: define internal void [[MAIN_MICROTASK]](i{{[0-9]+}}* noalias [[GTID_ADDR:%.+]], i{{[0-9]+}}* noalias %{{.+}})
265 // CHECK: [[T_VAR_PRIV:%.+]] = alloca i{{[0-9]+}},
266 // CHECK: [[VEC_PRIV:%.+]] = alloca [2 x i{{[0-9]+}}],
267 // CHECK: [[S_ARR_PRIV:%.+]] = alloca [2 x [[S_FLOAT_TY]]],
268 // CHECK: [[VAR_PRIV:%.+]] = alloca [[S_FLOAT_TY]],
269 // CHECK: [[SIVAR_PRIV:%.+]] = alloca i{{[0-9]+}},
270 // CHECK: store i{{[0-9]+}}* [[GTID_ADDR]], i{{[0-9]+}}** [[GTID_ADDR_REF:%.+]]
271 // CHECK-NOT: [[T_VAR_PRIV]]
272 // CHECK-NOT: [[VEC_PRIV]]
273 // CHECK: {{.+}}:
274 // CHECK: [[S_ARR_PRIV_ITEM:%.+]] = phi [[S_FLOAT_TY]]*
275 // CHECK: call {{.*}} [[S_FLOAT_TY_DEF_CONSTR]]([[S_FLOAT_TY]]* [[S_ARR_PRIV_ITEM]])
276 // CHECK-NOT: [[T_VAR_PRIV]]
277 // CHECK-NOT: [[VEC_PRIV]]
278 // CHECK: call {{.*}} [[S_FLOAT_TY_DEF_CONSTR]]([[S_FLOAT_TY]]* [[VAR_PRIV]])
279 // CHECK-DAG: call void [[S_FLOAT_TY_DESTR]]([[S_FLOAT_TY]]* [[VAR_PRIV]])
280 // CHECK-DAG: call void [[S_FLOAT_TY_DESTR]]([[S_FLOAT_TY]]*
281 // CHECK: ret void
282
283 // CHECK: define {{.*}} i{{[0-9]+}} [[TMAIN_INT]]()
284 // CHECK: [[TEST:%.+]] = alloca [[S_INT_TY]],
285 // CHECK: call {{.*}} [[S_INT_TY_DEF_CONSTR:@.+]]([[S_INT_TY]]* [[TEST]])
286 // CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 0, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*)* [[TMAIN_MICROTASK:@.+]] to void
287 // CHECK: call void [[S_INT_TY_DESTR:@.+]]([[S_INT_TY]]*
288 // CHECK: ret
289 //
290 // CHECK: define {{.+}} @{{.+}}([[SS_TY]]*
291 // CHECK: store i{{[0-9]+}} 0, i{{[0-9]+}}* %
292 // CHECK: store i8
293 // CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 1, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, [[SS_TY]]*)* [[SS_MICROTASK:@.+]] to void
294 // CHECK: ret
295
296 // CHECK: define internal void [[SS_MICROTASK]](i{{[0-9]+}}* noalias [[GTID_ADDR:%.+]], i{{[0-9]+}}* noalias %{{.+}}, [[SS_TY]]* %{{.+}})
297 // CHECK: [[A_PRIV:%.+]] = alloca i{{[0-9]+}},
298 // CHECK: [[B_PRIV:%.+]] = alloca i{{[0-9]+}},
299 // CHECK: [[C_PRIV:%.+]] = alloca i{{[0-9]+}},
300 // CHECK: store i{{[0-9]+}}* [[A_PRIV]], i{{[0-9]+}}** [[REFA:%.+]],
301 // CHECK: store i{{[0-9]+}}* [[C_PRIV]], i{{[0-9]+}}** [[REFC:%.+]],
302 // CHECK-NEXT: [[A_PRIV:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[REFA]],
303 // CHECK-NEXT: [[A_VAL:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[A_PRIV]],
304 // CHECK-NEXT: [[INC:%.+]] = add nsw i{{[0-9]+}} [[A_VAL]], 1
305 // CHECK-NEXT: store i{{[0-9]+}} [[INC]], i{{[0-9]+}}* [[A_PRIV]],
306 // CHECK-NEXT: [[B_VAL:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[B_PRIV]],
307 // CHECK-NEXT: [[DEC:%.+]] = add nsw i{{[0-9]+}} [[B_VAL]], -1
308 // CHECK-NEXT: store i{{[0-9]+}} [[DEC]], i{{[0-9]+}}* [[B_PRIV]],
309 // CHECK-NEXT: [[C_PRIV:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[REFC]],
310 // CHECK-NEXT: [[C_VAL:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[C_PRIV]],
311 // CHECK-NEXT: [[DIV:%.+]] = sdiv i{{[0-9]+}} [[C_VAL]], 1
312 // CHECK-NEXT: store i{{[0-9]+}} [[DIV]], i{{[0-9]+}}* [[C_PRIV]],
313 // CHECK-NEXT: ret void
314
315 // CHECK: define internal void [[TMAIN_MICROTASK]](i{{[0-9]+}}* noalias [[GTID_ADDR:%.+]], i{{[0-9]+}}* noalias %{{.+}})
316 // CHECK: [[T_VAR_PRIV:%.+]] = alloca i{{[0-9]+}}, align 128
317 // CHECK: [[VEC_PRIV:%.+]] = alloca [2 x i{{[0-9]+}}], align 128
318 // CHECK: [[S_ARR_PRIV:%.+]] = alloca [2 x [[S_INT_TY]]], align 128
319 // CHECK: [[VAR_PRIV:%.+]] = alloca [[S_INT_TY]], align 128
320 // CHECK: store i{{[0-9]+}}* [[GTID_ADDR]], i{{[0-9]+}}** [[GTID_ADDR_REF:%.+]]
321 // CHECK-NOT: [[T_VAR_PRIV]]
322 // CHECK-NOT: [[VEC_PRIV]]
323 // CHECK-NOT: [[SIVAR_PRIV]]
324 // CHECK: {{.+}}:
325 // CHECK: [[S_ARR_PRIV_ITEM:%.+]] = phi [[S_INT_TY]]*
326 // CHECK: call {{.*}} [[S_INT_TY_DEF_CONSTR]]([[S_INT_TY]]* [[S_ARR_PRIV_ITEM]])
327 // CHECK-NOT: [[T_VAR_PRIV]]
328 // CHECK-NOT: [[VEC_PRIV]]
329 // CHECK: call {{.*}} [[S_INT_TY_DEF_CONSTR]]([[S_INT_TY]]* [[VAR_PRIV]])
330 // CHECK-DAG: call void [[S_INT_TY_DESTR]]([[S_INT_TY]]* [[VAR_PRIV]])
331 // CHECK-DAG: call void [[S_INT_TY_DESTR]]([[S_INT_TY]]*
332 // CHECK: ret void
333
334 // CHECK: define {{.+}} @{{.+}}([[SST_TY]]* %
335 // CHECK: store i{{[0-9]+}} 0, i{{[0-9]+}}* %
336 // CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 1, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, [[SST_TY]]*)* [[SST_MICROTASK:@.+]] to void
337 // CHECK: ret
338
339 // CHECK: define internal void [[SST_MICROTASK]](i{{[0-9]+}}* noalias [[GTID_ADDR:%.+]], i{{[0-9]+}}* noalias %{{.+}}, [[SST_TY]]* %{{.+}})
340 // CHECK: [[A_PRIV:%.+]] = alloca i{{[0-9]+}},
341 // CHECK: store i{{[0-9]+}}* [[A_PRIV]], i{{[0-9]+}}** [[REF:%.+]],
342 // CHECK-NEXT: [[A_PRIV:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[REF]],
343 // CHECK-NEXT: [[A_VAL:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[A_PRIV]],
344 // CHECK-NEXT: [[INC:%.+]] = add nsw i{{[0-9]+}} [[A_VAL]], 1
345 // CHECK-NEXT: store i{{[0-9]+}} [[INC]], i{{[0-9]+}}* [[A_PRIV]],
346 // CHECK-NEXT: ret void
347
348 #endif
349
350