Changeset View
Changeset View
Standalone View
Standalone View
clang/test/OpenMP/target_parallel_for_uses_allocators_codegen.cpp
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | |||||
// CHECK-DAG: [[SIZES:@.+]] = private unnamed_addr constant [1 x i64] [i64 160] | // CHECK-DAG: [[SIZES:@.+]] = private unnamed_addr constant [1 x i64] [i64 160] | ||||
// CHECK-DAG: [[MAPTYPES:@.+]] = private unnamed_addr constant [1 x i64] [i64 673] | // CHECK-DAG: [[MAPTYPES:@.+]] = private unnamed_addr constant [1 x i64] [i64 673] | ||||
// CHECK: define {{.*}}[[FOO:@.+]]() | // CHECK: define {{.*}}[[FOO:@.+]]() | ||||
void foo() { | void foo() { | ||||
omp_alloctrait_t traits[10]; | omp_alloctrait_t traits[10]; | ||||
omp_allocator_handle_t my_allocator; | omp_allocator_handle_t my_allocator; | ||||
// CHECK: [[RES:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @.[[TGT_REGION:.+]].region_id, i32 1, i8** %{{.+}}, i8** %{{.+}}, i64* getelementptr inbounds ([1 x i64], [1 x i64]* [[SIZES]], i32 0, i32 0), i64* getelementptr inbounds ([1 x i64], [1 x i64]* [[MAPTYPES]], i32 0, i32 0), i32 1, i32 0) | // CHECK: [[RES:%.+]] = call i32 @__tgt_target_teams_mapper(i64 -1, i8* @.[[TGT_REGION:.+]].region_id, i32 1, i8** %{{.+}}, i8** %{{.+}}, i64* getelementptr inbounds ([1 x i64], [1 x i64]* [[SIZES]], i32 0, i32 0), i64* getelementptr inbounds ([1 x i64], [1 x i64]* [[MAPTYPES]], i32 0, i32 0), i8** null, i32 1, i32 0) | ||||
// CHECK: [[CMP:%.+]] = icmp ne i32 [[RES]], 0 | // CHECK: [[CMP:%.+]] = icmp ne i32 [[RES]], 0 | ||||
// CHECK: br i1 [[CMP]], label %[[FAILED:.+]], label %[[DONE:.+]] | // CHECK: br i1 [[CMP]], label %[[FAILED:.+]], label %[[DONE:.+]] | ||||
// CHECK: [[FAILED]]: | // CHECK: [[FAILED]]: | ||||
// CHECK: call void @[[TGT_REGION]]([10 x %struct.omp_alloctrait_t]* %{{[^,]+}}) | // CHECK: call void @[[TGT_REGION]]([10 x %struct.omp_alloctrait_t]* %{{[^,]+}}) | ||||
#pragma omp target parallel for uses_allocators(omp_null_allocator, omp_thread_mem_alloc, my_allocator(traits)) | #pragma omp target parallel for uses_allocators(omp_null_allocator, omp_thread_mem_alloc, my_allocator(traits)) | ||||
for (int i = 0; i < 10; ++i) | for (int i = 0; i < 10; ++i) | ||||
; | ; | ||||
} | } | ||||
Show All 18 Lines |