summaryrefslogtreecommitdiff
path: root/clang/test/OpenMP/target_defaultmap_codegen_01.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@outlook.com>2021-07-01 04:16:56 -0700
committerAlexey Bataev <a.bataev@outlook.com>2022-02-24 11:49:14 -0800
commit638938117aeae5518d6cacd066ffd9830ef4fc9a (patch)
treeec0bc4ba30bef2c63746be97a256ad933807c051 /clang/test/OpenMP/target_defaultmap_codegen_01.cpp
parent140c13d3184d9320493111d55103229d2ad2699b (diff)
[OPENMP]Fix PR50347: Mapping of global scope deep object fails.
Changed the we handle llvm::Constants in sizes arrays. ConstExprs and GlobalValues cannot be used as initializers, need to put them at the runtime, otherwise there wight be the compilation errors. Differential Revision: https://reviews.llvm.org/D105297
Diffstat (limited to 'clang/test/OpenMP/target_defaultmap_codegen_01.cpp')
-rw-r--r--clang/test/OpenMP/target_defaultmap_codegen_01.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/clang/test/OpenMP/target_defaultmap_codegen_01.cpp b/clang/test/OpenMP/target_defaultmap_codegen_01.cpp
index 5702196353b4..1db2737a4440 100644
--- a/clang/test/OpenMP/target_defaultmap_codegen_01.cpp
+++ b/clang/test/OpenMP/target_defaultmap_codegen_01.cpp
@@ -739,7 +739,7 @@ void explicit_maps_single (){
// CK15-LABEL: @.__omp_offloading_{{.*}}implicit_maps_variable_length_array{{.*}}_l{{[0-9]+}}.region_id = weak{{.*}} constant i8 0
-// We don't have a constant map size for VLAs.
+// CK15-DAG: [[SIZES:@.+]] = {{.+}}global [3 x i64] [i64 {{4|8}}, i64 {{4|8}}, i64 0]
// Map types:
// - OMP_MAP_LITERAL + OMP_MAP_TARGET_PARAM + OMP_MAP_IMPLICIT = 800 (vla size)
// - OMP_MAP_LITERAL + OMP_MAP_TARGET_PARAM + OMP_MAP_IMPLICIT = 800 (vla size)
@@ -750,37 +750,31 @@ void explicit_maps_single (){
void implicit_maps_variable_length_array (int a){
double vla[2][a];
- // CK15-DAG: call i32 @__tgt_target_mapper(%struct.ident_t* @{{.+}}, i64 {{.+}}, i8* {{.+}}, i32 3, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], i64* [[SGEP:%[^,]+]], {{.+}}[[TYPES]]{{.+}}, i8** null, i8** null)
+ // CK15-DAG: call i32 @__tgt_target_mapper(%struct.ident_t* @{{.+}}, i64 {{.+}}, i8* {{.+}}, i32 3, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], {{.+}}[[SIZES]]{{.+}}, {{.+}}[[TYPES]]{{.+}}, i8** null, i8** null)
// CK15-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BPS:%[^,]+]], i32 0, i32 0
// CK15-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0
- // CK15-DAG: [[SGEP]] = getelementptr inbounds {{.+}}[[SS:%[^,]+]], i32 0, i32 0
// CK15-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0
// CK15-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0
- // CK15-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[SS]], i32 0, i32 0
// CK15-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i[[sz:64|32]]*
// CK15-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i[[sz]]*
// CK15-DAG: store i[[sz]] 2, i[[sz]]* [[CBP0]]
// CK15-DAG: store i[[sz]] 2, i[[sz]]* [[CP0]]
- // CK15-DAG: store i64 {{8|4}}, i64* [[S0]],
// CK15-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 1
// CK15-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 1
- // CK15-DAG: [[S1:%.+]] = getelementptr inbounds {{.+}}[[SS]], i32 0, i32 1
// CK15-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i[[sz]]*
// CK15-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i[[sz]]*
// CK15-DAG: store i[[sz]] [[VAL:%.+]], i[[sz]]* [[CBP1]]
// CK15-DAG: store i[[sz]] [[VAL]], i[[sz]]* [[CP1]]
- // CK15-DAG: store i64 {{8|4}}, i64* [[S1]],
// CK15-DAG: [[BP2:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 2
// CK15-DAG: [[P2:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 2
- // CK15-DAG: [[S2:%.+]] = getelementptr inbounds {{.+}}[[SS]], i32 0, i32 2
// CK15-DAG: [[CBP2:%.+]] = bitcast i8** [[BP2]] to double**
// CK15-DAG: [[CP2:%.+]] = bitcast i8** [[P2]] to double**
// CK15-DAG: store double* [[DECL:%.+]], double** [[CBP2]]
// CK15-DAG: store double* [[DECL]], double** [[CP2]]
- // CK15-DAG: store i64 [[VALS2:%.+]], i64* [[S2]],
+ // CK15-DAG: store i64 [[VALS2:%.+]], i64* getelementptr inbounds ([3 x i64], [3 x i64]* [[SIZES]], i32 0, i32 2),
// CK15-DAG: [[VALS2]] = {{mul nuw i64 %.+, 8|sext i32 %.+ to i64}}
// CK15: call void [[KERNEL:@.+]](i[[sz]] {{.+}}, i[[sz]] {{.+}}, double* [[DECL]])