18 lines · plain
1// RUN: fir-opt --lower-repack-arrays %s | FileCheck %s2 3// Test the current implementation of #fir.omp_safe_temp_array_copy attribute.4// It results in removal of fir.[un]pack_array operations.5func.func @_QPtest(%arg0: !fir.box<!fir.array<?xf32>> {fir.bindc_name = "x"}) {6 %0 = fir.dummy_scope : !fir.dscope7 %1 = fir.pack_array %arg0 heap whole is_safe [#fir.omp_safe_temp_array_copy] : (!fir.box<!fir.array<?xf32>>) -> !fir.box<!fir.array<?xf32>>8 %2 = fir.declare %1 dummy_scope %0 {uniq_name = "_QFtestEx"} : (!fir.box<!fir.array<?xf32>>, !fir.dscope) -> !fir.box<!fir.array<?xf32>>9 fir.unpack_array %1 to %arg0 heap is_safe [#fir.omp_safe_temp_array_copy] : !fir.box<!fir.array<?xf32>>10 return11}12// CHECK-LABEL: func.func @_QPtest(13// CHECK-SAME: %[[VAL_0:[0-9]+|[a-zA-Z$._-][a-zA-Z0-9$._-]*]]: !fir.box<!fir.array<?xf32>> {fir.bindc_name = "x"}) {14// CHECK-NEXT: %[[VAL_1:.*]] = fir.dummy_scope : !fir.dscope15// CHECK-NEXT: %[[VAL_2:.*]] = fir.declare %[[VAL_0]] dummy_scope %[[VAL_1]] {uniq_name = "_QFtestEx"} : (!fir.box<!fir.array<?xf32>>, !fir.dscope) -> !fir.box<!fir.array<?xf32>>16// CHECK-NEXT: return17// CHECK-NEXT: }18