// RUN: fir-opt --omp-map-info-finalization --mlir-print-debuginfo %s | FileCheck %s #loc_decl = loc("omp-map-info-finalization-name-loc.fir":12:1) #loc_name = loc("arr(1:42)"(#loc_decl)) func.func @preserve_name_loc_for_descriptor_base_member(%arg0: !fir.box>) { %0 = fir.alloca !fir.box> %1 = fir.zero_bits !fir.heap %2:2 = hlfir.declare %arg0 {fortran_attrs = #fir.var_attrs, uniq_name = "test"} : (!fir.box>) -> (!fir.box>, !fir.box>) %3 = fir.embox %1 : (!fir.heap) -> !fir.box> fir.store %3 to %0 : !fir.ref>> %4:2 = hlfir.declare %0 {fortran_attrs = #fir.var_attrs, uniq_name = "test2"} : (!fir.ref>>) -> (!fir.ref>>, !fir.ref>>) %5 = fir.allocmem i32 {fir.must_be_heap = true} %6 = fir.embox %5 : (!fir.heap) -> !fir.box> fir.store %6 to %4#1 : !fir.ref>> %c0 = arith.constant 1 : index %c1 = arith.constant 0 : index %c2 = arith.constant 10 : index %dims:3 = fir.box_dims %2#1, %c1 : (!fir.box>, index) -> (index, index, index) %bounds = omp.map.bounds lower_bound(%c1 : index) upper_bound(%c2 : index) extent(%dims#1 : index) stride(%dims#2 : index) start_idx(%c0 : index) {stride_in_bytes = true} %7 = fir.box_addr %2#1 : (!fir.box>) -> !fir.ref> %8 = omp.map.info var_ptr(%4#1 : !fir.ref>>, !fir.box>) map_clauses(tofrom) capture(ByRef) -> !fir.ref>> loc(#loc_name) %9 = omp.map.info var_ptr(%7 : !fir.ref>, !fir.array) map_clauses(from) capture(ByRef) bounds(%bounds) -> !fir.ref> omp.target map_entries(%8 -> %arg1, %9 -> %arg2 : !fir.ref>>, !fir.ref>) { omp.terminator } return } // CHECK-LABEL: func.func @preserve_name_loc_for_descriptor_base_member // CHECK: fir.box_offset {{.*}} base_addr : (!fir.ref>>) -> !fir.llvm_ptr> loc(#loc[[LOCID:[0-9]+]]) // CHECK: omp.map.info {{.*}} map_clauses(tofrom){{.*}} loc(#loc[[LOCID]]) // Descriptor maps include `descriptor` on amd-staging / newer lowering. // CHECK: omp.map.info {{.*}} map_clauses(always{{.*}}to){{.*}} members({{.*}}){{.*}} loc(#loc[[LOCID]]) // CHECK: #loc[[LOCID]] = loc("arr(1:42)"({{.*}}))