| 1 |
// RUN: fir-opt --lower-repack-arrays %s | FileCheck %s |
| 2 |
|
| 3 |
// Test the current implementation of #fir.omp_safe_temp_array_copy attribute. |
| 4 |
// It results in removal of fir.[un]pack_array operations. |
| 5 |
func.func @_QPtest(%arg0: !fir.box<!fir.array<?xf32>> {fir.bindc_name = "x"}) { |
| 6 |
%0 = fir.dummy_scope : !fir.dscope |
| 7 |
%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 |
return |
| 11 |
} |
| 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.dscope |
| 15 |
// 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: return |
| 17 |
// CHECK-NEXT: } |