1 // RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
2 // RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
3 // RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
4 // RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
5 // RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
6 // RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
7
8 // RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
9 // RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
10 // RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
11 // RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
12 // RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
13 // RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
14 // SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
15
16 // RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
17 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
18 // RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
19 // RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
20 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
21 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
22
23 // RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY1 %s
24 // RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
25 // RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY1 %s
26 // RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY1 %s
27 // RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
28 // RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY1 %s
29 // SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
30 // expected-no-diagnostics
31 #ifndef HEADER
32 #define HEADER
33
34 template <class T>
35 struct S {
36 T f;
SS37 S(T a) : f(a) {}
SS38 S() : f() {}
operator TS39 operator T() { return T(); }
~SS40 ~S() {}
41 };
42
43 // CHECK: [[S_FLOAT_TY:%.+]] = type { float }
44 // CHECK: [[S_INT_TY:%.+]] = type { i{{[0-9]+}} }
45 template <typename T>
tmain()46 T tmain() {
47 S<T> test;
48 T t_var = T();
49 T vec[] = {1, 2};
50 S<T> s_arr[] = {1, 2};
51 S<T> &var = test;
52 #pragma omp target
53 #pragma omp teams
54 #pragma omp distribute parallel for private(t_var, vec, s_arr, s_arr, var, var)
55 for (int i = 0; i < 2; ++i) {
56 vec[i] = t_var;
57 s_arr[i] = var;
58 }
59 return T();
60 }
61
main()62 int main() {
63 static int svar;
64 volatile double g;
65 volatile double &g1 = g;
66
67 #ifdef LAMBDA
68 // LAMBDA-LABEL: @main
69 // LAMBDA: call{{.*}} void [[OUTER_LAMBDA:@.+]](
70 [&]() {
71 static float sfvar;
72 // LAMBDA: define{{.*}} internal{{.*}} void [[OUTER_LAMBDA]](
73 // LAMBDA: call i{{[0-9]+}} @__tgt_target_teams_mapper(%struct.ident_t* @{{.+}},
74 // LAMBDA: call void [[OFFLOADING_FUN:@.+]](
75
76 // LAMBDA: define{{.+}} void [[OFFLOADING_FUN]]()
77 // LAMBDA: call {{.*}}void {{.+}} @__kmpc_fork_teams({{.+}}, i32 0, {{.+}}* [[OMP_OUTLINED:@.+]] to {{.+}})
78 #pragma omp target
79 #pragma omp teams
80 #pragma omp distribute parallel for private(g, g1, svar, sfvar)
81 for (int i = 0; i < 2; ++i) {
82 // LAMBDA: define{{.*}} internal{{.*}} void [[OMP_OUTLINED]](i32* noalias %{{.+}}, i32* noalias %{{.+}})
83 // LAMBDA: [[G_PRIVATE_ADDR:%.+]] = alloca double,
84 // LAMBDA: [[G1_PRIVATE_ADDR:%.+]] = alloca double,
85 // LAMBDA: [[TMP_PRIVATE_ADDR:%.+]] = alloca double*,
86 // LAMBDA: [[SVAR_PRIVATE_ADDR:%.+]] = alloca i{{[0-9]+}},
87 // LAMBDA: [[SFVAR_PRIVATE_ADDR:%.+]] = alloca float,
88 // LAMBDA: store double* [[G1_PRIVATE_ADDR]], double** [[TMP_PRIVATE_ADDR]],
89 // LAMBDA: call {{.*}}void @__kmpc_for_static_init_4(
90 // LAMBDA: call{{.+}} @__kmpc_fork_call({{.+}}, {{.+}}, {{.+}}[[OMP_PARFOR_OUTLINED:@.+]] to {{.+}},
91 // LAMBDA: call {{.*}}void @__kmpc_for_static_fini(
92 // LAMBDA: ret void
93
94 // LAMBDA: define{{.+}} void [[OMP_PARFOR_OUTLINED]](
95 // LAMBDA: [[G_PRIVATE_ADDR:%.+]] = alloca double,
96 // LAMBDA: [[G1_PRIVATE_ADDR:%.+]] = alloca double,
97 // LAMBDA: [[TMP_PRIVATE_ADDR:%.+]] = alloca double*,
98 // LAMBDA: [[SVAR_PRIVATE_ADDR:%.+]] = alloca i{{[0-9]+}},
99 // LAMBDA: [[SFVAR_PRIVATE_ADDR:%.+]] = alloca float,
100
101 g = 1;
102 g1 = 1;
103 svar = 3;
104 sfvar = 4.0;
105 // LAMBDA: store double* [[G1_PRIVATE_ADDR]], double** [[TMP_PRIVATE_ADDR]],
106 // LAMBDA: store double 1.0{{.+}}, double* [[G_PRIVATE_ADDR]],
107 // LAMBDA: store i{{[0-9]+}} 3, i{{[0-9]+}}* [[SVAR_PRIVATE_ADDR]],
108 // LAMBDA: store float 4.0{{.+}}, float* [[SFVAR_PRIVATE_ADDR]],
109 // LAMBDA: [[G_PRIVATE_ADDR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
110 // LAMBDA: store double* [[G_PRIVATE_ADDR]], double** [[G_PRIVATE_ADDR_REF]],
111 // LAMBDA: [[TMP_PRIVATE_ADDR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
112 // LAMBDA: [[G1_PRIVATE_ADDR_FROM_TMP:%.+]] = load double*, double** [[TMP_PRIVATE_ADDR]],
113 // LAMBDA: store double* [[G1_PRIVATE_ADDR_FROM_TMP]], double** [[TMP_PRIVATE_ADDR_REF]],
114 // LAMBDA: [[SVAR_PRIVATE_ADDR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
115 // LAMBDA: store i{{[0-9]+}}* [[SVAR_PRIVATE_ADDR]], i{{[0-9]+}}** [[SVAR_PRIVATE_ADDR_REF]]
116 // LAMBDA: [[SFVAR_PRIVATE_ADDR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 3
117 // LAMBDA: store float* [[SFVAR_PRIVATE_ADDR]], float** [[SFVAR_PRIVATE_ADDR_REF]]
118 // LAMBDA: call{{.*}} void [[INNER_LAMBDA:@.+]](%{{.+}}* {{[^,]*}} [[ARG]])
119 // LAMBDA: call {{.*}}void @__kmpc_for_static_fini(
120 // LAMBDA: ret void
121 [&]() {
122 // LAMBDA: define {{.+}} void [[INNER_LAMBDA]](%{{.+}}* {{[^,]*}} [[ARG_PTR:%.+]])
123 // LAMBDA: store %{{.+}}* [[ARG_PTR]], %{{.+}}** [[ARG_PTR_REF:%.+]],
124 g = 2;
125 g1 = 2;
126 svar = 4;
127 sfvar = 8.0;
128 // LAMBDA: [[ARG_PTR:%.+]] = load %{{.+}}*, %{{.+}}** [[ARG_PTR_REF]]
129 // LAMBDA: [[G_PTR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG_PTR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
130 // LAMBDA: [[G_REF:%.+]] = load double*, double** [[G_PTR_REF]]
131 // LAMBDA: store double 2.0{{.+}}, double* [[G_REF]]
132
133 // LAMBDA: [[TMP_PTR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG_PTR]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
134 // LAMBDA: [[G1_REF:%.+]] = load double*, double** [[TMP_PTR_REF]]
135 // LAMBDA: store double 2.0{{.+}}, double* [[G1_REF]],
136 // LAMBDA: [[SVAR_PTR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG_PTR]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
137 // LAMBDA: [[SVAR_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[SVAR_PTR_REF]]
138 // LAMBDA: store i{{[0-9]+}} 4, i{{[0-9]+}}* [[SVAR_REF]]
139 // LAMBDA: [[SFVAR_PTR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG_PTR]], i{{[0-9]+}} 0, i{{[0-9]+}} 3
140 // LAMBDA: [[SFVAR_REF:%.+]] = load float*, float** [[SFVAR_PTR_REF]]
141 // LAMBDA: store float 8.0{{.+}}, float* [[SFVAR_REF]]
142 }();
143 }
144 }();
145 return 0;
146 #else
147 S<float> test;
148 int t_var = 0;
149 int vec[] = {1, 2};
150 S<float> s_arr[] = {1, 2};
151 S<float> &var = test;
152
153 #pragma omp target
154 #pragma omp teams
155 #pragma omp distribute parallel for private(t_var, vec, s_arr, s_arr, var, var, svar)
156 for (int i = 0; i < 2; ++i) {
157 vec[i] = t_var;
158 s_arr[i] = var;
159 }
160 return tmain<int>();
161 #endif
162 }
163
164 // CHECK: define{{.*}} i{{[0-9]+}} @main()
165 // CHECK: [[TEST:%.+]] = alloca [[S_FLOAT_TY]],
166 // CHECK: call {{.*}} [[S_FLOAT_TY_DEF_CONSTR:@.+]]([[S_FLOAT_TY]]* {{[^,]*}} [[TEST]])
167 // CHECK: call i{{[0-9]+}} @__tgt_target_teams_mapper(%struct.ident_t* @{{.+}},
168 // CHECK: call void [[OFFLOAD_FUN_0:@.+]](
169
170 // CHECK: call {{.*}} [[S_FLOAT_TY_DEF_DESTR:@.+]]([[S_FLOAT_TY]]* {{[^,]*}} [[TEST]])
171 // CHECK: ret
172
173 // CHECK: define{{.+}} [[OFFLOAD_FUN_0]]()
174 // CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_teams(%{{.+}}* @{{.+}}, i{{[0-9]+}} 0, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*)* [[OMP_OUTLINED_0:@.+]] to void
175 // CHECK: ret
176 //
177 // CHECK: define internal void [[OMP_OUTLINED_0]](i{{[0-9]+}}* noalias [[GTID_ADDR:%.+]], i{{[0-9]+}}* noalias %{{.+}})
178 // CHECK: [[T_VAR_PRIV:%.+]] = alloca i{{[0-9]+}},
179 // CHECK: [[VEC_PRIV:%.+]] = alloca [2 x i{{[0-9]+}}],
180 // CHECK: [[S_ARR_PRIV:%.+]] = alloca [2 x [[S_FLOAT_TY]]],
181 // CHECK-NOT: alloca [2 x [[S_FLOAT_TY]]],
182 // CHECK: [[VAR_PRIV:%.+]] = alloca [[S_FLOAT_TY]],
183 // CHECK-NOT: alloca [[S_FLOAT_TY]],
184 // CHECK: [[S_VAR_PRIV:%.+]] = alloca i{{[0-9]+}},
185 // CHECK: store i{{[0-9]+}}* [[GTID_ADDR]], i{{[0-9]+}}** [[GTID_ADDR_REF:%.+]]
186 // CHECK-NOT: [[T_VAR_PRIV]]
187 // CHECK-NOT: [[VEC_PRIV]]
188 // this is the ctor loop
189 // CHECK: {{.+}}:
190 // CHECK: [[S_ARR_PRIV_ITEM:%.+]] = phi [[S_FLOAT_TY]]*
191 // CHECK: call {{.*}} [[S_FLOAT_TY_DEF_CONSTR]]([[S_FLOAT_TY]]* {{[^,]*}} [[S_ARR_PRIV_ITEM]])
192 // CHECK-NOT: [[T_VAR_PRIV]]
193 // CHECK-NOT: [[VEC_PRIV]]
194 // CHECK: call {{.*}} [[S_FLOAT_TY_DEF_CONSTR]]([[S_FLOAT_TY]]* {{[^,]*}} [[VAR_PRIV]])
195 // CHECK: call void @__kmpc_for_static_init_4(
196 // CHECK: call{{.+}} @__kmpc_fork_call({{.+}}, {{.+}}, {{.+}}[[OMP_PARFOR_OUTLINED_0:@.+]] to {{.+}},
197 // CHECK: call void @__kmpc_for_static_fini(
198
199 // call destructors: var..
200 // CHECK-DAG: call {{.+}} [[S_FLOAT_TY_DEF_DESTR]]([[S_FLOAT_TY]]* {{[^,]*}} [[VAR_PRIV]])
201
202 // ..and s_arr
203 // CHECK: {{.+}}:
204 // CHECK: [[S_ARR_EL_PAST:%.+]] = phi [[S_FLOAT_TY]]*
205 // CHECK: [[S_ARR_PRIV_ITEM:%.+]] = getelementptr {{.+}}, {{.+}} [[S_ARR_EL_PAST]],
206 // CHECK: call {{.*}} [[S_FLOAT_TY_DEF_DESTR]]([[S_FLOAT_TY]]* {{[^,]*}} [[S_ARR_PRIV_ITEM]])
207
208 // CHECK: ret void
209
210 // By OpenMP specifications, private applies to both distribute and parallel for.
211 // However, the support for 'private' of 'parallel' is only used when 'parallel'
212 // is found alone. Therefore we only have one 'private' support for 'parallel for'
213 // in combination
214 // CHECK: define{{.+}} void [[OMP_PARFOR_OUTLINED_0]](
215 // CHECK: [[T_VAR_PRIV:%t_var+]] = alloca i{{[0-9]+}},
216 // CHECK: [[VEC_PRIV:%vec+]] = alloca [2 x i{{[0-9]+}}],
217 // CHECK: [[S_ARR_PRIV:%s_arr+]] = alloca [2 x [[S_FLOAT_TY]]],
218 // CHECK-NOT: alloca [2 x [[S_FLOAT_TY]]],
219 // CHECK: [[VAR_PRIV:%var+]] = alloca [[S_FLOAT_TY]],
220 // CHECK-NOT: alloca [[S_FLOAT_TY]],
221 // CHECK: [[S_VAR_PRIV:%svar+]] = alloca i{{[0-9]+}},
222 // CHECK: store i{{[0-9]+}}* [[GTID_ADDR]], i{{[0-9]+}}** [[GTID_ADDR_REF:%.+]]
223 // CHECK-NOT: [[T_VAR_PRIV]]
224 // CHECK-NOT: [[VEC_PRIV]]
225 // this is the ctor loop
226 // CHECK: {{.+}}:
227 // CHECK: [[S_ARR_PRIV_ITEM:%.+]] = phi [[S_FLOAT_TY]]*
228 // CHECK: call {{.*}} [[S_FLOAT_TY_DEF_CONSTR]]([[S_FLOAT_TY]]* {{[^,]*}} [[S_ARR_PRIV_ITEM]])
229 // CHECK-NOT: [[T_VAR_PRIV]]
230 // CHECK-NOT: [[VEC_PRIV]]
231 // CHECK: call {{.*}} [[S_FLOAT_TY_DEF_CONSTR]]([[S_FLOAT_TY]]* {{[^,]*}} [[VAR_PRIV]])
232 // CHECK: call void @__kmpc_for_static_init_4(
233 // CHECK: call void @__kmpc_for_static_fini(
234
235 // call destructors: var..
236 // CHECK-DAG: call {{.+}} [[S_FLOAT_TY_DEF_DESTR]]([[S_FLOAT_TY]]* {{[^,]*}} [[VAR_PRIV]])
237
238 // ..and s_arr
239 // CHECK: {{.+}}:
240 // CHECK: [[S_ARR_EL_PAST:%.+]] = phi [[S_FLOAT_TY]]*
241 // CHECK: [[S_ARR_PRIV_ITEM:%.+]] = getelementptr {{.+}}, {{.+}} [[S_ARR_EL_PAST]],
242 // CHECK: call {{.*}} [[S_FLOAT_TY_DEF_DESTR]]([[S_FLOAT_TY]]* {{[^,]*}} [[S_ARR_PRIV_ITEM]])
243
244 // CHECK: ret void
245
246 // template tmain with S_INT_TY
247 // CHECK: define{{.*}} i{{[0-9]+}} [[TMAIN_INT:@.+]]()
248 // CHECK: [[TEST:%.+]] = alloca [[S_INT_TY]],
249 // CHECK: call {{.*}} [[S_INT_TY_DEF_CONSTR:@.+]]([[S_INT_TY]]* {{[^,]*}} [[TEST]])
250 // CHECK: call i{{[0-9]+}} @__tgt_target_teams_mapper(%struct.ident_t* @{{.+}},
251 // CHECK: call void [[OFFLOAD_FUN_1:@.+]](
252 // CHECK: call {{.*}} [[S_INT_TY_DEF_DESTR:@.+]]([[S_INT_TY]]* {{[^,]*}} [[TEST]])
253 // CHECK: ret
254
255 // CHECK: ret
256
257 // CHECK: define internal void [[OFFLOAD_FUN_1]]()
258 // CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_teams(%{{.+}}* @{{.+}}, i{{[0-9]+}} 0, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*)* [[OMP_OUTLINED_1:@.+]] to void
259 // CHECK: ret
260 //
261 // CHECK: define internal void [[OMP_OUTLINED_1]](i{{[0-9]+}}* noalias [[GTID_ADDR:%.+]], i{{[0-9]+}}* noalias %{{.+}})
262 // CHECK: [[T_VAR_PRIV:%.+]] = alloca i{{[0-9]+}},
263 // CHECK: [[VEC_PRIV:%.+]] = alloca [2 x i{{[0-9]+}}],
264 // CHECK: [[S_ARR_PRIV:%.+]] = alloca [2 x [[S_INT_TY]]],
265 // CHECK-NOT: alloca [2 x [[S_INT_TY]]],
266 // CHECK: [[VAR_PRIV:%.+]] = alloca [[S_INT_TY]],
267 // CHECK-NOT: alloca [[S_INT_TY]],
268 // CHECK: store i{{[0-9]+}}* [[GTID_ADDR]], i{{[0-9]+}}** [[GTID_ADDR_REF:%.+]]
269 // CHECK-NOT: [[T_VAR_PRIV]]
270 // CHECK-NOT: [[VEC_PRIV]]
271 // CHECK: {{.+}}:
272 // CHECK: [[S_ARR_PRIV_ITEM:%.+]] = phi [[S_INT_TY]]*
273 // CHECK: call {{.*}} [[S_INT_TY_DEF_CONSTR]]([[S_INT_TY]]* {{[^,]*}} [[S_ARR_PRIV_ITEM]])
274 // CHECK-NOT: [[T_VAR_PRIV]]
275 // CHECK-NOT: [[VEC_PRIV]]
276 // CHECK: call {{.*}} [[S_INT_TY_DEF_CONSTR]]([[S_INT_TY]]* {{[^,]*}} [[VAR_PRIV]])
277 // CHECK: call void @__kmpc_for_static_init_4(
278 // CHECK: call{{.+}} @__kmpc_fork_call({{.+}}, {{.+}}, {{.+}}[[OMP_PARFOR_OUTLINED_1:@.+]] to {{.+}},
279 // CHECK: call void @__kmpc_for_static_fini(
280 // CHECK: ret void
281
282 // CHECK: define{{.+}} void [[OMP_PARFOR_OUTLINED_1]](
283 // CHECK: [[T_VAR_PRIV:%t_var+]] = alloca i{{[0-9]+}},
284 // CHECK: [[VEC_PRIV:%vec+]] = alloca [2 x i{{[0-9]+}}],
285 // CHECK: [[S_ARR_PRIV:%s_arr+]] = alloca [2 x [[S_INT_TY]]],
286 // CHECK-NOT: alloca [2 x [[S_INT_TY]]],
287 // CHECK: [[VAR_PRIV:%var+]] = alloca [[S_INT_TY]],
288 // CHECK-NOT: alloca [[S_INT_TY]],
289 // CHECK: store i{{[0-9]+}}* [[GTID_ADDR]], i{{[0-9]+}}** [[GTID_ADDR_REF:%.+]]
290 // CHECK-NOT: [[T_VAR_PRIV]]
291 // CHECK-NOT: [[VEC_PRIV]]
292 // this is the ctor loop
293 // CHECK: {{.+}}:
294 // CHECK: [[S_ARR_PRIV_ITEM:%.+]] = phi [[S_INT_TY]]*
295 // CHECK: call {{.*}} [[S_INT_TY_DEF_CONSTR]]([[S_INT_TY]]* {{[^,]*}} [[S_ARR_PRIV_ITEM]])
296 // CHECK-NOT: [[T_VAR_PRIV]]
297 // CHECK-NOT: [[VEC_PRIV]]
298 // CHECK: call {{.*}} [[S_INT_TY_DEF_CONSTR]]([[S_INT_TY]]* {{[^,]*}} [[VAR_PRIV]])
299 // CHECK: call void @__kmpc_for_static_init_4(
300 // CHECK: call void @__kmpc_for_static_fini(
301
302 // call destructors: var..
303 // CHECK-DAG: call {{.+}} [[S_INT_TY_DEF_DESTR]]([[S_INT_TY]]* {{[^,]*}} [[VAR_PRIV]])
304
305 // ..and s_arr
306 // CHECK: {{.+}}:
307 // CHECK: [[S_ARR_EL_PAST:%.+]] = phi [[S_INT_TY]]*
308 // CHECK: [[S_ARR_PRIV_ITEM:%.+]] = getelementptr {{.+}}, {{.+}} [[S_ARR_EL_PAST]],
309 // CHECK: call {{.*}} [[S_INT_TY_DEF_DESTR]]([[S_INT_TY]]* {{[^,]*}} [[S_ARR_PRIV_ITEM]])
310
311 // CHECK: ret void
312
313 #endif
314