diff options
Diffstat (limited to 'clang/test/OpenMP/nvptx_parallel_codegen.cpp')
-rw-r--r-- | clang/test/OpenMP/nvptx_parallel_codegen.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/clang/test/OpenMP/nvptx_parallel_codegen.cpp b/clang/test/OpenMP/nvptx_parallel_codegen.cpp index f8f91e87245..2366ee80b88 100644 --- a/clang/test/OpenMP/nvptx_parallel_codegen.cpp +++ b/clang/test/OpenMP/nvptx_parallel_codegen.cpp @@ -70,8 +70,6 @@ int bar(int n){ return a; } -// CHECK: @"_gomp_critical_user_$var" = common global [8 x i32] zeroinitializer - // CHECK-NOT: define {{.*}}void {{@__omp_offloading_.+template.+l17}}_worker() // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+template.+l26}}_worker() @@ -313,4 +311,28 @@ int bar(int n){ // CHECK: [[A:%.+]] = alloca i[[SZ:32|64]], // CHECK: store i[[SZ]] 45, i[[SZ]]* %a, // CHECK: ret void + +// CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+template.+l54}}_worker() +// CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+template.+l54}}( + +// CHECK-LABEL: define internal void @{{.+}}(i32* noalias %{{.+}}, i32* noalias %{{.+}}, i32* dereferenceable{{.*}}) +// CHECK: [[CC:%.+]] = alloca i32, +// CHECK: [[TID:%.+]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x(), +// CHECK: [[NUM_THREADS:%.+]] = call i32 @llvm.nvvm.read.ptx.sreg.ntid.x(), +// CHECK: store i32 0, i32* [[CC]], +// CHECK: br label + +// CHECK: [[CC_VAL:%.+]] = load i32, i32* [[CC]], +// CHECK: [[RES:%.+]] = icmp slt i32 [[CC_VAL]], [[NUM_THREADS]] +// CHECK: br i1 [[RES]], label + +// CHECK: [[CC_VAL:%.+]] = load i32, i32* [[CC]], +// CHECK: [[RES:%.+]] = icmp eq i32 [[TID]], [[CC_VAL]] +// CHECK: br i1 [[RES]], label + +// CHECK: call void @llvm.nvvm.barrier0() +// CHECK: [[NEW_CC_VAL:%.+]] = add nsw i32 [[CC_VAL]], 1 +// CHECK: store i32 [[NEW_CC_VAL]], i32* [[CC]], +// CHECK: br label + #endif |