1 // expected-no-diagnostics 2 #ifndef HEADER 3 #define HEADER 4 5 ///==========================================================================/// 6 // RUN: %clang_cc1 -DCK22 -verify -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK22 --check-prefix CK22-64 7 // RUN: %clang_cc1 -DCK22 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s 8 // RUN: %clang_cc1 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK22 --check-prefix CK22-64 9 // RUN: %clang_cc1 -DCK22 -verify -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK22 --check-prefix CK22-32 10 // RUN: %clang_cc1 -DCK22 -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s 11 // RUN: %clang_cc1 -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK22 --check-prefix CK22-32 12 13 // RUN: %clang_cc1 -DCK22 -verify -fopenmp -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK22 --check-prefix CK22-64 14 // RUN: %clang_cc1 -DCK22 -fopenmp -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s 15 // RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK22 --check-prefix CK22-64 16 // RUN: %clang_cc1 -DCK22 -verify -fopenmp -fopenmp-version=45 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK22 --check-prefix CK22-32 17 // RUN: %clang_cc1 -DCK22 -fopenmp -fopenmp-version=45 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s 18 // RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK22 --check-prefix CK22-32 19 20 // RUN: %clang_cc1 -DCK22 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK22 --check-prefix CK22-64 21 // RUN: %clang_cc1 -DCK22 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s 22 // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK22 --check-prefix CK22-64 23 // RUN: %clang_cc1 -DCK22 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK22 --check-prefix CK22-32 24 // RUN: %clang_cc1 -DCK22 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s 25 // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK22 --check-prefix CK22-32 26 27 // RUN: %clang_cc1 -DCK22 -verify -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY21 %s 28 // RUN: %clang_cc1 -DCK22 -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s 29 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY21 %s 30 // RUN: %clang_cc1 -DCK22 -verify -fopenmp-simd -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY21 %s 31 // RUN: %clang_cc1 -DCK22 -fopenmp-simd -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s 32 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY21 %s 33 // SIMD-ONLY21-NOT: {{__kmpc|__tgt}} 34 #ifdef CK22 35 36 // CK22-DAG: [[ST:%.+]] = type { float } 37 // CK22-DAG: [[STT:%.+]] = type { i32 } 38 39 // CK22-LABEL: @.__omp_offloading_{{.*}}explicit_maps_globals{{.*}}_l{{[0-9]+}}.region_id = weak constant i8 0 40 // CK22: [[SIZE00:@.+]] = private {{.*}}constant [1 x i64] [i64 4] 41 // CK22: [[MTYPE00:@.+]] = private {{.*}}constant [1 x i64] [i64 35] 42 43 // CK22-LABEL: @.__omp_offloading_{{.*}}explicit_maps_globals{{.*}}_l{{[0-9]+}}.region_id = weak constant i8 0 44 // CK22: [[SIZE01:@.+]] = private {{.*}}constant [1 x i64] [i64 400] 45 // CK22: [[MTYPE01:@.+]] = private {{.*}}constant [1 x i64] [i64 35] 46 47 // CK22-LABEL: @.__omp_offloading_{{.*}}explicit_maps_globals{{.*}}_l{{[0-9]+}}.region_id = weak constant i8 0 48 // CK22: [[SIZE02:@.+]] = private {{.*}}constant [1 x i64] [i64 {{8|4}}] 49 // CK22: [[MTYPE02:@.+]] = private {{.*}}constant [1 x i64] [i64 35] 50 51 // CK22-LABEL: @.__omp_offloading_{{.*}}explicit_maps_globals{{.*}}_l{{[0-9]+}}.region_id = weak constant i8 0 52 // CK22: [[SIZE03:@.+]] = private {{.*}}constant [1 x i64] [i64 16] 53 // CK22: [[MTYPE03:@.+]] = private {{.*}}constant [1 x i64] [i64 35] 54 55 // CK22-LABEL: @.__omp_offloading_{{.*}}explicit_maps_globals{{.*}}_l{{[0-9]+}}.region_id = weak constant i8 0 56 // CK22: [[SIZE04:@.+]] = private {{.*}}constant [1 x i64] [i64 20] 57 // CK22: [[MTYPE04:@.+]] = private {{.*}}constant [1 x i64] [i64 51] 58 59 // CK22-LABEL: @.__omp_offloading_{{.*}}explicit_maps_globals{{.*}}_l{{[0-9]+}}.region_id = weak constant i8 0 60 // CK22: [[SIZE05:@.+]] = private {{.*}}constant [1 x i64] [i64 4] 61 // CK22: [[MTYPE05:@.+]] = private {{.*}}constant [1 x i64] [i64 35] 62 63 // CK22-LABEL: @.__omp_offloading_{{.*}}explicit_maps_globals{{.*}}_l{{[0-9]+}}.region_id = weak constant i8 0 64 // CK22: [[SIZE06:@.+]] = private {{.*}}constant [1 x i64] [i64 400] 65 // CK22: [[MTYPE06:@.+]] = private {{.*}}constant [1 x i64] [i64 35] 66 67 // CK22-LABEL: @.__omp_offloading_{{.*}}explicit_maps_globals{{.*}}_l{{[0-9]+}}.region_id = weak constant i8 0 68 // CK22: [[SIZE07:@.+]] = private {{.*}}constant [1 x i64] [i64 {{8|4}}] 69 // CK22: [[MTYPE07:@.+]] = private {{.*}}constant [1 x i64] [i64 35] 70 71 // CK22-LABEL: @.__omp_offloading_{{.*}}explicit_maps_globals{{.*}}_l{{[0-9]+}}.region_id = weak constant i8 0 72 // CK22: [[SIZE08:@.+]] = private {{.*}}constant [1 x i64] [i64 16] 73 // CK22: [[MTYPE08:@.+]] = private {{.*}}constant [1 x i64] [i64 35] 74 75 // CK22-LABEL: @.__omp_offloading_{{.*}}explicit_maps_globals{{.*}}_l{{[0-9]+}}.region_id = weak constant i8 0 76 // CK22: [[SIZE09:@.+]] = private {{.*}}constant [1 x i64] [i64 20] 77 // CK22: [[MTYPE09:@.+]] = private {{.*}}constant [1 x i64] [i64 51] 78 79 // CK22-LABEL: @.__omp_offloading_{{.*}}explicit_maps_globals{{.*}}_l{{[0-9]+}}.region_id = weak constant i8 0 80 // CK22: [[SIZE10:@.+]] = private {{.*}}constant [1 x i64] [i64 4] 81 // CK22: [[MTYPE10:@.+]] = private {{.*}}constant [1 x i64] [i64 35] 82 83 // CK22-LABEL: @.__omp_offloading_{{.*}}explicit_maps_globals{{.*}}_l{{[0-9]+}}.region_id = weak constant i8 0 84 // CK22: [[SIZE11:@.+]] = private {{.*}}constant [1 x i64] [i64 400] 85 // CK22: [[MTYPE11:@.+]] = private {{.*}}constant [1 x i64] [i64 35] 86 87 // CK22-LABEL: @.__omp_offloading_{{.*}}explicit_maps_globals{{.*}}_l{{[0-9]+}}.region_id = weak constant i8 0 88 // CK22: [[SIZE12:@.+]] = private {{.*}}constant [1 x i64] [i64 {{8|4}}] 89 // CK22: [[MTYPE12:@.+]] = private {{.*}}constant [1 x i64] [i64 35] 90 91 // CK22-LABEL: @.__omp_offloading_{{.*}}explicit_maps_globals{{.*}}_l{{[0-9]+}}.region_id = weak constant i8 0 92 // CK22: [[SIZE13:@.+]] = private {{.*}}constant [1 x i64] [i64 16] 93 // CK22: [[MTYPE13:@.+]] = private {{.*}}constant [1 x i64] [i64 35] 94 95 // CK22-LABEL: @.__omp_offloading_{{.*}}explicit_maps_globals{{.*}}_l{{[0-9]+}}.region_id = weak constant i8 0 96 // CK22: [[SIZE14:@.+]] = private {{.*}}constant [1 x i64] [i64 20] 97 // CK22: [[MTYPE14:@.+]] = private {{.*}}constant [1 x i64] [i64 51] 98 99 int a; 100 int c[100]; 101 int *d; 102 103 struct ST { 104 float fa; 105 }; 106 107 ST sa ; 108 ST sc[100]; 109 ST *sd; 110 111 template<typename T> 112 struct STT { 113 T fa; 114 }; 115 116 STT<int> sta ; 117 STT<int> stc[100]; 118 STT<int> *std; 119 120 // CK22-LABEL: explicit_maps_globals{{.*}}( 121 int explicit_maps_globals(void){ 122 // Region 00 123 // CK22-DAG: call i32 @__tgt_target_mapper(%struct.ident_t* @{{.+}}, i64 {{[^,]+}}, i8* {{[^,]+}}, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[SIZE00]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE00]]{{.+}}, i8** null, i8** null) 124 // CK22-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]] 125 // CK22-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]] 126 127 // CK22-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 128 // CK22-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 129 // CK22-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32** 130 // CK22-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** 131 // CK22-DAG: store i32* @a, i32** [[CBP0]] 132 // CK22-DAG: store i32* @a, i32** [[CP0]] 133 134 // CK22: call void [[CALL00:@.+]](i32* {{[^,]+}}) 135 #pragma omp target map(a) 136 { a+=1; } 137 138 // Region 01 139 // CK22-DAG: call i32 @__tgt_target_mapper(%struct.ident_t* @{{.+}}, i64 {{[^,]+}}, i8* {{[^,]+}}, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[SIZE01]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE01]]{{.+}}, i8** null, i8** null) 140 // CK22-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]] 141 // CK22-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]] 142 143 // CK22-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 144 // CK22-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 145 // CK22-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [100 x i32]** 146 // CK22-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [100 x i32]** 147 // CK22-DAG: store [100 x i32]* @c, [100 x i32]** [[CBP0]] 148 // CK22-DAG: store [100 x i32]* @c, [100 x i32]** [[CP0]] 149 150 // CK22: call void [[CALL01:@.+]]([100 x i32]* {{[^,]+}}) 151 #pragma omp target map(c) 152 { c[3]+=1; } 153 154 // Region 02 155 // CK22-DAG: call i32 @__tgt_target_mapper(%struct.ident_t* @{{.+}}, i64 {{[^,]+}}, i8* {{[^,]+}}, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[SIZE02]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE02]]{{.+}}, i8** null, i8** null) 156 // CK22-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]] 157 // CK22-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]] 158 159 // CK22-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 160 // CK22-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 161 // CK22-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32*** 162 // CK22-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32*** 163 // CK22-DAG: store i32** @d, i32*** [[CBP0]] 164 // CK22-DAG: store i32** @d, i32*** [[CP0]] 165 166 // CK22: call void [[CALL02:@.+]](i32** {{[^,]+}}) 167 #pragma omp target map(d) 168 { d[3]+=1; } 169 170 // Region 03 171 // CK22-DAG: call i32 @__tgt_target_mapper(%struct.ident_t* @{{.+}}, i64 {{[^,]+}}, i8* {{[^,]+}}, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[SIZE03]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE03]]{{.+}}, i8** null, i8** null) 172 // CK22-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]] 173 // CK22-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]] 174 175 // CK22-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 176 // CK22-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 177 // CK22-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [100 x i32]** 178 // CK22-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** 179 // CK22-DAG: store [100 x i32]* @c, [100 x i32]** [[CBP0]] 180 // CK22-DAG: store i32* getelementptr inbounds ([100 x i32], [100 x i32]* @c, i{{.+}} 0, i{{.+}} 1), i32** [[CP0]] 181 182 // CK22: call void [[CALL03:@.+]]([100 x i32]* {{[^,]+}}) 183 #pragma omp target map(c[1:4]) 184 { c[3]+=1; } 185 186 // Region 04 187 // CK22-DAG: call i32 @__tgt_target_mapper(%struct.ident_t* @{{.+}}, i64 {{[^,]+}}, i8* {{[^,]+}}, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[SIZE04]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE04]]{{.+}}, i8** null, i8** null) 188 // CK22-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]] 189 // CK22-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]] 190 191 // CK22-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 192 // CK22-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 193 // CK22-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32*** 194 // CK22-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** 195 // CK22-DAG: store i32** @d, i32*** [[CBP0]] 196 // CK22-DAG: store i32* [[SEC0:%.+]], i32** [[CP0]] 197 // CK22-DAG: [[SEC0]] = getelementptr {{.*}}i32* [[RVAR00:%.+]], i{{.+}} 2 198 // CK22-DAG: [[RVAR00]] = load i32*, i32** @d 199 200 // CK22: call void [[CALL04:@.+]](i32* {{[^,]+}}) 201 #pragma omp target map(d[2:5]) 202 { d[3]+=1; } 203 204 // Region 05 205 // CK22-DAG: call i32 @__tgt_target_mapper(%struct.ident_t* @{{.+}}, i64 {{[^,]+}}, i8* {{[^,]+}}, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[SIZE05]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE05]]{{.+}}, i8** null, i8** null) 206 // CK22-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]] 207 // CK22-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]] 208 209 // CK22-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 210 // CK22-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 211 // CK22-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[ST]]** 212 // CK22-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[ST]]** 213 // CK22-DAG: store [[ST]]* @sa, [[ST]]** [[CBP0]] 214 // CK22-DAG: store [[ST]]* @sa, [[ST]]** [[CP0]] 215 216 // CK22: call void [[CALL05:@.+]]([[ST]]* {{[^,]+}}) 217 #pragma omp target map(sa) 218 { sa.fa+=1; } 219 220 // Region 06 221 // CK22-DAG: call i32 @__tgt_target_mapper(%struct.ident_t* @{{.+}}, i64 {{[^,]+}}, i8* {{[^,]+}}, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[SIZE06]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE06]]{{.+}}, i8** null, i8** null) 222 // CK22-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]] 223 // CK22-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]] 224 225 // CK22-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 226 // CK22-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 227 // CK22-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [100 x [[ST]]]** 228 // CK22-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [100 x [[ST]]]** 229 // CK22-DAG: store [100 x [[ST]]]* @sc, [100 x [[ST]]]** [[CBP0]] 230 // CK22-DAG: store [100 x [[ST]]]* @sc, [100 x [[ST]]]** [[CP0]] 231 232 // CK22: call void [[CALL06:@.+]]([100 x [[ST]]]* {{[^,]+}}) 233 #pragma omp target map(sc) 234 { sc[3].fa+=1; } 235 236 // Region 07 237 // CK22-DAG: call i32 @__tgt_target_mapper(%struct.ident_t* @{{.+}}, i64 {{[^,]+}}, i8* {{[^,]+}}, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[SIZE07]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE07]]{{.+}}, i8** null, i8** null) 238 // CK22-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]] 239 // CK22-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]] 240 241 // CK22-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 242 // CK22-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 243 // CK22-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[ST]]*** 244 // CK22-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[ST]]*** 245 // CK22-DAG: store [[ST]]** @sd, [[ST]]*** [[CBP0]] 246 // CK22-DAG: store [[ST]]** @sd, [[ST]]*** [[CP0]] 247 248 // CK22: call void [[CALL07:@.+]]([[ST]]** {{[^,]+}}) 249 #pragma omp target map(sd) 250 { sd[3].fa+=1; } 251 252 // Region 08 253 // CK22-DAG: call i32 @__tgt_target_mapper(%struct.ident_t* @{{.+}}, i64 {{[^,]+}}, i8* {{[^,]+}}, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[SIZE08]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE08]]{{.+}}, i8** null, i8** null) 254 // CK22-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]] 255 // CK22-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]] 256 257 // CK22-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 258 // CK22-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 259 // CK22-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [100 x [[ST]]]** 260 // CK22-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[ST]]** 261 // CK22-DAG: store [100 x [[ST]]]* @sc, [100 x [[ST]]]** [[CBP0]] 262 // CK22-DAG: store [[ST]]* getelementptr inbounds ([100 x [[ST]]], [100 x [[ST]]]* @sc, i{{.+}} 0, i{{.+}} 1), [[ST]]** [[CP0]] 263 264 // CK22: call void [[CALL08:@.+]]([100 x [[ST]]]* {{[^,]+}}) 265 #pragma omp target map(sc[1:4]) 266 { sc[3].fa+=1; } 267 268 // Region 09 269 // CK22-DAG: call i32 @__tgt_target_mapper(%struct.ident_t* @{{.+}}, i64 {{[^,]+}}, i8* {{[^,]+}}, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[SIZE09]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE09]]{{.+}}, i8** null, i8** null) 270 // CK22-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]] 271 // CK22-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]] 272 273 // CK22-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 274 // CK22-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 275 // CK22-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[ST]]*** 276 // CK22-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[ST]]** 277 // CK22-DAG: store [[ST]]** @sd, [[ST]]*** [[CBP0]] 278 // CK22-DAG: store [[ST]]* [[SEC0:%.+]], [[ST]]** [[CP0]] 279 // CK22-DAG: [[SEC0]] = getelementptr {{.*}}[[ST]]* [[RVAR00:%.+]], i{{.+}} 2 280 // CK22-DAG: [[RVAR00]] = load [[ST]]*, [[ST]]** @sd 281 282 // CK22: call void [[CALL09:@.+]]([[ST]]* {{[^,]+}}) 283 #pragma omp target map(sd[2:5]) 284 { sd[3].fa+=1; } 285 286 // Region 10 287 // CK22-DAG: call i32 @__tgt_target_mapper(%struct.ident_t* @{{.+}}, i64 {{[^,]+}}, i8* {{[^,]+}}, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[SIZE10]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE10]]{{.+}}, i8** null, i8** null) 288 // CK22-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]] 289 // CK22-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]] 290 291 // CK22-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 292 // CK22-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 293 // CK22-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[STT]]** 294 // CK22-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[STT]]** 295 // CK22-DAG: store [[STT]]* @sta, [[STT]]** [[CBP0]] 296 // CK22-DAG: store [[STT]]* @sta, [[STT]]** [[CP0]] 297 298 // CK22: call void [[CALL10:@.+]]([[STT]]* {{[^,]+}}) 299 #pragma omp target map(sta) 300 { sta.fa+=1; } 301 302 // Region 11 303 // CK22-DAG: call i32 @__tgt_target_mapper(%struct.ident_t* @{{.+}}, i64 {{[^,]+}}, i8* {{[^,]+}}, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[SIZE11]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE11]]{{.+}}, i8** null, i8** null) 304 // CK22-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]] 305 // CK22-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]] 306 307 // CK22-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 308 // CK22-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 309 // CK22-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [100 x [[STT]]]** 310 // CK22-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [100 x [[STT]]]** 311 // CK22-DAG: store [100 x [[STT]]]* @stc, [100 x [[STT]]]** [[CBP0]] 312 // CK22-DAG: store [100 x [[STT]]]* @stc, [100 x [[STT]]]** [[CP0]] 313 314 // CK22: call void [[CALL11:@.+]]([100 x [[STT]]]* {{[^,]+}}) 315 #pragma omp target map(stc) 316 { stc[3].fa+=1; } 317 318 // Region 12 319 // CK22-DAG: call i32 @__tgt_target_mapper(%struct.ident_t* @{{.+}}, i64 {{[^,]+}}, i8* {{[^,]+}}, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[SIZE12]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE12]]{{.+}}, i8** null, i8** null) 320 // CK22-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]] 321 // CK22-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]] 322 323 // CK22-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 324 // CK22-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 325 // CK22-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[STT]]*** 326 // CK22-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[STT]]*** 327 // CK22-DAG: store [[STT]]** @std, [[STT]]*** [[CBP0]] 328 // CK22-DAG: store [[STT]]** @std, [[STT]]*** [[CP0]] 329 330 // CK22: call void [[CALL12:@.+]]([[STT]]** {{[^,]+}}) 331 #pragma omp target map(std) 332 { std[3].fa+=1; } 333 334 // Region 13 335 // CK22-DAG: call i32 @__tgt_target_mapper(%struct.ident_t* @{{.+}}, i64 {{[^,]+}}, i8* {{[^,]+}}, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[SIZE13]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE13]]{{.+}}, i8** null, i8** null) 336 // CK22-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]] 337 // CK22-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]] 338 339 // CK22-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 340 // CK22-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 341 // CK22-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [100 x [[STT]]]** 342 // CK22-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[STT]]** 343 // CK22-DAG: store [100 x [[STT]]]* @stc, [100 x [[STT]]]** [[CBP0]] 344 // CK22-DAG: store [[STT]]* getelementptr inbounds ([100 x [[STT]]], [100 x [[STT]]]* @stc, i{{.+}} 0, i{{.+}} 1), [[STT]]** [[CP0]] 345 346 // CK22: call void [[CALL13:@.+]]([100 x [[STT]]]* {{[^,]+}}) 347 #pragma omp target map(stc[1:4]) 348 { stc[3].fa+=1; } 349 350 // Region 14 351 // CK22-DAG: call i32 @__tgt_target_mapper(%struct.ident_t* @{{.+}}, i64 {{[^,]+}}, i8* {{[^,]+}}, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[SIZE14]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE14]]{{.+}}, i8** null, i8** null) 352 // CK22-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]] 353 // CK22-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]] 354 355 // CK22-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 356 // CK22-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 357 // CK22-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[STT]]*** 358 // CK22-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[STT]]** 359 // CK22-DAG: store [[STT]]** @std, [[STT]]*** [[CBP0]] 360 // CK22-DAG: store [[STT]]* [[SEC0:%.+]], [[STT]]** [[CP0]] 361 // CK22-DAG: [[SEC0]] = getelementptr {{.*}}[[STT]]* [[RVAR00:%.+]], i{{.+}} 2 362 // CK22-DAG: [[RVAR00]] = load [[STT]]*, [[STT]]** @std 363 364 // CK22: call void [[CALL14:@.+]]([[STT]]* {{[^,]+}}) 365 #pragma omp target map(std[2:5]) 366 { std[3].fa+=1; } 367 368 return 0; 369 } 370 // CK22: define {{.+}}[[CALL00]] 371 // CK22: define {{.+}}[[CALL01]] 372 // CK22: define {{.+}}[[CALL02]] 373 // CK22: define {{.+}}[[CALL03]] 374 // CK22: define {{.+}}[[CALL04]] 375 // CK22: define {{.+}}[[CALL05]] 376 // CK22: define {{.+}}[[CALL06]] 377 // CK22: define {{.+}}[[CALL07]] 378 // CK22: define {{.+}}[[CALL08]] 379 // CK22: define {{.+}}[[CALL09]] 380 // CK22: define {{.+}}[[CALL10]] 381 // CK22: define {{.+}}[[CALL11]] 382 // CK22: define {{.+}}[[CALL12]] 383 // CK22: define {{.+}}[[CALL13]] 384 // CK22: define {{.+}}[[CALL14]] 385 #endif // CK22 386 #endif 387