summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2018-06-21 20:26:33 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2018-06-21 20:26:33 +0000
commit4065b9ae4837d1925a36d2043601738374679224 (patch)
tree76f8a23d4b5e58e9f3098ca97863b91b21d4fc93 /clang/test
parent9a8be606f3f0801df0e128f09e37057da10a0b64 (diff)
downloadbcm5719-llvm-4065b9ae4837d1925a36d2043601738374679224.tar.gz
bcm5719-llvm-4065b9ae4837d1925a36d2043601738374679224.zip
[OPENMP, NVPTX] Fix globalization of the variables passed to orphaned
parallel region. If the current construct requires sharing of the local variable in the inner parallel region, this variable must be globalized to avoid runtime crash. llvm-svn: 335285
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/OpenMP/nvptx_parallel_codegen.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/OpenMP/nvptx_parallel_codegen.cpp b/clang/test/OpenMP/nvptx_parallel_codegen.cpp
index 8f496eb80e4..d1a3104407d 100644
--- a/clang/test/OpenMP/nvptx_parallel_codegen.cpp
+++ b/clang/test/OpenMP/nvptx_parallel_codegen.cpp
@@ -315,6 +315,15 @@ int bar(int n){
// CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+template.+l54}}_worker()
// CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+template.+l54}}(
+// CHECK-32: [[A_ADDR:%.+]] = alloca i32,
+// CHECK-64: [[A_ADDR:%.+]] = alloca i64,
+// CHECK-64: [[CONV:%.+]] = bitcast i64* [[A_ADDR]] to i32*
+// CHECK: [[STACK:%.+]] = call i8* @__kmpc_data_sharing_push_stack(i{{64|32}} 4, i16 0)
+// CHECK: [[BC:%.+]] = bitcast i8* [[STACK]] to %struct._globalized_locals_ty*
+// CHECK-32: [[A:%.+]] = load i32, i32* [[A_ADDR]],
+// CHECK-64: [[A:%.+]] = load i32, i32* [[CONV]],
+// CHECK: [[GLOBAL_A_ADDR:%.+]] = getelementptr inbounds %struct._globalized_locals_ty, %struct._globalized_locals_ty* [[BC]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: store i32 [[A]], i32* [[GLOBAL_A_ADDR]],
// CHECK-LABEL: define internal void @{{.+}}(i32* noalias %{{.+}}, i32* noalias %{{.+}}, i32* dereferenceable{{.*}})
// CHECK: [[CC:%.+]] = alloca i32,
OpenPOWER on IntegriCloud