|
5 | 5 | // RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp-simd -x c++ -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
|
6 | 6 | // RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -emit-pch -o %t %s
|
7 | 7 | // RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
|
| 8 | + |
8 | 9 | // SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
|
| 10 | + |
| 11 | +// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -fopenmp-version=60 -DOMP60 -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK6 |
| 12 | +// RUN: %clang_cc1 -fopenmp -fopenmp-version=60 -DOMP60 -x c++ -triple x86_64-apple-darwin10 -emit-pch -o %t %s |
| 13 | +// RUN: %clang_cc1 -fopenmp -fopenmp-version=60 -DOMP60 -x c++ -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK6 |
9 | 14 | // expected-no-diagnostics
|
10 | 15 | #ifndef HEADER
|
11 | 16 | #define HEADER
|
@@ -241,4 +246,52 @@ void taskloop_with_class() {
|
241 | 246 | }
|
242 | 247 | }
|
243 | 248 |
|
| 249 | +#ifdef OMP60 |
| 250 | +void test_threadset() |
| 251 | +{ |
| 252 | +#pragma omp taskloop threadset(omp_team) |
| 253 | + for (int i = 0; i < 10; ++i) { |
| 254 | + } |
| 255 | +#pragma omp taskloop threadset(omp_pool) |
| 256 | + for (int i = 0; i < 10; ++i) { |
| 257 | + } |
| 258 | +} |
| 259 | +#endif // OMP60 |
| 260 | +// CHECK6-LABEL: define void @_Z14test_threadsetv() |
| 261 | +// CHECK6-NEXT: entry: |
| 262 | +// CHECK6-NEXT: [[AGG_CAPTURED:%.*]] = alloca [[STRUCT_ANON_14:%.*]], align 1 |
| 263 | +// CHECK6-NEXT: %[[TMP:.*]] = alloca i32, align 4 |
| 264 | +// CHECK6-NEXT: [[AGG_CAPTURED1:%.*]] = alloca [[STRUCT_ANON_16:%.*]], align 1 |
| 265 | +// CHECK6-NEXT: %[[TMP2:.*]] = alloca i32, align 4 |
| 266 | +// CHECK6-NEXT: %[[TID0:.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB_PTR:[0-9]+]]) |
| 267 | +// CHECK6-NEXT: call void @__kmpc_taskgroup(ptr @1, i32 %[[TID0:.*]]) |
| 268 | +// CHECK6-NEXT: %[[TID1:.*]] = call ptr @__kmpc_omp_task_alloc(ptr @1, i32 %[[TID0:.*]], i32 1, i64 80, i64 1, ptr @.omp_task_entry..[[ENTRY1:[0-9]+]]) |
| 269 | +// CHECK6-NEXT: %[[TID2:.*]] = getelementptr inbounds nuw %struct.kmp_task_t_with_privates{{.*}}, ptr %[[TID1:.*]], i32 0, i32 0 |
| 270 | +// CHECK6-NEXT: %[[TID3:.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr %[[TID2:.*]], i32 0, i32 5 |
| 271 | +// CHECK6-NEXT: store i64 0, ptr %[[TID3:.*]], align 8 |
| 272 | +// CHECK6-NEXT: %[[TID4:.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr %[[TID2:.*]], i32 0, i32 6 |
| 273 | +// CHECK6-NEXT: store i64 9, ptr %[[TID4:.*]], align 8 |
| 274 | +// CHECK6-NEXT: %[[TID5:.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr %[[TID2:.*]], i32 0, i32 7 |
| 275 | +// CHECK6-NEXT: store i64 1, ptr %[[TID5:.*]], align 8 |
| 276 | +// CHECK6-NEXT: %[[TID6:.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr %[[TID2:.*]], i32 0, i32 9 |
| 277 | +// CHECK6-NEXT: call void @llvm.memset.p0.i64(ptr align 8 %[[TID6:.*]], i8 0, i64 8, i1 false) |
| 278 | +// CHECK6-NEXT: %[[TID7:.*]] = load i64, ptr %[[TID5:.*]], align 8 |
| 279 | +// CHECK6-NEXT: call void @__kmpc_taskloop(ptr @1, i32 %[[TID0:.*]], ptr %[[TID1:.*]], i32 1, ptr %[[TID3:.*]], ptr %4, i64 %[[TID7:.*]], i32 1, i32 0, i64 0, ptr null) |
| 280 | +// CHECK6-NEXT: call void @__kmpc_end_taskgroup(ptr @1, i32 %[[TID0:.*]]) |
| 281 | +// CHECK6-NEXT: call void @__kmpc_taskgroup(ptr @1, i32 %[[TID0:.*]]) |
| 282 | +// CHECK6-NEXT: %[[TID8:.*]] = call ptr @__kmpc_omp_task_alloc(ptr @1, i32 %[[TID0:.*]], i32 129, i64 80, i64 1, ptr @.omp_task_entry..[[ENTRY1:[0-9]+]]) |
| 283 | +// CHECK6-NEXT: %[[TID9:.*]] = getelementptr inbounds nuw %struct.kmp_task_t_with_privates{{.*}}, ptr %[[TID8:.*]], i32 0, i32 0 |
| 284 | +// CHECK6-NEXT: %[[TID10:.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr %[[TID9:.*]], i32 0, i32 5 |
| 285 | +// CHECK6-NEXT: store i64 0, ptr %[[TID10:.*]], align 8 |
| 286 | +// CHECK6-NEXT: %[[TID11:.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr %[[TID9:.*]], i32 0, i32 6 |
| 287 | +// CHECK6-NEXT: store i64 9, ptr %[[TID11:.*]], align 8 |
| 288 | +// CHECK6-NEXT: %[[TID12:.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr %[[TID9:.*]], i32 0, i32 7 |
| 289 | +// CHECK6-NEXT: store i64 1, ptr %[[TID12:.*]], align 8 |
| 290 | +// CHECK6-NEXT: %[[TID13:.*]] = getelementptr inbounds nuw %struct.kmp_task_t{{.*}}, ptr %[[TID9:.*]], i32 0, i32 9 |
| 291 | +// CHECK6-NEXT: call void @llvm.memset.p0.i64(ptr align 8 [[TID13:.*]], i8 0, i64 8, i1 false) |
| 292 | +// CHECK6-NEXT: %[[TID14:.*]] = load i64, ptr [[TID12:.*]], align 8 |
| 293 | +// CHECK6-NEXT: call void @__kmpc_taskloop(ptr @1, i32 %[[TID0:.*]], ptr %[[TID8:.*]], i32 1, ptr %[[TID10:.*]], ptr %[[TID11:.*]], i64 %[[TID14:.*]], i32 1, i32 0, i64 0, ptr null) |
| 294 | +// CHECK6-NEXT: call void @__kmpc_end_taskgroup(ptr @1, i32 %[[TID0:.*]]) |
| 295 | +// CHECK6-NEXT: ret void |
| 296 | + |
244 | 297 | #endif
|
0 commit comments