1 // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck %s 2 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s 3 // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -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 x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s 5 // RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -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 11 struct St { 12 int a, b; 13 St() : a(0), b(0) {} 14 St(const St &st) : a(st.a + st.b), b(0) {} 15 ~St() {} 16 }; 17 18 volatile int g = 1212; 19 20 template <class T> 21 struct S { 22 T f; 23 S(T a) : f(a + g) {} 24 S() : f(g) {} 25 S(const S &s, St t = St()) : f(s.f + t.a) {} 26 operator T() { return T(); } 27 ~S() {} 28 }; 29 30 // CHECK-DAG: [[S_FLOAT_TY:%.+]] = type { float } 31 // CHECK-DAG: [[S_INT_TY:%.+]] = type { i{{[0-9]+}} } 32 // CHECK-DAG: [[ST_TY:%.+]] = type { i{{[0-9]+}}, i{{[0-9]+}} } 33 34 template <typename T> 35 T tmain() { 36 S<T> test; 37 T t_var = T(); 38 T vec[] = {1, 2}; 39 S<T> s_arr[] = {1, 2}; 40 S<T> var(3); 41 #pragma omp parallel 42 #pragma omp sections firstprivate(t_var, vec, s_arr, var) 43 { 44 vec[0] = t_var; 45 #pragma omp section 46 s_arr[0] = var; 47 } 48 return T(); 49 } 50 51 // CHECK: [[TEST:@.+]] = global [[S_FLOAT_TY]] zeroinitializer, 52 S<float> test; 53 // CHECK-DAG: [[T_VAR:@.+]] = global i{{[0-9]+}} 333, 54 int t_var = 333; 55 // CHECK-DAG: [[VEC:@.+]] = global [2 x i{{[0-9]+}}] [i{{[0-9]+}} 1, i{{[0-9]+}} 2], 56 int vec[] = {1, 2}; 57 // CHECK-DAG: [[S_ARR:@.+]] = global [2 x [[S_FLOAT_TY]]] zeroinitializer, 58 S<float> s_arr[] = {1, 2}; 59 // CHECK-DAG: [[VAR:@.+]] = global [[S_FLOAT_TY]] zeroinitializer, 60 S<float> var(3); 61 // CHECK-DAG: [[SIVAR:@.+]] = internal global i{{[0-9]+}} 0, 62 // CHECK-DAG: [[IMPLICIT_BARRIER_LOC:@.+]] = private unnamed_addr constant %{{.+}} { i32 0, i32 66, i32 0, i32 0, i8* 63 // CHECK-DAG: [[SECTIONS_BARRIER_LOC:@.+]] = private unnamed_addr constant %{{.+}} { i32 0, i32 194, i32 0, i32 0, i8* 64 65 // CHECK: call {{.*}} [[S_FLOAT_TY_DEF_CONSTR:@.+]]([[S_FLOAT_TY]]* [[TEST]]) 66 // CHECK: ([[S_FLOAT_TY]]*)* [[S_FLOAT_TY_DESTR:@[^ ]+]] {{[^,]+}}, {{.+}}([[S_FLOAT_TY]]* [[TEST]] 67 int main() { 68 static int sivar; 69 #ifdef LAMBDA 70 // LAMBDA: [[G:@.+]] = global i{{[0-9]+}} 1212, 71 // LAMBDA-LABEL: @main 72 // LAMBDA: call void [[OUTER_LAMBDA:@.+]]( 73 [&]() { 74 // LAMBDA: define{{.*}} internal{{.*}} void [[OUTER_LAMBDA]]( 75 // LAMBDA: call void {{.+}} @__kmpc_fork_call({{.+}}, i32 1, {{.+}}* [[OMP_REGION:@.+]] to {{.+}}) 76 #pragma omp parallel 77 #pragma omp sections firstprivate(g, sivar) 78 { 79 // LAMBDA: define{{.*}} internal{{.*}} void [[OMP_REGION]](i32* noalias %{{.+}}, i32* noalias %{{.+}}, i32* dereferenceable(4) [[SIVAR_REF:%.+]]) 80 // Skip temp vars for loop 81 // LAMBDA: alloca i{{[0-9]+}}, 82 // LAMBDA: alloca i{{[0-9]+}}, 83 // LAMBDA: alloca i{{[0-9]+}}, 84 // LAMBDA: alloca i{{[0-9]+}}, 85 // LAMBDA: alloca i{{[0-9]+}}, 86 87 // LAMBDA: [[G_PRIVATE_ADDR:%.+]] = alloca i{{[0-9]+}}, 88 // LAMBDA: [[SIVAR1_PRIVATE_ADDR:%.+]] = alloca i{{[0-9]+}}, 89 // LAMBDA: store i{{[0-9]+}}* [[SIVAR_REF]], i{{[0-9]+}}** [[SIVAR_REF_ADDR:%.+]], 90 // LAMBDA: [[SIVAR1_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[SIVAR_REF_ADDR]], 91 // LAMBDA: [[G_VAL:%.+]] = load volatile i{{[0-9]+}}, i{{[0-9]+}}* [[G]] 92 // LAMBDA: store i{{[0-9]+}} [[G_VAL]], i{{[0-9]+}}* [[G_PRIVATE_ADDR]] 93 94 // LAMBDA: [[SIVAR1_VAL:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[SIVAR1_REF]] 95 // LAMBDA: store i{{[0-9]+}} [[SIVAR1_VAL]], i{{[0-9]+}}* [[SIVAR1_PRIVATE_ADDR]] 96 97 // LAMBDA: call void @__kmpc_barrier( 98 { 99 g = 1; 100 sivar = 10; 101 } 102 // LAMBDA: call void @__kmpc_for_static_init_4( 103 // LAMBDA: store i{{[0-9]+}} 1, i{{[0-9]+}}* [[G_PRIVATE_ADDR]], 104 // LAMBDA: store i{{[0-9]+}} 10, i{{[0-9]+}}* [[SIVAR1_PRIVATE_ADDR]], 105 // LAMBDA: [[G_PRIVATE_ADDR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 106 // LAMBDA: store i{{[0-9]+}}* [[G_PRIVATE_ADDR]], i{{[0-9]+}}** [[G_PRIVATE_ADDR_REF]] 107 // LAMBDA: [[SIVAR_PRIVATE_ADDR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 108 // LAMBDA: store i{{[0-9]+}}* [[SIVAR1_PRIVATE_ADDR]], i{{[0-9]+}}** [[SIVAR_PRIVATE_ADDR_REF]] 109 // LAMBDA: call void [[INNER_LAMBDA:@.+]](%{{.+}}* [[ARG]]) 110 // LAMBDA: call void @__kmpc_for_static_fini( 111 // LAMBDA: call void @__kmpc_barrier( 112 #pragma omp section 113 [&]() { 114 // LAMBDA: define {{.+}} void [[INNER_LAMBDA]](%{{.+}}* [[ARG_PTR:%.+]]) 115 // LAMBDA: store %{{.+}}* [[ARG_PTR]], %{{.+}}** [[ARG_PTR_REF:%.+]], 116 g = 2; 117 sivar = 20; 118 // LAMBDA: [[ARG_PTR:%.+]] = load %{{.+}}*, %{{.+}}** [[ARG_PTR_REF]] 119 // LAMBDA: [[G_PTR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG_PTR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 120 // LAMBDA: [[G_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[G_PTR_REF]] 121 // LAMBDA: store i{{[0-9]+}} 2, i{{[0-9]+}}* [[G_REF]] 122 // LAMBDA: [[SIVAR_PTR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG_PTR]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 123 // LAMBDA: [[SIVAR_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[SIVAR_PTR_REF]] 124 // LAMBDA: store i{{[0-9]+}} 20, i{{[0-9]+}}* [[SIVAR_REF]] 125 }(); 126 } 127 }(); 128 return 0; 129 #elif defined(BLOCKS) 130 // BLOCKS: [[G:@.+]] = global i{{[0-9]+}} 1212, 131 // BLOCKS-LABEL: @main 132 // BLOCKS: call void {{%.+}}(i8 133 ^{ 134 // BLOCKS: define{{.*}} internal{{.*}} void {{.+}}(i8* 135 // BLOCKS: call void {{.+}} @__kmpc_fork_call({{.+}}, i32 1, {{.+}}* [[OMP_REGION:@.+]] to {{.+}}) 136 #pragma omp parallel 137 #pragma omp sections firstprivate(g, sivar) 138 { 139 // BLOCKS: define{{.*}} internal{{.*}} void [[OMP_REGION]](i32* noalias %{{.+}}, i32* noalias %{{.+}}, i32* dereferenceable(4) [[SIVAR_REF:%.+]]) 140 // Skip temp vars for loop 141 // BLOCKS: alloca i{{[0-9]+}}, 142 // BLOCKS: alloca i{{[0-9]+}}, 143 // BLOCKS: alloca i{{[0-9]+}}, 144 // BLOCKS: alloca i{{[0-9]+}}, 145 // BLOCKS: alloca i{{[0-9]+}}, 146 // BLOCKS: [[G_PRIVATE_ADDR:%.+]] = alloca i{{[0-9]+}}, 147 // BLOCKS: [[SIVAR1_PRIVATE_ADDR:%.+]] = alloca i{{[0-9]+}}, 148 149 // BLOCKS: store i{{[0-9]+}}* [[SIVAR_REF]], i{{[0-9]+}}** {{.+}}, 150 // BLOCKS: [[SIVAR1_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** {{.+}}, 151 152 // BLOCKS: [[G_VAL:%.+]] = load volatile i{{[0-9]+}}, i{{[0-9]+}}* [[G]] 153 // BLOCKS: store i{{[0-9]+}} [[G_VAL]], i{{[0-9]+}}* [[G_PRIVATE_ADDR]] 154 155 // BLOCKS: [[SIVAR1_VAL:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[SIVAR1_REF]], 156 // BLOCKS: store i{{[0-9]+}} [[SIVAR1_VAL]], i{{[0-9]+}}* [[SIVAR1_PRIVATE_ADDR]], 157 // BLOCKS: call void @__kmpc_barrier( 158 { 159 g = 1; 160 sivar = 10; 161 } 162 // BLOCKS: call void @__kmpc_for_static_init_4( 163 // BLOCKS: store i{{[0-9]+}} 1, i{{[0-9]+}}* [[G_PRIVATE_ADDR]], 164 // BLOCKS: store i{{[0-9]+}} 10, i{{[0-9]+}}* [[SIVAR1_PRIVATE_ADDR]], 165 // BLOCKS-NOT: [[G]]{{[[^:word:]]}} 166 // BLOCKS: i{{[0-9]+}}* [[G_PRIVATE_ADDR]] 167 // BLOCKS-NOT: [[G]]{{[[^:word:]]}} 168 // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}} 169 // BLOCKS: i{{[0-9]+}}* [[SIVAR1_PRIVATE_ADDR]] 170 // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}} 171 // BLOCKS: call void {{%.+}}(i8 172 // BLOCKS: call void @__kmpc_for_static_fini( 173 // BLOCKS: call void @__kmpc_barrier( 174 #pragma omp section 175 ^{ 176 // BLOCKS: define {{.+}} void {{@.+}}(i8* 177 g = 2; 178 sivar = 20; 179 // BLOCKS-NOT: [[G]]{{[[^:word:]]}} 180 // BLOCKS: store i{{[0-9]+}} 2, i{{[0-9]+}}* 181 // BLOCKS-NOT: [[G]]{{[[^:word:]]}} 182 // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}} 183 // BLOCKS: store i{{[0-9]+}} 20, i{{[0-9]+}}* 184 // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}} 185 // BLOCKS: ret 186 }(); 187 } 188 }(); 189 return 0; 190 #else 191 #pragma omp sections firstprivate(t_var, vec, s_arr, var, sivar) nowait 192 { 193 { 194 vec[0] = t_var; 195 s_arr[0] = var; 196 sivar = 31; 197 } 198 } 199 return tmain<int>(); 200 #endif 201 } 202 203 // CHECK: define {{.*}}i{{[0-9]+}} @main() 204 // CHECK: alloca i{{[0-9]+}}, 205 // CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num( 206 // CHECK: [[T_VAR_PRIV:%.+]] = alloca i{{[0-9]+}}, 207 // CHECK: [[VEC_PRIV:%.+]] = alloca [2 x i{{[0-9]+}}], 208 // CHECK: [[S_ARR_PRIV:%.+]] = alloca [2 x [[S_FLOAT_TY]]], 209 // CHECK: [[VAR_PRIV:%.+]] = alloca [[S_FLOAT_TY]], 210 // CHECK: [[SIVAR_PRIV:%.+]] = alloca i{{[0-9]+}}, 211 212 // CHECK: call i32 @__kmpc_single( 213 // firstprivate t_var(t_var) 214 // CHECK: [[T_VAR_VAL:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[T_VAR]], 215 // CHECK: store i{{[0-9]+}} [[T_VAR_VAL]], i{{[0-9]+}}* [[T_VAR_PRIV]], 216 // firstprivate vec(vec) 217 // CHECK: [[VEC_DEST:%.+]] = bitcast [2 x i{{[0-9]+}}]* [[VEC_PRIV]] to i8* 218 // CHECK: call void @llvm.memcpy.{{.+}}(i8* [[VEC_DEST]], i8* bitcast ([2 x i{{[0-9]+}}]* [[VEC]] to i8*), 219 220 // firstprivate s_arr(s_arr) 221 // CHECK: [[S_ARR_PRIV_BEGIN:%.+]] = getelementptr inbounds [2 x [[S_FLOAT_TY]]], [2 x [[S_FLOAT_TY]]]* [[S_ARR_PRIV]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 222 // CHECK: [[S_ARR_PRIV_END:%.+]] = getelementptr [[S_FLOAT_TY]], [[S_FLOAT_TY]]* [[S_ARR_PRIV_BEGIN]], i{{[0-9]+}} 2 223 // CHECK: [[IS_EMPTY:%.+]] = icmp eq [[S_FLOAT_TY]]* [[S_ARR_PRIV_BEGIN]], [[S_ARR_PRIV_END]] 224 // CHECK: br i1 [[IS_EMPTY]], label %[[S_ARR_BODY_DONE:.+]], label %[[S_ARR_BODY:.+]] 225 // CHECK: [[S_ARR_BODY]] 226 // CHECK: getelementptr inbounds ([2 x [[S_FLOAT_TY]]], [2 x [[S_FLOAT_TY]]]* [[S_ARR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0) 227 // CHECK: call {{.*}} [[ST_TY_DEFAULT_CONSTR:@.+]]([[ST_TY]]* [[ST_TY_TEMP:%.+]]) 228 // CHECK: call {{.*}} [[S_FLOAT_TY_COPY_CONSTR:@.+]]([[S_FLOAT_TY]]* {{.+}}, [[S_FLOAT_TY]]* {{.+}}, [[ST_TY]]* [[ST_TY_TEMP]]) 229 // CHECK: call {{.*}} [[ST_TY_DESTR:@.+]]([[ST_TY]]* [[ST_TY_TEMP]]) 230 // CHECK: br i1 {{.+}}, label %{{.+}}, label %[[S_ARR_BODY]] 231 232 // firstprivate var(var) 233 // CHECK: call {{.*}} [[ST_TY_DEFAULT_CONSTR]]([[ST_TY]]* [[ST_TY_TEMP:%.+]]) 234 // CHECK: call {{.*}} [[S_FLOAT_TY_COPY_CONSTR]]([[S_FLOAT_TY]]* [[VAR_PRIV]], [[S_FLOAT_TY]]* {{.*}} [[VAR]], [[ST_TY]]* [[ST_TY_TEMP]]) 235 // CHECK: call {{.*}} [[ST_TY_DESTR]]([[ST_TY]]* [[ST_TY_TEMP]]) 236 237 // firstprivate isvar 238 // CHEC: [[SIVAR_VAL:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[SIVAR]], 239 // CHEC: store i{{[0-9]+}} [[SIVAR_VAL]], i{{[0-9]+}}* [[SIVAR_PRIV]], 240 241 // ~(firstprivate var), ~(firstprivate s_arr) 242 // CHECK-DAG: call {{.*}} [[S_FLOAT_TY_DESTR]]([[S_FLOAT_TY]]* [[VAR_PRIV]]) 243 // CHECK-DAG: call {{.*}} [[S_FLOAT_TY_DESTR]]([[S_FLOAT_TY]]* 244 // CHECK: call void @__kmpc_end_single( 245 246 // CHECK: call void @__kmpc_barrier(%{{.+}}* [[IMPLICIT_BARRIER_LOC]], i{{[0-9]+}} [[GTID]]) 247 248 // CHECK: = call {{.*}}i{{.+}} [[TMAIN_INT:@.+]]() 249 250 // CHECK: ret void 251 252 // CHECK: define {{.*}} i{{[0-9]+}} [[TMAIN_INT]]() 253 // CHECK: [[TEST:%.+]] = alloca [[S_INT_TY]], 254 // CHECK: call {{.*}} [[S_INT_TY_DEF_CONSTR:@.+]]([[S_INT_TY]]* [[TEST]]) 255 // CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 4, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, i32*, [2 x i32]*, [2 x [[S_INT_TY]]]*, [[S_INT_TY]]*)* [[TMAIN_MICROTASK:@.+]] to void 256 // CHECK: call {{.*}} [[S_INT_TY_DESTR:@.+]]([[S_INT_TY]]* 257 // CHECK: ret 258 // 259 // CHECK: define internal void [[TMAIN_MICROTASK]](i{{[0-9]+}}* noalias [[GTID_ADDR:%.+]], i{{[0-9]+}}* noalias %{{.+}}, 260 // Skip temp vars for loop 261 // CHECK: alloca i{{[0-9]+}}, 262 // CHECK: alloca i{{[0-9]+}}, 263 // CHECK: alloca i{{[0-9]+}}, 264 // CHECK: alloca i{{[0-9]+}}, 265 // CHECK: alloca i{{[0-9]+}}, 266 // CHECK: [[T_VAR_PRIV:%.+]] = alloca i{{[0-9]+}}, 267 // CHECK: [[VEC_PRIV:%.+]] = alloca [2 x i{{[0-9]+}}], 268 // CHECK: [[S_ARR_PRIV:%.+]] = alloca [2 x [[S_INT_TY]]], 269 // CHECK: [[VAR_PRIV:%.+]] = alloca [[S_INT_TY]], 270 // CHECK: store i{{[0-9]+}}* [[GTID_ADDR]], i{{[0-9]+}}** [[GTID_ADDR_ADDR:%.+]], 271 272 // CHECK: [[T_VAR_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** % 273 // CHECK: [[VEC_REF:%.+]] = load [2 x i{{[0-9]+}}]*, [2 x i{{[0-9]+}}]** % 274 // CHECK: [[S_ARR:%.+]] = load [2 x [[S_INT_TY]]]*, [2 x [[S_INT_TY]]]** % 275 // CHECK: [[VAR_REF:%.+]] = load [[S_INT_TY]]*, [[S_INT_TY]]** % 276 277 // firstprivate t_var(t_var) 278 // CHECK: [[T_VAR_VAL:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[T_VAR_REF]], 279 // CHECK: store i{{[0-9]+}} [[T_VAR_VAL]], i{{[0-9]+}}* [[T_VAR_PRIV]], 280 281 // firstprivate vec(vec) 282 // CHECK: [[VEC_DEST:%.+]] = bitcast [2 x i{{[0-9]+}}]* [[VEC_PRIV]] to i8* 283 // CHECK: [[VEC_SRC:%.+]] = bitcast [2 x i{{[0-9]+}}]* [[VEC_REF]] to i8* 284 // CHECK: call void @llvm.memcpy.{{.+}}(i8* [[VEC_DEST]], i8* [[VEC_SRC]], 285 286 // firstprivate s_arr(s_arr) 287 // CHECK: [[S_ARR_PRIV_BEGIN:%.+]] = getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[S_ARR_PRIV]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 288 // CHECK: [[S_ARR_PRIV_END:%.+]] = getelementptr [[S_INT_TY]], [[S_INT_TY]]* [[S_ARR_PRIV_BEGIN]], i{{[0-9]+}} 2 289 // CHECK: [[IS_EMPTY:%.+]] = icmp eq [[S_INT_TY]]* [[S_ARR_PRIV_BEGIN]], [[S_ARR_PRIV_END]] 290 // CHECK: br i1 [[IS_EMPTY]], label %[[S_ARR_BODY_DONE:.+]], label %[[S_ARR_BODY:.+]] 291 // CHECK: [[S_ARR_BODY]] 292 // CHECK: call {{.*}} [[ST_TY_DEFAULT_CONSTR:@.+]]([[ST_TY]]* [[ST_TY_TEMP:%.+]]) 293 // CHECK: call {{.*}} [[S_INT_TY_COPY_CONSTR:@.+]]([[S_INT_TY]]* {{.+}}, [[S_INT_TY]]* {{.+}}, [[ST_TY]]* [[ST_TY_TEMP]]) 294 // CHECK: call {{.*}} [[ST_TY_DESTR:@.+]]([[ST_TY]]* [[ST_TY_TEMP]]) 295 // CHECK: br i1 {{.+}}, label %{{.+}}, label %[[S_ARR_BODY]] 296 297 // firstprivate var(var) 298 // CHECK: call {{.*}} [[ST_TY_DEFAULT_CONSTR]]([[ST_TY]]* [[ST_TY_TEMP:%.+]]) 299 // CHECK: call {{.*}} [[S_INT_TY_COPY_CONSTR]]([[S_INT_TY]]* [[VAR_PRIV]], [[S_INT_TY]]* {{.*}} [[VAR_REF]], [[ST_TY]]* [[ST_TY_TEMP]]) 300 // CHECK: call {{.*}} [[ST_TY_DESTR]]([[ST_TY]]* [[ST_TY_TEMP]]) 301 302 // Synchronization for initialization. 303 // CHECK: [[GTID_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[GTID_ADDR_ADDR]] 304 // CHECK: [[GTID:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[GTID_REF]] 305 // CHECK: call void @__kmpc_barrier(%{{.+}}* [[IMPLICIT_BARRIER_LOC]], i{{[0-9]+}} [[GTID]]) 306 307 // CHECK: call void @__kmpc_for_static_init_4( 308 // CHECK: call void @__kmpc_for_static_fini( 309 310 // ~(firstprivate var), ~(firstprivate s_arr) 311 // CHECK-DAG: call {{.*}} [[S_INT_TY_DESTR]]([[S_INT_TY]]* [[VAR_PRIV]]) 312 // CHECK-DAG: call {{.*}} [[S_INT_TY_DESTR]]([[S_INT_TY]]* 313 // CHECK: [[GTID_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[GTID_ADDR_ADDR]] 314 // CHECK: [[GTID:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[GTID_REF]] 315 // CHECK: call void @__kmpc_barrier(%{{.+}}* [[SECTIONS_BARRIER_LOC]], i{{[0-9]+}} [[GTID]]) 316 // CHECK: ret void 317 #endif 318 319